Designing and running the "Request for absence" process model

In this tutorial, we will design a simple process model which presents a “Request for abscence” process. Then we deploy and execute it.

Designing your own organization

  1. Before designing your process models, you should define the groups and individual users.
  2. Start your tomcat by executing apache-tomcat-7.0.12\bin\startup.bat (Windows) or apache-tomcat-7.0.12\bin\startup.bat (Linux).
  3. Open your browser and go to http://localhost:8080/activiti-explorer/.
  4. Login as admin with kermit/kermit, then select Manage→Groups.
  5. Click on Create group to add a new group to your organization and enter Id: employee, Name: Employee. Click Create group.
  6. By the same way, add the group Director.


  7. Select Manage→Users.
  8. Click on Create user to add a new user to your organization by giving Id: david, Password: david, First name: David, Last name: David, Email: david@example.com. Click Create user.
  9. Click on the + sign to select the group Employee for David, then click Select.
  10. By the same way, add the user diana in the group Director.


  11. Let begin designing the Request for absence process model!

Designing a process model

  1. In Activiti, select Processes→Model workspace→New model.
  2. Enter new model Name: Request for absence. Click Create.
  3. Firstly, enter the following process properties:
    1. Process identifier: absence
    2. Name: Request for absence
  4. Design a process model by drag and drop model elements, you should have something similar to this picture:


  5. On the start event, specify the following properties:
    1. Initiator: initiator
    2. Form properties:
      1. id: dateToAbsense, Name: Absense date, Type: date
      2. id: reason, Name: Reason, Type: string
  6. On the Director decision activity, specify the following properties:
    1. Assignment→Candidate groups: director
    2. Form properties:
      1. id: initiator, Name: Employee, Type: string
      2. id: dateToAbsense, Name: Absense date, Type: date
      3. id: reason, Name: Reason, Type: string
      4. id: approval, Name: Approval, Type: boolean
  7. On the sequence flow from Director decision to accept, specify the property Flow condition: ${approval == 'true'}
  8. On the sequence flow from Director decision to reject, specify the property Flow condition: ${approval == 'false'}
  9. On the accept activity, specify the following properties:
    1. Assignments→Assignee: ${initiator}
    2. Documentation: Your absence request on ${dateToAbsense} is accepted.
  10. On the reject activity, specify the following properties:
    1. Assignments→Assignee: ${initiator}
    2. Documentation: Your absence request on ${dateToAbsense} is rejected.
  11. Click on Save the model icon, then click on Save and close editor.
  12. In Processes→Model workspace, selected your Request for absence process model, then go to Model action and select Deploy.


  13. Now your process model is ready to be executed! Next section will show you how to execute such process model.
  14. 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.

Executing a process model

  1. Logout and login as employee with david/david, then select Manage→Groups.
  2. Go to Processes→Deployed process definitions, select your Request for absence process model, then click on Start process.


  3. Fill the information when and why David will be absent, then click Start process.


  4. Go to Processes→My instances to see the status of your executing process.


    As you can see, now the current task is Director decision which needed to be handled by a director.
  5. Logout and login as director with diana/diana, then select Tasks→Queued→Director.
  6. Click the Claim button to handle the task. Decide if you want to approve this absence request by checking Approval, then click the Complete task button.


  7. Logout and login as employee with david/david, then go to Processes→My instances to see the status of your executing process.


  8. Select Tasks→Inbox to see the result of your absence request, then click on Complete task button to end this process.


Exercices

  1. Remove the form property dateToAbsense and replace by two form properties absenseFrom and absenseTo. Execute the process again.
  2. Re-create the process model with the use of gateway:


    Execute the process again.
teaching_assistant/workflow/activiti_design_workflow.txt · Last modified: 2021/12/07 12:05 by Nour
Back to top
CC Attribution-Share Alike 4.0 International
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0