Interface SubInstanceStateNotification
-
public interface SubInstanceStateNotification
This interface is used as a callback for the events when a subprocess instance has changed its state. This may be due to a normal termination (instance has finished), suspension, resume or failure. The execution manager informs the implementing class about the corresponding events. The implementation has to register when the corresponding instance is started (InstanceControl.startSubInstance(SessionToken, EBPInstanceReference, de.aristaflow.adept2.model.execution.ExecutionContext, URI[])
.
Since this interface is used for notifying super-processes, session tokens are provided. Notifications are synchronously therefore implementations should be rather short.- See Also:
InstanceControl
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
instanceFailed(SessionToken session, UUID instanceID, EBPInstanceReference superLWP, DataContainer dataContainer, String errorMessage, String state, long errorCode)
Notifies that the designated subprocess instance has failed and provides the necessary failure information.void
instanceFinished(SessionToken session, UUID instanceID, EBPInstanceReference superLWP, DataContainer dataContainer)
Notifies that the designated subprocess instance has finished normally and provides the output parameters of the instance.void
instanceResumed(SessionToken session, UUID instanceID, EBPInstanceReference superLWP)
Notifies that the designated subprocess instance has been resumed.void
instanceSuspended(SessionToken session, UUID instanceID, EBPInstanceReference superLWP, DataContainer dataContainer)
Notifies that the designated subprocess instance has been suspended.
-
-
-
Method Detail
-
instanceFinished
void instanceFinished(SessionToken session, UUID instanceID, EBPInstanceReference superLWP, DataContainer dataContainer)
Notifies that the designated subprocess instance has finished normally and provides the output parameters of the instance. In case the instance does not have output parameters, null is provided as data container.- Parameters:
session
- The session for synchronising ADEPT2 internal method calls.instanceID
- The ID of the subprocess instance that has finished normally.superLWP
- A reference to the corresponding parent LWP.dataContainer
- The corresponding data container that contains the values of the output parameters of the subprocess instance or null in case the instance does not have output parameters.
The caller is responsible for closing. That means, implementors may need toDataContainer.clone()
if required longer than or outside of this method.
-
instanceSuspended
void instanceSuspended(SessionToken session, UUID instanceID, EBPInstanceReference superLWP, DataContainer dataContainer)
Notifies that the designated subprocess instance has been suspended.- Parameters:
session
- The session for synchronising ADEPT2 internal method calls.instanceID
- The ID of the subprocess instance that has been suspended.superLWP
- A reference to the corresponding parent LWP.dataContainer
- The corresponding data container that contains the values of the parameters of the subprocess instance or null in case the instance does not have parameters at all. The values of the output parameters may not be the final ones since the subprocess instance is only suspended and has not finished yet. Please note that many output parameters may be Null due to the intermediate suspension.
The caller is responsible for closing. That means, implementors may need toDataContainer.clone()
if required longer than or outside of this method.
-
instanceResumed
void instanceResumed(SessionToken session, UUID instanceID, EBPInstanceReference superLWP)
Notifies that the designated subprocess instance has been resumed.- Parameters:
session
- The session for synchronising ADEPT2 internal method calls.instanceID
- The ID of the subprocess instance that has been resumed.superLWP
- A reference to the corresponding parent LWP.
-
instanceFailed
void instanceFailed(SessionToken session, UUID instanceID, EBPInstanceReference superLWP, DataContainer dataContainer, String errorMessage, String state, long errorCode)
Notifies that the designated subprocess instance has failed and provides the necessary failure information.- Parameters:
session
- The session for synchronising ADEPT2 internal method calls.instanceID
- The ID of the subprocess instance that failed or was aborted.superLWP
- A reference to the corresponding parent LWP.dataContainer
- The corresponding data container that contains the values of the output parameters of the subprocess instance which have been produced until the failure occurred or null in case the instance does not have output parameters. Please note that many output parameters may be Null due to the failure.
The caller is responsible for closing. That means, implementors may need toDataContainer.clone()
if required longer than or outside of this method.errorMessage
- The error message to be interpreted by a user or by a failure handling routine.state
- Arbitrary state information specific to the instance, comparable to the vendor code inSQLException
errorCode
- The error code specifying the type of error.
-
-