com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

Working with User Tasks

The following scenario simulates a simple leave approval business process, in which an employee fills a form and submits the leave request to the manager and the manager approves or rejects it. 

Before you begin,

  • Install Oracle Java SE Development Kit (JDK) version 1.8.* and set the JAVA_HOME environment variable.
  • Download the product installer from here, and run the installer.
    Let's call the installation location of your product the <EI_HOME> directory.

    If you installed the product using the installer, this is located in a place specific to your OS as shown below:

    OSHome directory
    Mac OS/Library/WSO2/EnterpriseIntegrator/6.5.0
    WindowsC:\Program Files\WSO2\EnterpriseIntegrator\6.5.0\
    Ubuntu/usr/lib/wso2/EnterpriseIntegrator/6.5.0
    CentOS/usr/lib64/EnterpriseIntegrator/6.5.0

Let's get started! This tutorial includes the following sections:

Importing artifacts 

If you did not try the Configuring the Start Event to Submit Data tutorial yet, follow the steps below to import its artifacts as you will be extending on that.

  1. Download the pre-packaged project and extract it to a preferred location. This contains the artifacts of the Configuring the Start Event to Submit Data tutorial. 
  2. Open the WSO2 Integration Studio.
  3. Click File, and click Import
  4. Expand the WSO2 category, select Existing WSO2 Projects into workspace and click Next.
  5. Click Browse, select the file you extracted and upload it.  
  6. In the Package Explorer, double click on the name of the BPMN diagram to view the BPMN artifacts you imported.

Creating new artifacts

The next step of the process is where the respective manager checks the leave application form and approves/rejects it. For this part of the process, add a User Task as it will be a task performed by a user. 

  1. Right click on the connection arrow, which connects the Start Event and the End Event and click Delete.
  2. Drag and drop a User Task to the diagram.

  3. Hover your mouse pointer over the Start Event, and click on the arrow icon (i.e., the Create Connection option) and connect the Start Event to the User Task.
  4. Hover your mouse pointer over the User Task, and click on the arrow icon (i.e., the Create Connection option) and connect the User Task to the End Event.

  5. Click on the User Task, and change the value of the Name field to Review leave request in the General section of the Properties tab. 
     
  6. Click on the User Task, click New in the Form section of the Properties tab and add the following field. 

    idNameTypeReadableWritableRequiredForm Values
    vacationApprovedDo you approve this vacation request?

    enum

    For fields of type “enum” you can add form values that act as different options. You can provide two options as Approve and Reject for this field.

    truetruetrue

    Id: true

    Name: Approve
    Id: false
    Name: Reject

     


  7. To add an assignee to the User Task, enter the value as manager for the Assignee field in the Main Config section of the Properties tab (of the User Task). 

    This assumes that a single person (e.g., HR Manager) is responsible for approving or rejecting leave. If you want to allow a group of people (e.g., anyone in the HR Department) to approve/reject leave, you can enter the group role name (e.g., hrDepartment) as the value of the Candidate group field in the Main Config section of the  Properties  tab (of the User Task).

  8. Save all the artifacts that you created in WSO2 Integration Studio.

The model is now complete as the necessary logic has been applied.

Deploying the artifacts

  1. For instructions on creating the deployable artifacts, see Creating the deployable archive.
  2. For instructions on deploying them, see Deploying BPMN artifacts.

Creating the user

  1. Log in to the Management Console of the Business Process profile.
  2. Click Configure → Users and Roles → Add → Add New User.
  3. Enter the below details to create a user called manager and click Next.

    Enter both the User Name and the Password as manager.


  4. In the next screen, assign the user to the admin role and click Finish.

    You view the new user you created as shown below.

Testing the output

Follow the steps below to test the output.

  1. Start the Business Process profile of WSO2 EI.

  2. Log in to the BPMN-explorer at https://localhost:9445/bpmn-explorer using admin for both the username and password.
  3. Click PROCESSES in the top menu, and click the Start option of the Leave Approval Process.
  4. Initiate the process by filling the form and click Start.

    You view the following message.

  5. Log out and log in again using manager/manager credentials. 
  6. Click TASKS and then click MY TASKS. You view the Claimable Task, which was created by the process you started. 


  7. Click on the Task, select Approve from the drop down list and click Complete Task.

    You view the Task being removed from the MY TASKS list. 

  8. Click TASKS in the top menu, and then click COMPLETED TASKS. You view the Task you just completed being added to the COMPLETED TASKS list.

Similarly, you can repeat the steps from step 5 onwards to reject a leave request accordingly.

com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.