partNumber Element

This topic describes the <partNumber> XML element.

General syntax
<partNumber [value="regexp" regexpid="id_name" invert="false"] />
Description Tests the existence of the part number (if it is not null). If the part number is null (not defined), always returning false. If the optional value defined matches, it returns "true". This test is an alias instruction for the test Element.
Attributes Name Use Annotation
value optional Defines the value of the part number.

The value can be either a string or any Regular Expression reference. If the optional attribute value is omitted, then the test will execute an existence check. If the value attribute is defined, then the test is successful if the value matches the pattern.

regexpid optional Defines the unique id within the namespace to reference the test using regular expressions.

Allowed characters: [p{Alnum}\_\-] = [a-z A-Z 0-9 _ -]

When regexpid is used outside the tag and the value is not a match, an illegal state exception is thrown (see correct example).

invert optional The Boolean value "true" inverts the behavior of the instruction. If the attribute is not configured, the default value "false" is used and the behavior of the instruction is not inverted. When the value is defined as "true" and the criteria does not match, the child instructions will be executed.
Examples
<!-- tests if the part number is starting with CAP- regular expression and if its value starts with CAP
     exists --> 
< partNumber value="CAP-(.*)" invert="false" /> 

<!-- If the partNumber value starts with "Test" a regexpid --> 
<partNumber value="Test-(.*)" regexpid="PART_NUMBER_WITH_PREFIX"> 

     <!—Set part number value from regexpid exclude "Test-"--> 
     <setPartNumber value="${PART_NUMBER_WITH_PREFIX.value[1]}"/>

</partNumber>