In Activiti, select Processes→Model workspace→New model.
Enter new model Name: Request for absence. Click Create.
Firstly, enter the following process properties:
Process identifier: absence
Name: Request for absence
Design a process model by drag and drop model elements, you should have something similar to this picture:
On the start event, specify the following properties:
Initiator: initiator
Form properties:
id: dateToAbsense, Name: Absense date, Type: date
id: reason, Name: Reason, Type: string
On the Director decision activity, specify the following properties:
Assignment→Candidate groups: director
Form properties:
id: initiator, Name: Employee, Type: string
id: dateToAbsense, Name: Absense date, Type: date
id: reason, Name: Reason, Type: string
id: approval, Name: Approval, Type: boolean
On the sequence flow from Director decision to accept, specify the property Flow condition: ${approval == 'true'}
On the sequence flow from Director decision to reject, specify the property Flow condition: ${approval == 'false'}
On the accept activity, specify the following properties:
Assignments→Assignee: ${initiator}
Documentation: Your absence request on ${dateToAbsense} is accepted.
On the reject activity, specify the following properties:
Assignments→Assignee: ${initiator}
Documentation: Your absence request on ${dateToAbsense} is rejected.
Click on Save the model icon, then click on Save and close editor.
In
Processes→Model workspace, selected your
Request for absence process model, then go to
Model action and select
Deploy.
Now your process model is ready to be executed! Next section will show you how to execute such process model.
Note that if you want to modify your process model, make sure to delete your deployed process model by going to Manage→Deployments→Show all, select the model then click on Delete button. Then, you can modify and redeploy your process model.