Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

...

const $Xml;

Example

Code Block
languagejs
$Xml.SelectAll('//Customer', function(customer) {
  var id = customer.Evaluate('Id'); 
});

Reference point

$Xml object points to different elements depending on of where they are used.

In Pre work, Post work, Role, and Route scripts $Xml is bound to process pool element.

Rule based Validation and Formatting rules $Xml is bound to the control element.The pool

Pool element is created at

...

root of

...

XML tree by default but sub-workflow instances may use any element in

...

data tree.

...

Code Block
languagexml

...

Example Data Model for Pool</p>
<p><form></p>
<p>  <Product></p>
<p>    <Id>1234</Id></

...

p>
<p>    

...

<Orders></p>
<p>      

...

<Order></p>
<p>        <Id>4567</

...

Id></p>
<p>        <Amount>1</Amount></

...

p>
<p>      </Order></

...

p>
<p>        <Id>8901</

...

Id></p>
<p>        <Amount>2</Amount></

...

p>
<p>    </Orders></

...

p>
<p>  </Product></

...

p>

...

<p></form>

In the product process $Xml will be pointed point to "Product" element.

For the Order process (as a sub-workflow of the Product process) $Xml will point to the "Order" element where is sub - workflow is initiated.

For rules on the "Amount" field $Xml will point "Amount" element.

Accessing Pool Root

Because $Xml may point to different elements in the data model, in some cases , you may need to access the pool root element. You can use "/form/Product" xpath or "$poolRoot" variable if you need to access the pool root.

Example

Code Block
languagejs
var productId = $Xml.Evaluate("/&#8727;/Product/Id");

...

Code Block
languagejs
var productId = $Xml.Evaluate('$poolRoot/Id');

See Also