The <successCriteria> element is a child element of <execNative>. This child element specifies the criteria to be used to evaluate whether an <execNative> step executed successfully. If this element is not specified, the default value is <successCriteria status=”0”/>.
If the specified <successCriteria> is empty, it is ignored.
If you specify <successCriteria/>, the step always succeeds no matter what output or exit code the command generated.
The <successCriteria> element has the following optional attributes. If more than one of the status, outputMatches, and errorMatches attributes are specified, they are ANDed together.
status – An optional attribute of type integer, which is the desired exit status of the command. This value should be a positive integer.
outputMatches – An optional attribute that is a regular expression to match the standard output that is generated by the command. This value should be a nonempty string. This attribute can reference simple substitution variables.
errorMatches – An optional attribute that is a regular expression to match the standard error output that is generated by the command. This value should be a nonempty string. This attribute can reference simple substitution variables.
inverse – An optional attribute of type Boolean, which, if set to true, negates each of the conditionals specified in <successCriteria>. The default value is false. The step succeeds only if the conditions that are specified through each attribute of <successCriteria> are not met.
For example, an <execNative> step with the following <successCriteria> succeeds if status is not 1, the standard output does not match bin, and standard error does not match none.
<successCriteria status=”1” outputMatches=”bin” errorMatches=”none” inverse=”true”/> |
A <successCriteria> element that contains only the inverse attribute is saved without the inverse attribute. So, if you specify the following statement, the element is stored as <successCriteria/>, and the <successCriteria> element is ignored.
<successCriteria inverse=”true”/> |