public abstract class WaitTaskBean extends Object
This abstract class must be extended to define a wait task bean.
A WaitTaskBean
specifies its label, description and
properties list. This bean will then be automatically offered when modeling
workflows (with its specified label and defined parameters).
The declaration must be made in module.xml
files.
A wait task bean is used to specify that a workflow must wait for a specific event before proceeding. The workflow will go to the next step only when the expected event is received.
Constructor and Description |
---|
WaitTaskBean() |
Modifier and Type | Method and Description |
---|---|
void |
onResume(WaitTaskOnResumeContext aContext)
This method is automatically executed when the expected resume event is received.
|
abstract void |
onStart(WaitTaskOnStartContext aContext)
This method is automatically executed when the control
flow reaches the wait task step, just after changing the workflow state to
a waiting state.
|
public abstract void onStart(WaitTaskOnStartContext aContext) throws OperationException
An resume identifier is automatically generated and associated with the wait task.
This identifier is unique and will be used at the wait task resumption. The resume identifier
is available by WaitTaskOnStartContext.getResumeId()
For example, resuming a wait task can be done by an external system (web service), another workflow, or a user service. This method is responsible for calling the external system or updating technical tables by giving the associated resume identifier.
OperationException
public void onResume(WaitTaskOnResumeContext aContext) throws OperationException
By default, if this method is not overridden, an automatic mapping with the data context is done. The received output parameters are evaluated: if a data context variable has the same name as the parameter, the data context variable is updated with the associated parameter value. If the data context variable with the same name is not found, it is ignored and a warning is added to workflow logs.
This method can be overridden to specify an other output mapping. By using the method
DataContext.setVariableString(String, String)
, it is possible to update the data context
according
to the received parameters (available by WaitTaskOnResumeContext.getOutputParameters()
) before
calling the default implementation.
OperationException