Tutorial: Order Management

Tutorial: Order Management

Step 2: Add the Subprocess to each Parallel Path

Step 2: Add the Subprocess to each Parallel Path

Add the Send Email process to both branches. The first branch sends an email to the consumer. The second branch sends an email to the vendor.
  1. Click and drag a Subprocess step onto the first branch.
    The step properties section appears.
  2. Select the
    Process
    tab and select the
    Send Email
    process.
  3. Select the
    Input Fields
    tab and add the following fields:
    Field Name
    Field Type
    Field Value
    EmailAddress
    Content
    testconsumer@mailinator.com
    Message
    Formula
    fn:concat ("Dear ", $input.CustomerName, ". Thanks for ordering.", "Your order ID is: ", $output.OrderId, ". We will deliver your order in 7 days.")
    You use the XQuery
    concat()
    function to build the email message.
    Click f(x) to open the Expression Editor and view the XQuery expression that you entered.
    The image shows the Expression Editor with the Concat XQuery expression you entered.
  4. Select the
    General
    tab and enter
    Send Email to Consumer
    in the
    Name
    field.
  5. Click and drag a Subprocess step onto the second branch.
    The step properties section appears.
  6. Select the
    Process
    tab and select the
    Send Email
    process.
  7. Select the
    Input Fields
    tab and add the following fields:
    Field Name
    Field Type
    Field Value
    EmailAddress
    Content
    testvendor@mailinator.com
    Message
    Formula
    fn:concat ("Order has been accepted. The order ID is: ",$output.OrderId, ". Please note below details for your records.", " Overall Profit: ", $output.Calculate_Margin_ServiceResponse[1]/MarginBeforeCommission ,". SalesCommission: ",$output.Calculate_Margin_ServiceResponse[1]/SalesCommission,". Profit after Commission: ", $output.Calculate_Margin_ServiceResponse[1]/MarginAfterCommission )
    Click f(x) to open the Expression Editor and view the XQuery expression that you entered.
    The image shows the Expression Editor with the Concat XQuery expression you entered.
  8. Select the
    General
    tab and enter
    Send Email to Vendor
    in the
    Name
    field.
  9. Click
    Save
    Publish
The following image shows the process canvas:
This image shows the Order Management process with the Send Email subprocess added.

0 COMMENTS

We’d like to hear from you!