Testing method results using a transition
As an activity executes, the method referenced in each step (implemented in Java) is
called and executes. Most methods update the
pxMethodStatus
property on the
pxThread
page with a status that starts with one of the values
Good:
,
Warn
:, or
Fail:
. These three values
are prefixes to a message key that is looked up as a field value rule.
Optionally, your activities can place additional information about an error or result in the property named pxMethodStatusInfo.
As a best practice, test this status prefix against
Good
in those
activity steps that may fail. In the When dialog, reference a when condition rule, and
branch or jump to handle the failure.
In transitions, you can use three standard when conditions: @baseclass.StepStatusGood, @baseclass.StepStatusGood, and @baseclass.StepStatusFail. Note the following information:
-
The
StepStatusFail
condition returnsTrue
when the status isFail
. - The
StepStatusWarn
condition returnsTrue
when the status containsWarn
. -
The
StepStatusGood
condition returnsTrue
when the status isGood
. - The Obj-Validate method does not usually update the pxMethodStatus property. Reference the standard when rule @baseclass.hasMessages to test whether a page contains one or more page messages.
To enter a transition: