|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines the methods provided by the workflow engine.
Method Summary | |
WfResource |
asResource(java.security.Principal principal)
Given a principal , return the
workflow resource associated with this principal. |
java.util.Collection |
authorizers(WfResource resource)
Given a , return the collection of
resources this resource is authorized for. |
java.security.Principal |
caller()
Returns the currently (i.e. for this call) authenticated user as a Principal . |
Configuration |
configuration()
Return the workflow engine configuration. |
EventSubscriber |
createEventSubscriber()
Returns an event subscriber. |
EventSubscriber |
createEventSubscriber(java.lang.String processKey,
java.lang.String eventTypes)
Returns an event subscriber that receives events as specified by the parameters. |
void |
doFinish(WfActivity act,
ProcessData result)
Set a result and complete an activity in a new transaction. |
WfObject |
eventReceiver(WfAuditHandler handler)
Deprecated. since version 1.3.2. Use
instead and set a handler for the object thus obtained |
java.lang.Object |
executeBatch(Batch batch)
Execute a batch in the context of the workflow service i.e. on the server. |
Channel |
getChannel(WfProcess process,
java.lang.String channelName)
Return a named communication channel to the given process. |
Channel |
getChannel(WfProcess process,
java.lang.String channelName,
boolean sendOnly)
Return a named communication channel to the given process. |
java.util.Collection |
knownResources()
Returns at least the collection of all the workflow resources that have been assigned work items, but optionally it can return the additional workflow resources that are known to the resource assignment service. |
ProcessDefinitionDirectory |
processDefinitionDirectory()
Return the process definition directory of the workflow service. |
ProcessDirectory |
processDirectory()
Return the process directory of the workflow service. |
void |
registerRequester(WfRequester requester)
Register a WfRequester . |
void |
release(WfObject obj)
Release an object obtained from the workflow service immediately instead of waiting for it to be automatically released. |
java.util.Collection |
requestedBy(WfRequester req)
Return the processes requested by the given requester. |
WfResource |
resourceByKey(java.lang.String key)
Given the key of a WfResource
(obtained with ), return the workflow resource
associated with this key. |
java.util.Map |
serviceProperties()
Returns the properties that uniquely decribe the workflow service in the current environment. |
Method Detail |
public java.util.Map serviceProperties() throws java.rmi.RemoteException
WorkflowService
does not implement
Serializable
because implementations of this class
may have attributes that e.g. include network connections to
the server and may thus not be serializable. Nevertheless it
should be possible to obtain some unique reference to a
workflow service and to restore this service without having to
"manually" collect the (implementation dependant!) properties
set for WorkflowServiceFactory
before the call to
newInstance
.
This methods therefore returns a set of relevant properties
that will restore this workflow service when set as properties
of WorkflowServiceFactory
in the same or an
equivalent environment before newInstance
is
called. The properties returned by this method are, of course,
based on the properties in effect when the
WorkflowService
was initially created.
Note the restriction "same or equivalent environment" in the
previous paragraph. One of the explicitly mentioned properties
of the WorkflowServiceFactory
(in a J2EE based
implementation) is the InitialContext
used. If not
set explicitly, the default initial context may be specified by
something like "localhost:1099
". While the
properties returned by serviceProperties
will
include this property of the connection to the JNDI provider,
using the properties in a different JVM on a different machine
may result in a different workflow service (or no workflow
service at all) because a different JNDI server is accessed.
The impossibility to transfer all relevant information between
JVM's under all circumstances (InitialContext
is
not serializable as may be some other crucial information in an
implementation based on some other technology than J2EE) has
prevented us from demanding serializability for
WorkflowService
. The requirement to obtain the
service information explicitly and to create a new instance
should result in some awareness of the problems.
java.rmi.RemoteException
- if a system-level error occurspublic Configuration configuration() throws java.rmi.RemoteException
java.rmi.RemoteException
- if a system-level error occurs.public ProcessDefinitionDirectory processDefinitionDirectory() throws java.rmi.RemoteException
java.rmi.RemoteException
- if a system-level error occurs.public ProcessDirectory processDirectory() throws java.rmi.RemoteException
java.rmi.RemoteException
- if a system-level error occurs.public WfResource asResource(java.security.Principal principal) throws java.rmi.RemoteException, InvalidKeyException
principal
, return the
workflow resource associated with this principal. This method
is usually used to get a WfResource
object
corresponding to the current user. The WfResource
object can subsequently be used to e.g. determine the current
user's worklist.
Calls to this method are typically delegated to
. Note that
since implementation of this method by the resource assignment
service is optional, calling this method may result in an
ResourceAssignmentService.asResource
UnsupportedOperationException
.
principal
- the principal.
WfResource
object corresponding to the
given principal.
InvalidKeyException
- if a resource with the given principal
can't be found.
java.rmi.RemoteException
- if a system-level error occurs.public WfResource resourceByKey(java.lang.String key) throws InvalidKeyException, java.rmi.RemoteException
key
of a WfResource
(obtained with resourceKey()
), return the workflow resource
associated with this key.
Calls to this method are typically delegated to
. Note
that since implementation of this method by the resource
assignment service is optional, calling this method may result
in an ResourceAssignmentService.resourceByKey
UnsupportedOperationException
.
key
- the key.
WfResource
object corresponding to the
given key.
InvalidKeyException
- if the resource with the given
key can't be found. As the environment is a concurrent multi
user environment, WfResource
objects (and keys obtained
from WfResource
objects) may become invalid.
java.rmi.RemoteException
- if a system-level error occurs.ResourceAssignmentService#resourceByKey
public java.util.Collection knownResources() throws java.rmi.RemoteException
ResourceAssignmentService.knownResources
. Note
that since implementation of this method by the resource
assignment service is optional, calling this method may result
in an UnsupportedOperationException
.
WfResource
).
java.rmi.RemoteException
- if a system-level error occurs.ResourceAssignmentService#knownResources
public java.util.Collection authorizers(WfResource resource) throws java.rmi.RemoteException
WfResource
object
, return the collection of
resources this resource is authorized for.This method usually returns all groups the resource is a member of and all roles assigned to the resource.
Calls to this method are typically delegated to
. Note that
since implementation of this method by the resource assignment
service is optional, calling this method may result in an
ResourceAssignmentService.authorizers
UnsupportedOperationException
.
resource
- the resource.
WfResource
objects, not
including resource
java.rmi.RemoteException
- if a system-level error occurs.public WfObject eventReceiver(WfAuditHandler handler) throws java.rmi.RemoteException
createEventSubscriber
instead and set a handler for the object thus obtained
release
when no longer needed as
they may consume considerable resources.
handler
- the handler for received events.
java.rmi.RemoteException
- if a system-level error occurs.public EventSubscriber createEventSubscriber() throws java.io.IOException
release
when no
longer needed as they may consume considerable resources.
java.io.IOException
- if an error occurs.public EventSubscriber createEventSubscriber(java.lang.String processKey, java.lang.String eventTypes) throws java.io.IOException
release
when no longer needed as
they may consume considerable resources.
processKey
- if not null
, receive events for
the given process onlyeventTypes
- if not null
, receive events of
the given types only. Types are specified as a whitespace,
comma or semicolon separated list of event names. See WfAuditEvent
for a list of valid event names.
java.io.IOException
- if an error occurs.public void registerRequester(WfRequester requester) throws java.rmi.RemoteException
WfRequester
. Registered requesters'
receiveEvent
methods will be called for their
performers. Note that a requester must be registered before
it is used for process creation. Else events may be lost.
requester
- the requester to be registered.
java.rmi.RemoteException
- if a system-level error occurs.public java.util.Collection requestedBy(WfRequester req) throws java.rmi.RemoteException
WfRequester
. Applications should use WfRequester.performers()
instead.
req
- the requester.
java.rmi.RemoteException
- if a system-level error occurs.public void doFinish(WfActivity act, ProcessData result) throws InvalidDataException, CannotCompleteException, java.rmi.RemoteException
setResult
or complete
on an activity may not cause the tool
invocation to be repeated (as would be the case when simply
calling setResult
or complete
due to
the transaction rollback associated with an exception).
As an example consider an
InvalidDataException
. This usually occurs when the
result contains an item that is not a declared process data
field. Ususally, repeating the tool invocation will not solve
this problem.
act
- the Activity
.result
- the tool's result data. If null
do
not call setResult
.
InvalidDataException
- see WfActivity.setResult(...)
CannotCompleteException
- see WfActivity.complete()
java.rmi.RemoteException
- if a system-level error occurs.public void release(WfObject obj)
We do not want to define a specific mechanism for implementing the remote invocation mechanism used with the workflow API. Therefore, we cannot demand that each object defines a method to release resources (like e.g. CORBA's release). This method knows about the implementation specifics and acts appropriately.
obj
- the object which is no longer used.public java.lang.Object executeBatch(Batch batch) throws java.rmi.RemoteException, java.lang.reflect.InvocationTargetException
We do not want to define a specific mechanism for implementing the remote invocation mechanism used with the workflow API. Yet it is obvious that any implementation can profit from the possibility to execute several actions as one call to the server.
batch
- the batch to be executed.
Batch.execute
.
java.rmi.RemoteException
- if a system-level error occurs.
java.lang.reflect.InvocationTargetException
- if thrown by Batch.execute
public Channel getChannel(WfProcess process, java.lang.String channelName) throws java.rmi.RemoteException
Channels should be released
when no longer
needed to free resources.
process
- the process to communicate withchannelName
- the channel name
java.rmi.RemoteException
- if a system-level error occurs.public Channel getChannel(WfProcess process, java.lang.String channelName, boolean sendOnly) throws java.rmi.RemoteException
Channels should be released
when no longer
needed to free resources.
process
- the process to communicate withchannelName
- the channel namesendOnly
- if set, returns a channel that may only be used
for sending messages. This may save some resources.
java.rmi.RemoteException
- if a system-level error occurs.public java.security.Principal caller() throws java.rmi.RemoteException
Principal
.In an environment where authentication is performed by the container, it may not be easy to discover this information. Although most container environments provide a possibility to access the current principal, there may be a mapping between the client's representation of the currently authenticated user and the workflow engine's (i.e. server's) representation.
java.rmi.RemoteException
asResource(java.security.Principal)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |