de.danet.an.workflow.api
Interface Activity

All Superinterfaces:
java.util.EventListener, ExecutionObject, java.io.Serializable, WfActivity, WfAuditHandler, WfExecutionObject, WfObject, WfRequester

public interface Activity
extends ExecutionObject, WfActivity

Interface Activity adds some functions to the OMG activity.


Nested Class Summary
static class Activity.ClosedCompletedState
          This class defines the sub-states of ClosedState.COMPLETED of a WfExecutionObject.
static class Activity.DeadlineInfo
          Class DeadlineInfo describes all properties of a deadline.
static interface Activity.Implementation
          The super interface of possible activity implementation descriptions.
static class Activity.Info
          Class Info combines various informational attributes about an activity in a single structure for efficient retrieval.
static class Activity.JoinAndSplitMode
          This class defines the join and split modes for an activity.
static class Activity.StartFinishMode
          This class defines the values for start and finish mode for an Activity.
static interface Activity.SubFlowImplementation
          This interface describes the implementation of an activity by a sub flow.
static interface Activity.ToolImplementation
          This interface describes the implementation of an activity by a tool.
 
Nested classes inherited from class de.danet.an.workflow.omgcore.WfExecutionObject
WfExecutionObject.ClosedState, WfExecutionObject.NotRunningState, WfExecutionObject.OpenState, WfExecutionObject.State
 
Method Summary
 void abandon(java.lang.String exceptionName)
          Force the completion of this activity, leaving it in state "closed.completed.abandoned".
 Activity.Info activityInfo()
          This method returns all available information about the activity in a single operation.
 java.lang.String blockActivity()
          Returns the key of the "parent" block activity.
 void changeAssignment(WfResource oldResource, WfResource newResource)
          Change an assignment for enacting the activity.
 boolean choose()
          Makes this activity the chosen one in a set of activities started by an AND split with the "deferred choice" option set.
 Activity.DeadlineInfo[] deadlines()
          Returns the deadlines defined for this activity.
 Activity.Implementation executor()
          Returns the current executor.
 WfResource getResource(WfAssignment asnmnt)
          Get the resource associated with an Assignment.
 java.lang.String[] handledExceptions()
          Returns the names of the exceptions handled by this activity.
 Activity.Implementation[] implementation()
          Returns the implementation of the activity as Implementations.
 Activity.JoinAndSplitMode joinMode()
          Returns the join mode.
 java.util.List nextActivities()
          Returns the list of activities that may follow this activity, i.e. to which transitions exist.
 java.lang.String performer()
          Returns the performer as string.
 void removeAssignment(WfResource resource)
          Removes an assignment for enacting the activity.
 Activity.JoinAndSplitMode splitMode()
          Returns the split mode.
 ActivityUniqueKey uniqueKey()
          Return a unique key for the activity.
 
Methods inherited from interface de.danet.an.workflow.api.ExecutionObject
changeState, debugEnabled, typedState
 
Methods inherited from interface de.danet.an.workflow.omgcore.WfExecutionObject
abort, changeState, description, history, howClosed, key, lastStateTime, name, priority, processContext, resume, setDescription, setName, setPriority, setProcessContext, state, suspend, terminate, validStates, whileOpen, whyNotRunning, workflowState
 
Methods inherited from interface de.danet.an.workflow.omgcore.WfActivity
assignments, complete, container, isMemberOfAssignments, result, setResult
 
Methods inherited from interface de.danet.an.workflow.omgcore.WfRequester
isMemberOfPerformers, performers
 
Methods inherited from interface de.danet.an.workflow.omgcore.WfAuditHandler
receiveEvent
 

Method Detail

uniqueKey

public ActivityUniqueKey uniqueKey()
                            throws java.rmi.RemoteException
Return a unique key for the activity. (Note that the OMG interface defines the key returned by the key() method as unique within the scope of the containing process only.)

Returns:
value of uniqueKey
Throws:
java.rmi.RemoteException - if a system-level error occurs

implementation

public Activity.Implementation[] implementation()
                                         throws java.rmi.RemoteException
Returns the implementation of the activity as Implementations.

Returns:
an array of Implementation}s or null if no implementation is defined
Throws:
java.rmi.RemoteException - if a system-level error occurs

performer

public java.lang.String performer()
                           throws java.rmi.RemoteException
Returns the performer as string.

Returns:
performer as string
Throws:
java.rmi.RemoteException - if a system-level error occurs

executor

public Activity.Implementation executor()
                                 throws java.rmi.RemoteException
Returns the current executor.

Returns:
current executor or null if no executor running
Throws:
java.rmi.RemoteException - if a system-level error occurs

joinMode

public Activity.JoinAndSplitMode joinMode()
                                   throws java.rmi.RemoteException
Returns the join mode.

Returns:
join mode
Throws:
java.rmi.RemoteException - if a system-level error occurs

splitMode

public Activity.JoinAndSplitMode splitMode()
                                    throws java.rmi.RemoteException
Returns the split mode.

Returns:
split mode
Throws:
java.rmi.RemoteException - if a system-level error occurs

nextActivities

public java.util.List nextActivities()
                              throws java.rmi.RemoteException
Returns the list of activities that may follow this activity, i.e. to which transitions exist.

Returns:
the list of Activity objects.
Throws:
java.rmi.RemoteException - if a system-level error occurs

handledExceptions

public java.lang.String[] handledExceptions()
                                     throws java.rmi.RemoteException
Returns the names of the exceptions handled by this activity.

Returns:
handled exceptions
Throws:
java.rmi.RemoteException - if a system-level error occurs

deadlines

public Activity.DeadlineInfo[] deadlines()
                                  throws java.rmi.RemoteException
Returns the deadlines defined for this activity.

Returns:
the deadlines
Throws:
java.rmi.RemoteException - if a system-level error occurs

activityInfo

public Activity.Info activityInfo()
                           throws java.rmi.RemoteException
This method returns all available information about the activity in a single operation.

Returns:
the resulting Activity.Info value
Throws:
java.rmi.RemoteException - if a system-level error occurs

blockActivity

public java.lang.String blockActivity()
                               throws java.rmi.RemoteException
Returns the key of the "parent" block activity. All activities implicitly created by a block activity share the same block activity key.

Note that there need not be an activity with the returned key, as an activity set is actually a template describing how to implement block activities. The information obtained can mainly be used to group all activities that have been instantiated as part of an activity set.

Returns:
an identification of the block activity that caused this activity to be instantiated or null if this activity was not instantiated as part of an activity set
Throws:
java.rmi.RemoteException - if a system-level error occurs

abandon

public void abandon(java.lang.String exceptionName)
             throws java.rmi.RemoteException,
                    TransitionNotAllowedException
Force the completion of this activity, leaving it in state "closed.completed.abandoned". Does nothing if the activity is in state "closed" already or has not been started ("open.not_running.not_started").

An abandoned activity is considered to be completed under exceptional circumstances. Therefore only transitions with conditions of type EXCEPTION or DEFAULTEXCEPTION are considered when evaluating the set of subsequent activities. The argument is the name of the exception which may be used to distinguish different exceptions in transition evaluation (see XPDL).

This method should be used with care. In general, exceptions have a different level of abstraction in a workflow process description than in Java programming. The author of a workflow process should not have to know about e.g. a "SAXException". But he may know what to do in case of a "ResultInvalid" exception (though this kind of problem should only arise during development anyway).

This method may only be called during tool execution. Note that calling this method does not terminate tool execution, i.e. the method will return. A tool agent should, however, not try to do anything with the activity any more after calling this method.

Parameters:
exceptionName - the name of the exception
Throws:
java.rmi.RemoteException - if a system-level error occurs
TransitionNotAllowedException - if the activity is not executing a tool

getResource

public WfResource getResource(WfAssignment asnmnt)
                       throws java.rmi.RemoteException
Get the resource associated with an Assignment. The method calls the corresponding method of the resource assignment service. This method is intended to be used by resource assignment systems for implementing WfAssignment.assignee.

Clients should not use this method but rather call WfAssignment.assignee.

Parameters:
asnmnt - the assignment
Returns:
the resource
Throws:
java.rmi.RemoteException - if a system-level error occurs.
Since:
1.3.4

changeAssignment

public void changeAssignment(WfResource oldResource,
                             WfResource newResource)
                      throws java.rmi.RemoteException,
                             InvalidResourceException,
                             AlreadyAssignedException,
                             NotAssignedException
Change an assignment for enacting the activity. This method calls the corresponding method of the resource assignment service and creates the appropriate audit event.

This method is intended to be used by resource assignment systems for implementing WfAssignment.setAssignee. Resource assignment systems are responsible for implementing WfAssignment and could therefore perform the reassignment directly; this would, however, leave the generation of notifications unexecuted.

Clients should not use this method but rather call WfAssignment.setAssignee.

Parameters:
oldResource - the resource that has its assignment removed
newResource - the resource to be assigned
Throws:
java.rmi.RemoteException - if a system-level error occurs
InvalidResourceException - if the resource is invalid. As the environment is a concurrent multi user environment, WfResource objects may become invalid.
AlreadyAssignedException - if the assignment already exists
NotAssignedException - if there is no assignment to the old resource

removeAssignment

public void removeAssignment(WfResource resource)
                      throws java.rmi.RemoteException,
                             InvalidResourceException,
                             NotAssignedException
Removes an assignment for enacting the activity. This method calls the corresponding method of the resource assignment service and creates the appropriate audit event.

This method is intended to be used by resource management systems for implementing WfResource.release.

Clients should not use this method but rather call WfResource.release.

Parameters:
resource - the resource whose assignment is to be canceled
Throws:
java.rmi.RemoteException - if a system-level error occurs
InvalidResourceException - if the resource is invalid. As the environment is a concurrent multi user environment, WfResource objects may become invalid.
NotAssignedException - if there is no such assignment

choose

public boolean choose()
               throws java.rmi.RemoteException,
                      TransitionNotAllowedException
Makes this activity the chosen one in a set of activities started by an AND split with the "deferred choice" option set. All other activities in the set are reset to their initial state.

If the activity does not participate in a deferred choice, this method does nothing and returns true.

Returns:
true if the activity could be made the effectively chosen one
Throws:
java.rmi.RemoteException - if a system-level error occurs
TransitionNotAllowedException - if the activity is neither running nor suspended