Workflows
A business process is modeled with Workflows and Task elements.
For what workflows, transitions and states are, see Business Processes.
A Workflow lists all transitions that are defined in the business process. Each transition is composed out of one begin state and one or more end states. During a transition, the actual business logic will be executed by a task implementation. At last, a trigger defines when a business process is started (e.g. a certain time, a data update, etc.)
Example
<workflow>
<name>MyElementFlow</name>
<states>
<state>
<name>Initial</name>
<initialState>true</initialState>
</state>
<state>
<name>Validating</name>
</state>
<state>
<name>ValidationFailed</name>
</state>
<state>
<name>MyElementValid</name>
</state>
<state>
<name>MyElementInvalid</name>
</state>
</states>
<transitions>
<transition>
<name>Validate</name>
<executeTask>mycomp::ValidateMyElement</executeTask>
<beginState>mycomp::MyElementFlow::Initial</beginState>
<interimState>mycomp::MyElementFlow::Validating</interimState>
<failedState>mycomp::MyElementFlow::ValidationFailed</failedState>
<endStates>
<endState>
<state>mycomp::MyElementFlow::MyElementValid</state>
<taskOutcome>mycomp::ValidateMyElement::Valid</taskOutcome>
</endState>
<endState>
<state>mycomp::MyElementFlow::MyElementInvalid</state>
<taskOutcome>mycomp::ValidateMyElement::Invalid</taskOutcome>
</endState>
</endStates>
</transition>
</transitions>
</workflow>
Each endState maps a task outcome to a state. The execution of a workflow
refers to a workflow execution; when omitted, the default execution is used.
Transition recovery
It is possible a transition cannot complete successfully. As a result a DataElement may be stuck in an interim state.
To resolve this issue process automation attempts a recovery procedure at startup. The default behavior is to move to
the failed state. Alternatively, the recovery state can explicitly be configured on the Transition with
recoveryState.
<workflow>
<name>MyElementFlow</name>
<transitions>
<transition>
<name>Make</name>
<!-- other fields omitted for brevity -->
<recoveryState>mycomp::MyElementFlow::MakeFailed</recoveryState>
</transition>
</transitions>
</workflow>
It is possible to use the begin state as the recovery state with one restriction. The executed task must be transactional. In order for recovery to the begin state to be valid, the task must not have performed any side effects.