Starting from Alfresco Community 3.4.e, you can deploy Activiti process definitions to specify workflows. The Activiti BPMN 2.0 BPM engine is now embedded in Alfresco in addition to the current jBPM engine. Both workflow engines are encapsulated in the workflow service that provides a standard interface to the underlying workflow engine itself. Activiti process definitions are written in BPMN 2.0 and are deployed and managed in exactly the same way as the current jBPM process definitions. Alfresco provides the same set of pre-defined process templates for Activiti, and for jBPM. In Alfresco Community 3.4.e, this feature is provided as a technology preview only.
Process definition Language
Embedded in Alfresco?
Workflow process designer
Activiti Eclipse Designer, or any other BPMN 2.0 compliant modeler
JBoss jBPM Process Designer
What is Activiti?
Activiti is a light-weight workflow and Business Process Management (BPM) Platform targeted at business people, developers and system administrators. It provides a fast and reliable BPMN 2 process engine for Java. It is open-source and distributed under an Apache license. Activiti is lightweight, based on open standards and is designed to integrate well with Spring applications, like Alfresco. You can learn more about Activiti on the Activiti website.
What is BPMN 2.0?
BPMN 2.0 (Business Process Modeling Notation) is an open standard developed by the Object Management Group (OMG) to provide a notation that is easily understandable by all business users: business analysts designing processes, developers implementing technology to perform those processes, and, business people managing and monitoring those processes. BPMN creates a standardized bridge for the gap between the business process design and process.
The first version BPMN specification defined graphical notation only, and became quickly popular within the business analyst audience .It defined how concepts such as a human task, an executable script, an automated decision are visualized in a vendor-neutral, standardized way. The second version extended the standard to include execution semantics and a common exchange format. This means that BPMN 2.0 process definition models can be exchanged between graphical editors, and executed on any BPMN 2.0 compliant engine such as Activiti. You can learn more about BPMN on the OMG website.
Working with workflows
For a user, tasks for working with workflows in Afresco Share remain the same. The only change is in the in the contents of the Workflow list displayed on the Start Workflow page where you select the type of workflow you want to define. Out of the box, Share now includes the following preconfigured workflows for both Activiti and jBPM:-
Enables you to assign a task to a single user
Group Review & Approve
Enables you to set up review and approval of content, assigning the workflow task to a single group
Parallel Review & Approve
Enables you to set up review and approval of content, assigning the workflow task to multiple users.
Pooled Review & Approve
Enables you to set up review and approval of content, assigning the workflow task to multiple users. One user can take ownership of the task at a time, completing it or returning it to the pool to be claimed by another user associated with the task.
Review & Approve
Enables you to set up review and approval of content, assigning the workflow task to a single user
In Alfresco, a workflow consists a number of artifacts. The diagram below shows the artifacts and the relationship between them:- none|Workflow Definition
Activiti process definitions describe the events, activities (tasks) and gateways (choices) of a workflow. Tasks may be user tasks or script (system) tasks. User tasks are assigned to human performers (users). System tasks perform some kind of operation against the Alfresco repository. Both are described and implemented in the Process Definition.
The embedded Activiti process engine accepts process definitions written in BPMN 2.0. A process definition is an xml document.
The Task Model provides a description for each of the user tasks in the workflow. Each task description consists of:
Name and Title
Properties and Associations (e.g. the information attached to the task)
The description is used to drive the user interface dialog for viewing and managing the Task.
Alfresco provides a 'Data Dictionary' for describing types of object to store, view and edit. This mechanism is also used to describe Workflow Tasks.
Share Workflow UI
You can customize the presentation of Tasks to the user in Alfresco Share.
Control over which Task properties are displayed
Control over which Task properties are read-only and required
Control over how each Task property is rendered in the forms
A workflow resource bundle provides all the human-readable messages displayed in the user interface for managing the workflow. Messages include Task titles, task property names, task choices etc.
Alfresco supports full localisation of Alfresco Share, including workflow. Therefore, the same Alfresco Share resource bundle configuration extends to workflow too.
Creating a process definition
You can create the BPMN 2.0 process definition manually in a text or XML editor, or by using a BPMN 2.0 compliant business process modeler such as Activiti Eclipse Designer. You can use the process definitions supplied in Alfresco for the preconfigured workflows as examples. These can be found in webapps/alfresco/WEB-INF/classes/alfresco/workflow.
Process Definition File
Adhoc Activiti Process
Parallel Group Review And Approve Activiti Process
Parallel Review And Approve Activiti Process
Pooled Review And Approve Activiti Process
Review And Approve Activiti Process
Further information on creating BPMN 2.0 process definitions can be found on the omg website, and in the Activiti 5.3 User Guide. The example listing below shows the adhoc Activiti process definition:-
Note in particular the activiti:formKey attribute of the startEvent element.
This attribute tells Alfresco which form to display when the user selects a workflow in Workflow list displayed on the Start Workflow page in Alfresco Share. In jBPM this is achieved using a task element in a start-state element. You can see this difference between an Activiti process definition and a jBPM process definition my comparing adhoc.bpmn20.xml and adhoc_processdefinition.xml in webapps/alfresco/WEB-INF/classes/alfresco/workflow.
Creating a task model
A task model is a content model as supported by the Data Dictionary. For each task in the process definition the task model can associate a task description. The description specifies the information that may be attached to a task: properties (name and datatype) and associations (name and type of associated object). A user can view and edit this information in the My Tasks dashlet or the My Tasks page component on their dashboard in Alfresco Share. You can see more information on the My Tasks page component in the Alfresco Documentation. To create a Task Model:
Create a new Content Model for the Process Definition
Create a Type for each Task
For each Type, describe the properties and associations (information) required for the task
You can see the standard task model in workflowModel.xml in webapps/alfresco/WEB-INF/classes/alfresco/workflow. Examining the file, you can see that the same underlying content model is shared by both jBPM and Activiti. You will notice there is only one new type introduced by Activiti, activitiReviewTask. This defines a list of values for the task's transitions. This shows a difference between BPMN 2.0 and jPDL. In jPDL an explicit list of transitions are given from each task in the workflow. in BPMN 2.0 the route taken through the workflow is calculated differently, expressions use the values of variables in the workflow to decide which route to take. This is explained in more detail in Activiti Workflows with decision points.
Deploying a process definition
You can use the workflowDeployer bean to deploy process definitions (refer to the following code snippet). The bean must be in a file in the <extension> directory. Note the the engineId property must be set to activiti for BPMN 2.0 process definitions.