1Workflow::Condition::NeUssteerd(C3o)ntributed Perl DocumWeonrtkaftlioown::Condition::Nested(3)
2
3
4
6 Workflow::Condition::Nested - Evaluate nested workflow conditions
7
9 This documentation describes version 1.59 of this package
10
12 Typically, the workflow conditions are evaluated directly by the
13 framework in Workflow::State when the action is evaluated. This module
14 allows a workflow condition to contain nested conditions that are
15 evaluated directly rather than via separate workflow actions.
16
17 This allows the workflow to be designed to group multiple conditions
18 and perform advanced operations like an OR comparision of multiple
19 conditions with "greedy" evaluation (as opposed to "lazy" evaluation).
20
21 A usage example might be a case where 3 of 5 possible approvals are
22 needed for an action to be allowed. The "Greedy OR" condition would
23 define the list of conditions to be evaluated. After checking each
24 condition, it would return the total number of successes. The result is
25 then checked against the number needed, returning the boolean value
26 needed by Workflow::State.
27
28 Note: This class is not used directly, but subclassed by your class
29 that implements the "evaluate()" method and calls the
30 "evaluate_condition" method to evaluate its nested conditions.
31
33 In condition.xml:
34
35 <condition name="cond1" ... />
36 <condition name="cond2" ... />
37 <condition name="cond3" ... />
38 <condition name="cond4" ... />
39 <condition name="cond5" ... />
40
41 <condition name="count_approvals" class="Workflow::Condition::GreedyOR">
42 <param name="condition" value="cond1" />
43 <param name="condition" value="cond2" />
44 <param name="condition" value="cond3" />
45 <param name="condition" value="cond4" />
46 <param name="condition" value="cond5" />
47 </condition>
48
49 <condition name="check_approvals" class="Workflow::Condition::CheckReturn">
50 <param name="condition" value="count_approvals" />
51 <!-- operator "ge" means: greater than or equal to -->
52 <param name="operator" value="ge" />
53 <param name="argument" value="$context->{approvals_needed}" />
54 </condition>
55
56 In workflow.xml:
57
58 <state name="CHECK_APPROVALS" autorun="yes">
59 <action name="null_1" resulting_state="APPROVED">
60 <condition name="check_approvals" />
61 </action>
62 <action name="null_2" resulting_state="REJECTED">
63 <condition name="!check_approvals" />
64 </action>
65 </state>
66
68 See Workflow
69
71 Copyright (c) 2004-2022 Chris Winters. All rights reserved.
72
73 This library is free software; you can redistribute it and/or modify it
74 under the same terms as Perl itself.
75
76 Please see the LICENSE
77
79 Please see Workflow
80
81
82
83perl v5.34.0 2022-02-06 Workflow::Condition::Nested(3)