If a script sets the conditionState object state and result, it should also set the root cause information indicating why the condition was set to a specific value as shown in the following declaration.
conditionState.setState() as FINISHED and conditionState.setResult( resultingCondition, reason);
Set the root cause information by using the following method:
conditionState.getRootCause().setContributorsReasonWhere( contributors, reason, where );
Table 9-1 defines the parameters used to set the root cause information.
Table 9-1 Parameters Used to Set Root Cause
Parameter |
Description |
---|---|
ElementImpl[ ] contributors |
Specifies the elements that caused the element to have a specific condition. For example, contributors can be all critical children of the element. Set this to null if no other elements contribute. |
String reason |
Text description of the reason why the element has a specific condition. For example, “I have CRITICAL children elements.” |
String where |
A text description of where the condition was set. For example, “Script MakeACondition.” Set it to null to automatically fill in by using the algorithm name. |
For customized algorithms to support root cause and show impact, set root cause information that indicates why the condition was set to a particular value.