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
- In AgilePoint Envision, open a process template.
- Navigate to the Miscellaneous stencil.
- On the Miscellaneous stencil, drag the
XML Manipulation AgileShape, and drop it on the process template.
- To view the entire list of properties, in the Design Tasks pane, click Show Properties.
- On the Configure field, click the Ellipses button.
- To add formulas for XML calculation, on the Multiple Formulae Dialog window, click Add.
Instructions
- On the Formula Window, in the Attribute Name field, enter
BudgetAmountIndiaUsd.
- Place your cursor in the Formula field, and click Insert
Function.
- On the Insert Function Window, in the Categories list, select Math.
- In the Functions list, select Product.
- Click OK.
- On the Formula window, in the Formula field, place your cursor
after @product, and click Insert Field.
- On the Select XPath from Attributes Window,
select BudgetAmountIndiaInr.
- Click OK.
- On the Formula window, in the Formula field, place your cursor
after @product, and click Insert Field.
- On the Select XPath from Attributes window, select
ExchangeRateInrToUsd.
- Click OK.
- On the Multiple Formulae Dialog window, click Add.
- On the Formula window, in the Attribute Name field, enter
TotalBudgetAmountUsd.
- Place your cursor in the Formula field, and click Insert
Function.
- On the Insert Function window, in the Categories list, select
Math.
- In the Functions list, select Sum.
- Click OK.
- On the Formula window, in the Formula field, place your cursor
after @sum, and click Insert Field.
- On the Select XPath from Attributes window, select
BudgetAmountIndiaUsd.
- Click OK.
- On the Formula window, in the Formula field, place your cursor
after BudgetAmountIndiaUsd, and click Insert Field.
- 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.