A simple BPM workflow can viewed as a sequence of tasks. Slightly more complex is a workflow that has one or more decision points. A decision point is where a choice has to be made, and the flow can go more than one way, depending on that choice. For example the Alfresco-supplied review workflow is a workflow designed to assign a task to a user, who must complete the task by approving or rejecting the work item. You can see the BPMN 2.0 process definition in the file review.bpmn20.xml, and the jPDL process definition in the file review_processdefinition.xml. Both these files are in the alfresco/workflow directory.
In jBPM, the jPDL process definition uses transition elements within the task-node element to describe which task is to be executed next in the sequence. So a task is able to determine what the next task in the sequence is from its own content.
BPMN 2.0 is a more expressive language. A BPMN 2.0 process defintion is a graph consisting of flow objects linked together by connecting objects. There are three core flow objects:
An event - represents something that happens.
An activity - represents some work that is done. A task is an activity that represents a single unit of work, that can not be broken down further into business processes.
A gateway - represents forking or merging of paths depending on a condition or conditions.
A sequenceFlow is a connecting object that describes the source and target a step in the flow. The source and target are flow objects.
The following diagram shows the review process definition as an Activiti flow diagram :-
You can see that the exclusiveGatewayreviewDecision is the decision point. The following two sequenceFlow connecting objects describe the 2 possible forks in the flow. Note that the first connecting object flow3 has a condition based on the wf_reviewOutcome property which must be met for the flow to proceed to its target. If the condition is not met, then processing drops through to the next sequenceFlow, flow4 which in this case has no condition that needs to be met, because it describes the only other possible path in the flow.
Because the flow is described outside the task elements, Alfresco does not know during task processing what the preceding or next task will be, and so cannot present the outcome in the task history in Alfresco Share. To provide this capability, the task model in workflowModel.xml has a new type, wf:activitiReviewTask:
The list constraint provides the list of allowed values for the review decision, and the bpmutcomePropertyName provides the location that alfresco retrieves the outcome string from to display in the task's history panel in My Tasks. Without bpmutcomePropertyName Alfresco would use the default outcome string, 'Next'.
The parent of 'wf:activitiReviewTask', bpmutcomePropertyName is defined in the workflow base task model 'bpm:businessprocessmodel'. You can find this model in bpmModel.xml located in the config file alfresco/model/bpmModel.xml.