Testing the process

While testing the process, you will develop a test case and match if the expected outcome matches the process instance outcome.

Getting ready

You will deploy the process following the steps you did in Chapter 3, Deploying the Project, to deploy this project.

How to do it...

You will create a test case to match the instance outcome with the expected results.

Test Case # 1 Values

Customer Type = New, Quantity = 100, Effective Discount = 30

  

Human Task Stage

Expected

Output

Expect- ance Met

Territory- Manager- Approval

In the stage TerritoryManagerApproval, the territorysalesmanagerl1 user will receive the task.

Once approved, it will move to next stage.

You can check the title and use AdHoc Routing as set in the Participant Attributes shown below.

Task Assigned to territorysales- managerl1 user.

YES

SalesGroup- Approval

The task will move to the stage SalesGroupApproval and execute the rule- SalesGroupApprovalRule since Effective Discount>40 and the task will get assigned to SalesGroup.

The discount increases from 30 percent to 45 due to the CustomerCheck rule execution.

Log in as zonalmanager and approve the task.

Task assigned to zonalmanager user as it is member of SalesGroup

On each user's APPROVE in the management chain, Task keeps elevating in the Chain

YES

YES

Sales- Management ChainApproval

The task gets assigned to areasalesmanager and on approval to users regionalmanager and CountryManager

Log in as businessanalyst manager and APPROVE the task.

YES

Business- Review

The task on parallel gets assigned to the users businessanalyst and businessanalystmanager and if any one of them APPROVE/REJECT, it becomes the voted outcome of the task. You can log in as businessanalystmanager and APPROVE the task.

  
  • When the task is assigned to territorysalesmanagerl1, you can note that the tile is reflected as per the XPath given in task definition, as shown by Pointer 1.
  • Pointer 2 shows that the AdHoc Route is enabled and this participant can route this task to any other participant.
  • Pointer 3 shows the Created and Expires date as set for the participant. If the participant doesn't act within a day, the task is assigned to another user, as per the Escalation policy.
    How to do it...

Click on Adhoc Route and you can route this task to another user too, as follows:

  1. Select Approve from the Task Result. This will route the task to territorymanagerl2 only when this user approves it.
    How to do it...
  2. Log in with the territorymanagerl2 user and you can find the task assigned to this user.
    How to do it...
  3. Once approved by territorymanagerl2, the process token moves to the stage salesGroupApproval. If Effective Discount is greater than 40 percent, then the SalesGroupApprovalRule rule gets executed and builds the Participant List using the CreateResourceList function based on the SalesGroup. SalesGroup has one user, zonalmanager.
  4. Log in as zonalmanager and the Task will be present in its Inbox. You can APPROVE the task.

    Due to Decision Table execution in Check Customer, the effective discount will be increased from 30 percent to 45 percent. Then the quote will reach the territory manager for approval and once approved ,since effective discount is greater than 40%, the stage SalesGroupApproval will get executed and the task will be assigned to SalesGroup which has zonalmanager as a member.

    How to do it...
  5. The task now moves to the stage SalesManagementChainApproval, which builds a Management Chain of Participants where the level is decided based on the numberOfTier3Levels element values. These values get populated at runtime by the CustomerCheck rule.
  6. As Customer Type = New and Quantity is greater than 100, Rule 3 in the Customer Check rule gets executed and the payload with the element values will be as shown in the following screenshot:
    How to do it...
  7. Log in as areasalesmanager and approve the quote. You can log in as regionalsalesmanager and after approval from the CountryManager, approve it.
    How to do it...
  8. The Process Token now assigns the task to both users: businessanalyst and businessanalystmanager. As it's a voting with a 50 percent vote win scenario, whichever outcome reaches 50 percent becomes the final voted outcome. If 50 percent of the assignees vote to reject the outcome, then it is rejected. This task will be voted between businessanalyst and businessanalystmanager, and if any one of them approves/rejects it, it will become the final outcome of the task.
  9. Log in as the user businessanalyst and verify the presence of the task in its Inbox. Log out of it without any action.
    How to do it...
  10. Log in as businessanalystmanager and approve the task.
    How to do it...
  11. Log in to the EM Console. Click on Process Instance and on tracing you will find that the process has moved ahead to ApproveQuote and ApproveTerms.
    How to do it...

There's more...

You can execute Test# 2, as shown in the following table, with Discount < 20% and Quantity as 45. This test will demonstrate the Skipping Rule that you have set in the stage TerritoryManagerApproval for the user territorysalesmanagerl1 and the ruleset SalesGroupApprovalRuleElse when Discount is less than 40.

Test # 2 values

Customer Type = New, Quantity = 45, Effective Discount = 20

  

Human Task stage

Values expected

Output

Expect- ance met

TerritoryManager- Approval

In the stage TerritoryManagerApproval, the user territorysalesmanagerl1 should not receive the task as the Participant Type's Advance Attributes Skip rule enforces the Process Token to skip the assignment of the task to this participant when Quantity is less than 50

The task will move to the stage SalesGroupApproval and will execute the rule SalesGroupApprovalRuleElse as Effective Discount < 40 and the task will get assigned to territorymanagerl2

YES

SalesGroup- Approval

Task Skipped from the territorysales- managerl1 user.

Task assigned to the

territorymanagerl2 user.

 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.165.70