Alfresco has strong support for Workflow engines like JBPM and Activiti. If you want to get details on this you can refer these previous posts on JBPM and Activiti workflows in Alfresco. In this post I will take you through the “bpmModel.xml” which is the model file used by all out of box workflows of Alfresco. So you could consider it as heart of all out of box workflows within Alfresco. For any advance workflow in Alfresco it has to be supported by following files:
- Workflow Definition file
- Workflow Model file
- Workflow Context File
Workflow model files can be shared within multiple workflows, meaning, if you are creating new workflow but going to reuse tasks which are already available in the out of box workflow model you need not to crate new model file for your workflow.
Now let us see each section of this workflow model file in details
I will be skipping most basic things related to model like namespace declaration etc… if you do not have idea on content model basics you need to look at this post before proceeding further.
First Type you will find in model is “bpm:package” whenever you create new workflow instance alfresco will genereate one content of type “bpm:package” and store all details related to workflow under that.
Other thing you could notice is it has association called “bpm:packageContains” this is used to hold all contents which are associated with that workflow instance as in content centric system most of the time you will have workflow associated with content or set of contents.
Second type is “bpm:task” this is the parent task for most of the out of box tasks of workflows.
You could also see the property called “bpm:taskId” which is unique id of all tasks based on which it can be identified by alfresco workflow related services.
Then there is a type called “bpm:workflowTask” which is very important one as it is base task for all workflow tasks.
First thing to notice it extends bpm:task which which we has discuss above.
Then check out property which keep tracks of all associated actions with particular workflow instance it helps to manage actions based on user authority.Then as you can see it has association with bpm:package based on which it will relate to particular workflow instance.
Clear understanding of this workflow model will help a lot in creating new workflow and understanding behavior of existing workflows.