Re: [Perl-workflow-devel] Patch - Workflow::Condition::Nested
Brought to you by:
jonasbn
From: Jonas B. N. <jo...@gm...> - 2012-10-25 17:06:35
|
Hello All (and Scott), I have made a developer release (1.34_2) with Scott's patches applied. It should be available on your local CPAN mirror soon. Feedback etc. most welcome - I am working on the patches from Oliver Welter, there is a minor issue. But another developer release (1.34_3) is in the pipeline. If everything works out Workflow 1.35 could be released within a reasonable timeframe. Happy hacking, jonasbn On 25/10/2012, at 18.46, "Jonas B. Nielsen" <jo...@gm...> wrote: > Hi Scott, > > Everything seems pretty good, I will do a developer release (1.34_2) shortly with this patch so we can evaluate. All tests pass and things look promising. > > jonasbn > -- > pauseid: JONASBN > email: jo...@cp... > twitter: jonasbn > blog: http://logicLAB.org/ > > On 17/10/2012, at 15.55, Scott Hardin <sco...@hn...> wrote: > >> Hi Jonas, >> >> While working on designing a new workflow for OpenXPKI, we ran into the situation where we had a confusingly large number of conditions and states all tied together in a big mess. As an example, this new workflow of ours has a variable number of approvals from multiple sources: administrators manually giving their 'OK', but also things like the correct status of the device in a database counted as an "automatic" approval. The certificate is then only issued if, for example, at least 3 of the 5 possible approvals are found. >> >> What we created is the notion of "Nested" conditions. Basically, the new Workflow::Condition::Nested class can evaluate other conditions directly without having to create a complex chain of workflow states, actions and conditions. >> >> In the example above, we created two of these new conditions: >> >> The first condition, Workflow::Condition::GreedyOR, takes a list of condition names as parameters and does a logical OR test on the whole list. In contrast to a lazy-evaluation, though, it actually evaluates _all_ of the conditions and returns the count of true values. Again, the evaluation of these child conditions is done directly in this condition. >> >> The second condition, Workflow::Condition::CheckReturn, is the condition that is actually configured to be associated with a workflow activity at a particular workflow state (the other "child" conditions are merely <condition .../> entities not directly attached to activities). This CheckReturn specifies the name of the condition using the GreedyOR class and evaluates it's return value. The result is then compared with a context value to see if the policy for the number of required approvals is met. >> >> Attached is a patch that should be able to be cleanly applied with or without Oliver's patches. >> >> With best regards, >> >> Scott >> >> >> >> <0001-Add-Workflow-Condition-Nested.patch.gz> >> >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_sfd2d_oct_______________________________________________ >> Perl-workflow-devel mailing list >> Per...@li... >> https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel > |