Interface SynchronousActivityStarting
- All Superinterfaces:
ActivityStarting
ActivityStarting with the synchronous
start or resuming of activities. This allows to wait for the successful start
and to retrieve the GUIContext of the started/resumed
activity/application. For instance, requests by web clients are handled this
way: A request to start an activity is sent to the web server, the activity
is started synchronously and the GUIContext (the generated
HTML-document) is sent as reply to the client request. Additionally this interface provides the means to register a callback for activity state changes just like for instances. For instance this allows for GUI contexts that are displayed remotely to be closed appropriately.
Important: This does only work when the designated activity is executed on the runtime manager providing this interface. Otherwise a
WrongRuntimeManagerException will be thrown.
Besides the retrieval of the GUIContext this interface also
provides the means to register a listener for activity state changes, that is
closing, suspending, resetting, failing or resuming an activity. Note that
notifying the resume of an activity will only work if the activity is started
on the very same runtime manager (ActivityStarting) again. Such
a registered listener can
unregister
any time.
This interface may be provided by a runtime manager but does not need to. It
delegates to the corresponding execution manager, encapsulates the
asynchronous calls and registers for the state notifications. If the runtime
manager does not provide this interface, the client has to use the execution
manager directly (
ActivityStarting).
-
Method Summary
Modifier and TypeMethodDescriptionresumeActivitySynchronously(SessionToken session, EBPInstanceReference activity) Resumes the designated activity and logs the agent, the organisational position.resumeActivitySynchronously(SessionToken session, EBPInstanceReference activity, URI[] stateListener) Resumes the designated activity and logs the agent, the organisational position.startActivitySynchronously(SessionToken session, EBPInstanceReference activity, ProcessConstants.ExecutionMode executionMode, URI[] stateListener) Starts the designated activity in the designated execution mode and logs the agent, the organisational position.voidunregisterActivityStateListener(SessionToken session, EBPInstanceReference activity, URI[] stateListener) Unregisters the designated listener for activity terminations.Methods inherited from interface de.aristaflow.adept2.core.executionmanager.ActivityStarting
deselectActivity, enquireActivity, getEnquiryRecipients, getEnquiryRecipientsIterator, getExecutionContext, getExecutionContexts, replyEnquiry, resumeActivity, selectActivity, startActivity
-
Method Details
-
startActivitySynchronously
GUIContext startActivitySynchronously(SessionToken session, EBPInstanceReference activity, ProcessConstants.ExecutionMode executionMode, URI[] stateListener) throws InvalidActivityStateException, InvalidInstanceStateException, WrongAgentException, AgentUnknownException, WrongRuntimeManagerException Starts the designated activity in the designated execution mode and logs the agent, the organisational position. This method is called by clients to start an activity represented by a worklist item and retrieve theGUIContextof.
This method uses the asynchronous call toActivityStarting.startActivity(SessionToken, EBPInstanceReference, de.aristaflow.adept2.model.globals.ProcessConstants.ExecutionMode)and waits until the designated activity is started on this runtime manager. If this activity is not started in a certain period on this runtime manager, aWrongRuntimeManagerExceptionwill be raised.- Parameters:
session- The session which is used to check for access rights on this method and to retrieve the starting agent and the corresponding organisational position.activity- The unique ID of the activity to start.executionMode- The execution mode in which to start the activity, for instance, a test mode.stateListener- The URIs identifying a callback interface to be notified when the activity has terminated (has been closed, suspended, reset or failed) or null in case no notification is necessary. The listener has to implementActivityStateListener. It will be ignored if the EBP is a light weight process.- Returns:
- The
GUIContextof the started activity/application or null if the EBP is a light weight process. The caller is responsible for closing. - Throws:
InvalidActivityStateException- If the activity (process step) is not activated or selected by the designated user, anInvalidActivityStateExceptionwill be raised.InvalidInstanceStateException- If the instance is not running but stopped, aborted, finished or changed, anInvalidInstanceStateExceptionis thrown.WrongAgentException- If the calling agent is not the same agent who selected the activity.AgentUnknownException- If the specified runtime manager refuses the execution since it does not know the designated agent, anAgentUnknownExceptionwill be thrown.WrongRuntimeManagerException- If the designated activity is not executed by this runtime manager, aWrongExecutionManagerExceptionwill be raised.- See Also:
-
resumeActivitySynchronously
GUIContext resumeActivitySynchronously(SessionToken session, EBPInstanceReference activity) throws InvalidActivityStateException, InvalidInstanceStateException, WrongAgentException, WrongRuntimeManagerException, AgentUnknownException Resumes the designated activity and logs the agent, the organisational position. This method is called by clients to resume an activity and retrieve theGUIContextof.
This method uses the asynchronous call toActivityStarting.resumeActivity(SessionToken, EBPInstanceReference)and waits until the designated activity is started on this runtime manager. If this activity is not resumed in a certain period on this runtime manager, aWrongRuntimeManagerExceptionwill be raised.If the activity has a state listener it will be notified and kept for further notifications. Normally, you should use
resumeActivitySynchronously(SessionToken, EBPInstanceReference, URI[])unless you are aResumingRuntimeManagerwhich automatically resumes suspended activities.- Parameters:
session- The session which is used to check for access rights on this method and to retrieve the resuming agent and the corresponding organisational position.activity- The unique ID of the activity to resume.- Returns:
- The
GUIContextof the started activity/application or null if the EBP is a light weight process. The caller is responsible for closing. - Throws:
InvalidActivityStateException- If the activity (process step) is not suspended, anInvalidActivityStateExceptionwill be raised.InvalidInstanceStateException- If the instance is not running but stopped, aborted, finished or changed, anInvalidInstanceStateExceptionis thrown.WrongAgentException- If the calling agent does not have the designated activity in the worklist, aWrongAgentExceptionwill be thrown.AgentUnknownException- If the specified runtime manager refuses the execution since it does not know the designated agent, anAgentUnknownExceptionwill be thrown.WrongRuntimeManagerException- If the designated activity is not executed by this runtime manager, aWrongExecutionManagerExceptionwill be raised.- See Also:
-
resumeActivitySynchronously
GUIContext resumeActivitySynchronously(SessionToken session, EBPInstanceReference activity, URI[] stateListener) throws InvalidActivityStateException, InvalidInstanceStateException, WrongAgentException, WrongRuntimeManagerException, AgentUnknownException Resumes the designated activity and logs the agent, the organisational position. This method is called by clients to resume an activity and retrieve theGUIContextof.
This method uses the asynchronous call toActivityStarting.resumeActivity(SessionToken, EBPInstanceReference)and waits until the designated activity is started on this runtime manager. If this activity is not resumed in a certain period on this runtime manager, aWrongRuntimeManagerExceptionwill be raised.- Parameters:
session- The session which is used to check for access rights on this method and to retrieve the resuming agent and the corresponding organisational position.activity- The unique ID of the activity to resume.stateListener- The URIs identifying a callback interface to be notified when the activity has terminated (has been closed, suspended, reset or failed) or null in case no notification is necessary. The listener has to implementActivityStateListener. It will be ignored if the EBP is a light weight process.- Returns:
- The
GUIContextof the started activity/application or null if the EBP is a light weight process. The caller is responsible for closing. - Throws:
InvalidActivityStateException- If the activity (process step) is not suspended, anInvalidActivityStateExceptionwill be raised.InvalidInstanceStateException- If the instance is not running but stopped, aborted, finished or changed, anInvalidInstanceStateExceptionis thrown.WrongAgentException- If the calling agent does not have the designated activity in the worklist, aWrongAgentExceptionwill be thrown.AgentUnknownException- If the specified runtime manager refuses the execution since it does not know the designated agent, anAgentUnknownExceptionwill be thrown.WrongRuntimeManagerException- If the designated activity is not executed by this runtime manager, aWrongExecutionManagerExceptionwill be raised.- See Also:
-
unregisterActivityStateListener
void unregisterActivityStateListener(SessionToken session, EBPInstanceReference activity, URI[] stateListener) Unregisters the designated listener for activity terminations. The listener has been registered when starting or resuming the designated activity but it may unregister any time.
Note that the listener will be implicitly unregistered when the activity terminates finally, that is all terminations except the activity suspends.If the EBP is a light weight process, no activity state listener can be registered. Therefore this will do nothing in this case.
- Parameters:
session- The session which is used to check for access rights on this method.activity- The activity for which the state listener should be unregistered.stateListener- The listener which to unregister. This has to refer to a validActivityStateListener.
-