GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Workflow::Condition::Nested(3) User Contributed Perl Documentation Workflow::Condition::Nested(3)

Workflow::Condition::Nested - Evaluate nested workflow conditions

This documentation describes version 1.60 of this package

Typically, the workflow conditions are evaluated directly by the framework in Workflow::State when the action is evaluated. This module allows a workflow condition to contain nested conditions that are evaluated directly rather than via separate workflow actions.

This allows the workflow to be designed to group multiple conditions and perform advanced operations like an OR comparision of multiple conditions with "greedy" evaluation (as opposed to "lazy" evaluation).

A usage example might be a case where 3 of 5 possible approvals are needed for an action to be allowed. The "Greedy OR" condition would define the list of conditions to be evaluated. After checking each condition, it would return the total number of successes. The result is then checked against the number needed, returning the boolean value needed by Workflow::State.

Note: This class is not used directly, but subclassed by your class that implements the "evaluate()" method and calls the "evaluate_condition" method to evaluate its nested conditions.

In condition.xml:

    <condition name="cond1" ... />
    <condition name="cond2" ... />
    <condition name="cond3" ... />
    <condition name="cond4" ... />
    <condition name="cond5" ... />

    <condition name="count_approvals" class="Workflow::Condition::GreedyOR">
        <param name="condition" value="cond1" />
        <param name="condition" value="cond2" />
        <param name="condition" value="cond3" />
        <param name="condition" value="cond4" />
        <param name="condition" value="cond5" />
    </condition>

    <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>

See Workflow

Copyright (c) 2004-2022 Chris Winters. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Please see the LICENSE

Please see Workflow
2022-03-02 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.