Defining assignments—sequential stage and serial participant

Now, the assignment section has one stage with a single participant type for which a list is formed using the value-based name and expression list method.

Now you will create a Sequence of Stage, where if the Incoming Payload has an Effective Discount of or greater than 40 percent, then you will route this task to a SalesManagerGroup. And if approved by this group, the Process Token moves ahead and goes to the third stage which you will create for Management Chain Approval.

However, if the Effective Discount is less than 40 percent, you can assign the task to territorymanagerl2 (Territory Manager Level 2).

How to do it...

  1. You will learn to create sequential stages and add serial participants.
  2. Go to BPM Navigator | SalesToContractDemo | Business Catalog | Human Tasks and click the ManagementApproval.task file. This will open the Human Task editor.
  3. Go to the Assignment section. You will find the stage TerritoryManagerApproval.
  4. Click on the stage TerritoryManagerApproval and click on the green plus (+) icon, as shown, and select Sequential Stage to create a second stage in sequence with the TerritoryManagerApproval stage.
    How to do it...
  5. Double-click on the newly created stage, name it as SalesGroupApproval, and select Non-Repeating radio.
  6. Click OK.
  7. Click the Edit participant and it would open the Add Participant Type dialog.
  8. Select Type = Single and Enter Label as SalesGroupApproval.
  9. Use a rule-based name and expression to build the participant list.
  10. Enter name of the ruleset: SalesGroupApprovalRuleSet. This will create a ruleset, if one is not already present.
    How to do it...
  11. Click OK.
  12. A Rule Dictionary is created. Click Create Rule to create a rule.
    How to do it...
  13. In the Rule Editor, enter the name of the rule as SalesGroupApprovalRule.
  14. Enter the condition in the If clause, so that this condition get's executed, when Effective Discount is greater than 40 percent, as follows:
    Task.payload.quoteRequest.summary.effectiveDiscount> 40
    
  15. In<Insert Action>, choose Call. You need to create a user list. There are a lot of Seeded functions available to create the user list.
  16. You will find a pop-up list of functions. Choose the CreateResourceList function.
  17. As you want to assign the task to a group, you will give SalesGroup as Groups into the Function Argument. Enter other details, as shown in the following screenshot.
    How to do it...
  18. Click Save.

    Note

    You can check how to create SalesGroup in the the following section. Also, you cannot have app role and users' values together. So in case you have to use a value for the app role, the value for users has to be null and vice versa.

  19. Click on the green plus (+) icon, as shown, to create an Else rule in the same ruleset, when Effective Discount is less than 40 percent.
  20. Name the Rule as SalesGroupApprovalRuleElse
  21. Task Action will route the task to territorymanagerl2 by Creating a participant list by entering users, as shown in the following screenshot:
    How to do it...
  22. When finished, Save.
  23. If an Else section is not developed in the rule, then it would result in an error in Oracle BPM Workspace as follows:
    How to do it...

How it works...

When you name a ruleset in the edit participant type and click ok, a decision Service Component is created along with a rule dictionary.

This will create a rule dictionary, if one is not already created, and pre-seed several rule functions and facts for easy specifications of the participant list. In the rule dictionary, the following rule functions are seeded to create participant lists:

  • Create Resource List
  • Create Management Chain List

At runtime when process token, reaches the second stage, post Territory Manager Approval and when the condition of Effective Discount is greater than 40 percent is met, a call action gets executed. This will call the CreateResourceList function, which will create the list with the users of the SalesGroup as entered as argument in the function above. And if the Effective Discount is less than 40 percent (< 40), then the task action will route the task to territorymanagerl2 by creating a participant list by entering users in the create resource list function.

There's more...

You will learn to create an approval group in this section.

Creating an Approval Group

  1. Log in to the Oracle BPM Workspace application as a WebLogic user.
  2. Click on the Administration link on the top of the page.
  3. Click Approval Groups in the Task administration.
  4. Click on the green plus (+) icon ahead of Groups and select Create Static.
    Creating an Approval Group
  5. In the Details section, enter the name of the Group as SalesGroup and click on the green plus (+) icon to add members to the Group.
  6. Search/browse for the Members. This will open the Identity Browser.
  7. Select zonalmanager from the list. At the moment, let's have only one user belonging to this group.
    Creating an Approval Group
  8. Click OK.
  9. Click OK on the Add to Group box too.
  10. Click on the Apply button and now zonalmanager is a member of SalesGroup.
    Creating an Approval Group

Calling RL Functions to act on the task

To instruct the task service on how to route the task, rules can specify one of many task actions. This is done by updating the TaskAction fact asserted into the rule session. However, rules should not directly update the TaskAction fact. Instead, rules should call one of the action RL functions, passing the TaskAction fact as a parameter. These functions handle the actual updates to the fact.

In the section, you have created a ruleset with two rules: one to handle the case when Effective Discount is greater than 40 percent and the other to handle the case when Effective Discount is less than 40 percent.

In the second rule, SalesGroupApprovalRuleElse, you can even use an RL function to call a TaskAction to complete the task.

The COMPLETE action finishes routing and completes the task. The task is marked as completed and no further routing is required.

  1. Go to the rule designer at the rule SalesGroupApprovalRuleElse.
  2. Enter the rule when effectiveDiscount < 40, as shown in the following screenshot:
    Calling RL Functions to act on the task
  3. Task Action will finish routing and complete the task. The task is marked as completed, and no further routing is required.
  4. When you have finished, Save.
..................Content has been hidden....................

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