Conditionals

Version 22.0.8473


Conditionals

Version 22.0.8473


Conditionals are added to Destination nodes so that they are only included in the output document if a certain condition is true.

Select the Filter icon next to a mapped element to add a conditional to the mapping. The Conditional editor allows for creating logical rules and groups of rules that determine whether a destination element should appear in the output document. Each rule uses a configurable boolean operator to compare an input element to a specified value.

For example, when mapping input XML from a Purchase Order, the tax associated with the purchase may be included as one of the Line Items. When mapping the tax information output element, it may make sense to add a conditional that excludes Line Items with an ItemName that is not equal to Tax.

Conditional logic can also be accomplished using Lookahead syntax, described in the section above. Often time, parent elements are qualified by a child element that provides context to the values inside the parent. In these cases it may be easier to use Lookahead syntax than create multiple conditionals to exclude unwanted values.

Custom Conditionals

The Conditional editor allows for specifying a custom condition using the syntax of ArcScript. One common use of this custom condition editor is to compare two dynamic values from the Source document (rather than comparing a single dynamic value against a static value).

For example, the following custom conditional could be used to check to see whether two values in the Source XML are equal:

'[xpath(element1)]' == '[xpath(data/element2)]'

Note that the single quotes in the above example are required.

Boolean logic in custom conditionals can also be performed entirely using ArcScript formatters, like the following example:

[xpath(element1) | equals([xpath(data/element2])])]

Note that this syntax does not require single quotes. All of ArcScript’s formatters can be found documented in the dedicated Formatters section.