Modifying Process Behavior Using XML Manipulation

This example shows a scenario where an XML file is created using information in a process, and calculates the values in an XML by formula or custom expression using an XML Manipulation AgileShape.

Instructional Goals

  • Demonstrate how to calculate the values in an XML by formula or custom expression using an XML Manipulation AgileShape.

Example Process: Budget Request

Problem Statement

Submit budget requests from multiple international department heads.

Business Requirements

  • Both the US Manager and India Manager of a department submit budget request forms.
  • The local currency is standardized to US dollars.
  • The request is routed for review by the manager or CFO, depending upon the standardized budget amount.

Prerequisites

  • A process model with the following process attributes:
    • BudgetAmountUS - The budget amount for the US office in US dollars (USD).
    • BudgetAmountIndiaInr - The budget amount for the India office in Indian rupees (INR).
    • BudgetAmountIndiaUsd - The budget amount for the India office in (USD).
    • TotalBudgetAmountUsd - The total budget amount of both offices in USD.
    • ExchangeRateInrToUsd - The number of INR in on USD.
  • A web form where the US manager can enter the requested budget amount in USD and the India manager can enter the requested budget amount in INR.
  • A web service that queries the current exchange rate from INR to USD, and then populates ExchangeRateInrToUsd with this ratio.

Navigation

  1. In AgilePoint Envision, open a process template.
  2. Navigate to the Miscellaneous stencil.
  3. On the Miscellaneous stencil, drag the XML Manipulation AgileShape, and drop it on the process template.
  4. To view the entire list of properties, in the Design Tasks pane, click Show Properties.
  5. On the Configure field, click the Ellipses button.
  6. To add formulas for XML calculation, on the Multiple Formulae Dialog window, click Add.

Instructions

  1. On the Formula Window, in the Attribute Name field, enter BudgetAmountIndiaUsd.
  2. Place your cursor in the Formula field, and click Insert Function.
  3. On the Insert Function Window, in the Categories list, select Math.
  4. In the Functions list, select Product.
  5. Click OK.
  6. On the Formula window, in the Formula field, place your cursor after @product, and click Insert Field.
  7. On the Select XPath from Attributes Window, select BudgetAmountIndiaInr.
  8. Click OK.
  9. On the Formula window, in the Formula field, place your cursor after @product, and click Insert Field.
  10. On the Select XPath from Attributes window, select ExchangeRateInrToUsd.
  11. Click OK.
  12. On the Multiple Formulae Dialog window, click Add.
  13. On the Formula window, in the Attribute Name field, enter TotalBudgetAmountUsd.
  14. Place your cursor in the Formula field, and click Insert Function.
  15. On the Insert Function window, in the Categories list, select Math.
  16. In the Functions list, select Sum.
  17. Click OK.
  18. On the Formula window, in the Formula field, place your cursor after @sum, and click Insert Field.
  19. On the Select XPath from Attributes window, select BudgetAmountIndiaUsd.
  20. Click OK.
  21. On the Formula window, in the Formula field, place your cursor after BudgetAmountIndiaUsd, and click Insert Field.
  22. On the Select XPath from Attributes window, select TotalBudgetAmountUsd.

The result of these formulas is a total budget amount that converts the budget amount from the India office from INR to USD, and then adds this amount to the budget from the US office. This provides a total budget amount in USD. This value can then be evaluated by the multiple condition AgileShape to determine whether the request needs to be routed to the Director or CFO.