++ed by:

1 non-PAUSE user(s).

jonasbn

NAME

Workflow::Condition::CheckReturn

DESCRIPTION

Using nested conditions (See Workflow::Condition::Nested), this evaluates a given condition and compares the value returned with a given argument.

SYNOPSIS

In condition.xml:

    <condition name="check_approvals" class="Workflow::Condition::CheckReturn">
        <param name="condition" value="count_approvals" />
        <!-- operator "ge" means: greater than or equal to -->
        <param name="operator"  value="ge" />
        <param name="argument"  value="$context->{approvals_needed}" />
    </condition>

In workflow.xml:

    <state name="CHECK_APPROVALS" autorun="yes">
        <action name="null_1" resulting_state="APPROVED">
            <condition name="check_approvals" />
        </action>
        <action name="null_2" resulting_state="REJECTED">
            <condition name="!check_approvals" />
        </action>
    </state>

PARAMETERS

The following parameters may be configured in the param entity of the condition in the XML configuration:

condition

The name of the condition to be evaluated.

argument

The value to compare with the given condition. This can be one of the following:

Integer

The integer value is compared with the return value of the condition.

String [a-zA-Z0-9_]

The string is interpreted as the name of a workflow context parameter. The current value of that parmeter is used in the comparison.

String

Any other string is evaluated in an eval block. The result should be numeric.

operator

The name of the comparison operator to use. Supported values are:

    'eq', 'lt', 'gt', 'le', 'ge', 'ne'

The string names are used to simplify the notation in the XML files. The above strings map to the following numeric operators internally:

    '==', '<', '>', '<=', '>=', !=