Improving the Sales Order Management Process with Decision Logic

Objectives

After completing this lesson, you will be able to:

  • Create and configure decision logic in the process
  • Update an existing process

Introduction: Improving the Process with Decision Logic

Now you will learn how to create and configure a decision. A decision consists of one or more policies. Each policy consists of a collection of rules. These rules are used to automate the decision-making parts of a business process. After you create a decision (policy), you define your business logic by adding rules to the policy or policies.

The figure illustrates the foundations of decision logic.

To learn more about Decisions and rules, watch the following video:

As next, an exercise follows. Watch the following video, to be prepared for the exercise: Create and Configure Decision Logic in the Process.

Create and Configure Decision Logic in the Process

Business Scenario

Business processes usually require different approvers depending on the actual data in the process. Approvers shouldn't be hard coded into approval steps, but should be calculated dynamically with each process run. Also, in some situations, an actual approval by a human might not even be required, but the process should be approved automatically. Decisions and decision logic are perfectly suited to handle these kinds of situations. In the following, you'll create decision logic that will approve a sales order automatically when its sales order amount is below a certain threshold.

Create a decision to determine approvers who will be authorized to approve sales order based on complex rules.

To learn more about how to create and configure decision logic in the process, follow this tutorial.

Exercise Options

To start the exercise, choose Start Exercise in the figure below.

A pop-up opens. You have the following options:

  • Choosing Start: the simulation starts. Follow the simulation to learn how to create and configure decision logic in the process.
  • Choosing Open PDF Document: a PDF opens. Based on the steps described in this document, you can perform the exercise in your own system landscape.

To add a decision, first identify the set of rules to consider in the decision-making process.

Then define the data types relevant for designing the rules. Data types will contain all the necessary fields that will be needed to model the rule. For example, if a design rule says "Sales Order Amount greater than 100000", then set the Approver e-mail as lorin@domain.com. Then, the data types are Sales Order with Amountfield, and Approver withEmailfield.

Steps

  1. Create and configure decision logic in the process.

    1. Choose Order Processing.

    2. Choose Add (the + icon).

    3. Choose Decision (from the Choose what happens next pane).

    4. Choose Blank Decision.

    5. In the Name field, enter Determine Approver.

    6. In the Description field, enter Rule to identify the potential approvers for sales order..

    7. Choose Create.

    8. Choose Overview.

    9. Choose Create.

    10. Choose Data Type.

    11. In the Name field, enter Approver.

    12. In the Description field, enter Approver details who will approve the order from supplier side.

    13. Choose Create.

    14. Choose New Field.

    15. In the Name field, enter Email.

    16. Choose New Field.

    17. In the Name field, enter User Group.

    18. Choose Save.

    19. Choose Determine Approver.

    20. Choose Add Input Parameter.

    21. In the Name field, enter Sales Order Input.

    22. In the Description field, enter business rules input.

    23. Choose Type.

    24. Choose Sales Order.

    25. Choose Add Output Parameter.

    26. In the Name field, enter Approver Output.

    27. In the Description field, enter business rules input.

    28. Choose Type.

    29. Choose Approver.

    30. Choose Save.

    31. Choose Input Parameters.

    32. Choose Output Parameter.

    33. Choose Rules.

    34. Choose Add Rule.

    35. In the Rule Name field, enter Determine Approver.

    36. In the Rule Description field, enter Rule to identify the potential approvers for sales order..

    37. Choose Next Steps.

    38. Choose Sales Order Input.

    39. Choose orderAmount.

    40. Choose shippingCountry.

    41. Choose Next Step.

    42. Choose Approver Output.

    43. Choose Email.

    44. Choose UserGroup.

    45. Choose Next Step.

    46. Choose Create.

    47. Choose orderAmount.

    48. Press Ctrl+Space.

    49. Choose Comparison Operators.

    50. Choose is equal or less than.

    51. In the orderAmount field, enter 100000.

    52. Choose shippingCountry.

    53. Press Ctrl+Space.

    54. Choose Array Operators.

    55. Choose EXISTSIN.

    56. In the shippingCountry field, enter [UnitedKingdom, India, Germany].

    57. Choose Email.

    58. In the Email field, enter 'john.doe@sap.com'.

    59. Choose UserGroup.

    60. In the UserGroup field, enter 'SO_APPROVER'.

    61. Select Select All.

    62. Choose Add Row.

    63. Choose Insert After.

    64. Choose orderAmount.

    65. Press Ctrl+Space.

    66. Choose Comparison Operators.

    67. Choose is greater than.

    68. In the orderAmount field, enter 100000.

    69. In the Email field, enter 'john.doe@sap.com'.

    70. Choose UserGroup.

    71. In the UserGroup field, enter 'SO_MGMNT'.

    72. Choose Save.

      Note

      Make sure to put the entries within the single quotation marks (' ').
    73. Choose Close.

    74. Choose Overview.

    75. Choose Order Processing.

    76. Choose Add.

    77. Choose Decision.

    78. Choose Determine Approver.

    79. Choose Inputs.

    80. Select the Single Properties radio button.

    81. Choose expectedDeliveryDate.

    82. Choose Get Order Details 1.

    83. Choose expectedDeliveryDate.

    84. Choose orderAmount.

    85. Choose orderAmount.

    86. Choose orderDate.

    87. Choose orderDate (in the Process Content pane to the left).

    88. Choose orderDate (in the Process Content pane).

    89. Choose orderNumber.

    90. Choose orderNumber (in the Process Content pane to the left).

    91. Choose orderStatus.

    92. Choose orderStatus (in the Process Content pane to the left).

    93. Choose shippingCountry.

    94. Choose shippingCountry (in the Process Content pane to the left).

    95. Choose Save.

    96. Choose Close.

    97. Choose Determine Approver.

    98. Choose Close.

    99. Choose Close again.

    100. Choose Zoom.

    101. Choose Zoom to fit.

Result

You have now successfully created and configured decision logic in the process.

Include the Decision Logic in the Process

Business Scenario

When approvers are determined automatically by decision logic in the process, this also needs to reflect in the following approval tasks. The recipients of the approval tasks should be based on the resulting process content / variables of the decision execution step.

You'll now adapt the business process one last time to fully automate your approver selection by matching the recipients of the approval form to the one returned from the decision table.

To learn more about how to include the decision logic in the process, follow this interactive tutorial.

Exercise Options

To start the exercise, choose Start Exercise in the figure below.

A pop-up opens. You have the following options:

  • Choosing Start: the simulation starts. Follow the simulation to learn how to include the decision logic in the process.
  • Choosing Open PDF Document: a PDF opens. Based on the steps described in this document, you can perform the exercise in your own system landscape.

Run the Process Including Automation and Decision

Business Scenario

You have updated your business process with an automation and additional decision logic. Previously, you made sure that the process was running as expected. Now you need to re-validate because significant changes have been made. It is required to release and deploy the process again, and to the execute it for validation.

Run the business process with a full monitoring of the workflow instances and automation jobs.

To learn more about how to run the process including automation and decision, follow this tutorial.

Prerequisites

Before releasing and deploying your business process, please make sure you have completed the required Agent Management settings to execute the process with an automation.

Once you have taken care of the agent management settings, you can release and deploy the business process project to run the process.

Exercise Options

To start the exercise, choose Start Exercise in the figure below.

A pop-up opens. You have the following options:

  • Choosing Start: the simulation starts. Follow the simulation to learn how to run the process including automation and decision.
  • Choosing Open PDF Document: a PDF opens. Based on the steps described in this document, you can perform the exercise in your own system landscape.

Steps

  1. Run the process, including automation, decision and visibility scenario.

    1. Choose Process Details.

    2. Choose Visibility.

    3. Choose Add.

    4. Choose expectedDeliveryDate.

    5. Choose Add.

    6. Choose orderAmount.

    7. Choose Add.

    8. Choose orderDate.

    9. Choose Add.

    10. Choose orderNumber.

    11. Choose Add.

    12. Choose orderStatus.

    13. Choose Add.

    14. Choose shippingCountry.

    15. Choose Add.

    16. Select the scroll area to scroll down.

    17. Choose Customer Name.

    18. Choose Save.

    19. Choose Project Content.

    20. Choose Add.

    21. Choose Create.

    22. Choose Visibility Scenario.

    23. In the Name field, enter Sales Order Visibility Scenario.

    24. Choose Create.

    25. Choose Add.

    26. Choose Add Process.

    27. Choose Order Processing.

    28. Choose Save.

    29. Choose General.

    30. In the Instances Label field, enter Sales Order.

    31. In the Instance Label field, enter Sales Order.

    32. Choose Status.

    33. Choose Target Type.

    34. Choose Constant.

    35. Choose Add.

    36. Choose Performance Indicators.

    37. Choose Save.

    38. Choose Close.

    39. Choose Overview.

    40. Select the scroll area to scroll down.

    41. Choose Release.

    42. In the Release Project dialog box, choose the Release button.

    43. Choose Deploy.

    44. Choose Public.

    45. Choose Deploy.

    46. In the String field, enter C:\Users\Downloads\SalesOrders.xlsx.

    47. Choose Deploy.

    48. Choose Order Processing.

    49. Choose Trigger.

    50. Choose Copy Link.

      Note

      You can open the copied link in an new tab to view the form.
    51. In the Customer Name field, enter SAP SE.

    52. In the Order Number field, enter PO7918.

    53. Choose Submit.

      Note

      The form is submitted now, you will receive a notification in your inbox of SAP Build apps lobby.
    54. Choose Monitoring.

    55. Choose Visibility Scenarios.

    56. Choose Sales Order Visibility Scenario.

      Note

      Note that there is no processing information under the sales order visibility scenario, you now approve the form from the inbox of the SAP Build apps lobby.
    57. Choose Inbox.

    58. Choose Supplier Acknowledgment.

    59. Choose Approve.

    60. Choose Refresh.

    61. Choose Submit.

      Note

      You have now submitted the order confirmation form.
    62. Choose Monitoring.

    63. Choose Visibility Scenarios.

    64. Choose Sales Order Visibility Scenario.

    65. Choose Open Dashboard.

      Note

      Note that the dashboard is empty with no values.
    66. Choose Process Data.

    67. Choose Refresh.

    68. Choose Open Dashboard.

    69. Choose expectedDeliveryDate.

    70. Choose 2022-01-27.

    71. Choose OK.

    72. Choose OrderAmount.

    73. Choose 150935.13.

    74. Choose OK.

    75. Choose orderDate.

    76. Choose 2022.01.22.

    77. Choose OK.

    78. Choose orderNumber.

    79. Choose PO7918.

    80. Choose OK.

    81. Choose orderStatus.

    82. Choose Urgent.

    83. Choose OK.

    84. Choose ShippingCountry.

    85. Choose United Kingdom.

    86. Choose OK.

    87. Choose Customer Name.

    88. Choose SAP SE.

    89. Choose OK.

Result

You have now successfully run the process including automation, decision and visibility scenario.

Log in to track your progress & complete quizzes