< Previous | Next >

Implement the business rule for automatic approval

The business rules task uses the Order business object as the input and checks the TotalPrice variable. If the total price is not greater than a specified fixed amount (in this case, $750.00), then the rules task sets the automaticApproval variable in the business rules component to true; otherwise, the variable is set to false. The business rules component returns the modified Order business object as the output.

Implement the business rules task by completing the following steps:

  1. In the process diagram, click the Check Order Handling for Automatic Approval task and then, in the Attributes view, click the Business Rules tab.
  2. Click Add. The Define Business Rule wizard opens.
  3. Enter AutomaticApprovalF1 as the name of the business rule.
  4. Click the Rule Templates tab and then click Add Template.
  5. Change the template name from Rule template:1 to AutoApproval Template by selecting the name and typing over it.
  6. Under Rule parameters, click Add.
  7. Define the rule parameter by completing the following steps:
    1. Change the parameter name to totalPriceMax by selecting it and typing over the generated name.
    2. Select Decimal (double-precision) as the type.
    3. For the description, enter maximum purchase for automatic approval.
      Automatic approval in the business rule
  8. Returning back toward the top of the wizard, under Important > Rule > Templates > Definition in the table, click the rule condition cell for AutoApproval Template and then click Edit icon to open a Rule Condition wizard. This is a common way to launch a wizard.
  9. In the Expression Builder (for the rule condition), complete the following steps:
    1. Add a simple binary expression by clicking Add.
    2. For the first term, select Modeling Artifact. Expand Check Order Handling Policy for Automatic Approval > Input and select TotalPrice.
    3. For the Operator, select is less than or equal to.
    4. For the second term, select Modeling Artifact. Expand Check Order Handling Policy for Automatic Approval and select totalPriceMax.
      Expression Builder (for the rule condition) with settings
    5. Click Apply and OK.
  10. Click in the Rule action cell for AutoApproval Template and then click the edit icon Edit icon.
    AutoApproval Template
    The Specify Rule Action wizard opens.
  11. Specify the rule action by completing the following steps::
    1. Expand and select Check Order Handling Policy for Automatic Approval > Output > OrderProcessingPreference > automaticApproval. Then select Value specification > Specific value and True. Click OK.
      Specify Rule Action wizard

      The following figure shows the completed business rule.

      Completed business rule

  12. Close the Define Business Rule wizard by clicking OK again.
  13. In the Attributes view, select the Business Rules tab and scroll down to the Default business rule section. In the selection list, select AutomaticApprovalF1. Save your work.
    Attributes of AutomaticApprovalF1
< Previous | Next >