This section explains the procedure for extracting User Defined Attribute (UDA) values from XML data.
Prerequisites:
The process definition has a UDA that contains an XML string that is to be parsed.
The process definition has UDAs to which the extracted XML data can be assigned.
You can extract data from an XML string coming in to Systemwalker Runbook Automation and assign the data to UDAs using the Assign UDA from XPath Expression Java Action. You specify where the data can be found in the XML string using an XPath expression.
This Java Action is usually used in conjunction with the Assign XML to UDA Java Action and an HTTP Agent. This three-component system forms a data-transfer interface to a system external to Systemwalker Runbook Automation.
To extract UDA values from incoming XML data:
Click the empty space in the Process Definition editor or select the node to which you want to assign the Java Action, to display the Properties view for the process definition or the node respectively.
Select the Action Set tab. Click Add corresponding to the position where you want to add the Java Action. The Action Type List dialog is displayed.
Expand XML Actions and double click Assign UDA from XPath.
In the Assign UDA from XPath expression dialog, type a descriptive name for the Java Action in the Action Name field.
From the Source UDA field, select the UDA that contains the XML string from which the value(s) will be extracted.
The drop-down list displays all available UDAs. For more details on the supported data types, refer to section 6.18 Specifying User Defined Attributes.
Map the data that you want to extract from the XML string to UDAs. To define a mapping:
Click in the field in the Target UDA column. A drop-down list is displayed. From the drop-down list, select the UDA to which you want to assign the data.
Click in the field in the XPath of target UDA column. A drop-down list is displayed. Select from the drop-down list, the XPath expression that specifies where the data will be stored in the XML string of the target UDA.
This field is active only if you have selected a UDA of type XML.
The XPath expressions related to the selected Target UDA are displayed in the XPath of target UDA drop-down list.
Optional: If you want to edit the XPath expression that you selected in the XPath of target UDA drop-down list, click the ellipsis (...) button that is displayed next to the XPath of target UDA drop-down list. XPath Editor dialog is displayed with the selected XPath expression in its editor area. You can edit this XPath expression and click OK to use the edited XPath expression.
Click in the field in the XPath of source UDA column. A drop-down list is displayed. Select from the drop-down list, the XPath expression that specifies where the data can be found in the XML string of the Source UDA.
This field is active only if you have selected a UDA of type XML.
The XPath expressions related to the selected Source UDA are displayed in the XPath of source UDA drop-down list.
Optional: If you want to edit the XPath expression that you selected in the XPath of source UDA drop-down list, click the ellipsis (...) button that is displayed next to the XPath of source UDA drop-down list. XPath Editor dialog is displayed with the selected XPath expression in its editor area. You can edit this XPath expression and click OK to use the edited XPath expression.
If you want to define another mapping, click Add and repeat the previous substeps.
If you want to remove a mapping, select it and click Remove.
Note
The edited XPath expression is displayed as the latest XPath in the XPath drop-down list.
Note
The XPath expressions related to the selected XML UDA are displayed in the XPath drop-down list. When XML Schema is defined in selected UDA, the XPath list that can be used with this XML Schema is displayed. When Initial value is defined in selected UDA, the XPath list that can be used with this Initial value is displayed. When both are defined, Xpath list of XML Schema is displayed.
Note
XPath Editor only validates the syntax of the XPath. It does not check if the edited XPath expression exists or not.
The following figure shows an example where customer data are sent to Systemwalker Runbook Automation as an XML string. They are stored in the Customer UDA. The customer's name is extracted from the XML string and mapped to the VIPCustomer UDA.
Figure 11.23 Extracting Data from an XML String - XPath of source UDA
Click OK.
Note
It is not necessary to compensate this action using a compensation action, because changes made by this action are in Systemwalker Runbook Automation only and they will be rolled back after the process instance goes into error state. For information on compensation actions, refer to section 11.1.7 Dealing With Errors in Java Actions.