Subject: | Wrong documentation of Condition configuration |
Date: | Mon, 21 Aug 2006 10:05:16 +0200 |
To: | bug-Workflow [...] rt.cpan.org |
From: | Michael Bell <michael.bell [...] cms.hu-berlin.de> |
Message body not shown because it is not plain text.
Hi,
Workflow 0.22
Perl 5.8.8
The documentation of the condition configuration contains a small bug.
Conditions are checked by the module Workflow::State. This requires that
the state configuration includes a reference to the condition. If the
reference to the condition only exists in the full action specification
(perhaps in a separate file) then the condition will be ignored.
The issue is non-critical because only the documentation has a bug
(nevertheless it costs some time to find the problem ;) ).
Best regards
Michael
--
Show quoted text
_______________________________________________________________
Michael Bell Humboldt-Universitaet zu Berlin
Tel.: +49 (0)30-2093 2482 ZE Computer- und Medienservice
Fax: +49 (0)30-2093 2704 Unter den Linden 6
michael.bell@cms.hu-berlin.de D-10099 Berlin
_______________________________________________________________
--- Condition.pm.org 2006-08-21 09:51:43.000000000 +0200
+++ Condition.pm 2006-08-21 09:57:00.000000000 +0200
@@ -45,13 +45,17 @@
</condition>
...
- # Reference the condition in an action...
- <actions>
- <action name="MyAction" class="My::Action">
- ...
- <condition name="IsAdminUser" />
- </action>
- ...
+ # Reference the condition in an action of the state/workflow definition...
+ <workflow>
+ <state>
+ ...
+ <action name="MyAction">
+ ...
+ <condition name="IsAdminUser" />
+ </action>
+ </state>
+ ...
+ </workflow>
# Then implement the condition
@@ -94,6 +98,13 @@
the available actions she might get a different answer than user B
since they determine separate contexts.
+B<NOTE>: The condition is enforced by Workflow::State. This means that
+the condition name must be visible inside of the state definition. If
+you specify the reference to the condition only inside of the full
+action specification in a seperate file then nothing will happen. The
+reference to the condition must be defined inside of the state/workflow
+specification.
+
=head1 SUBCLASSING
=head2 Strategy