Subject: | feature request - specify "static" arguments to the actions |
Date: | Sat, 9 Oct 2010 12:54:42 -0600 |
To: | bug-Workflow [...] rt.cpan.org |
From: | Luis Miguel Silva <luismiguelferreirasilva [...] gmail.com> |
Dear Pel Workflow devs,
I would like to start by thanking you all for the awesome job you did
with the Perl Workflow module.
I've been researching for a workflow engine i could use in my projects
and your module is really sweet!
I just recently started using it so i'm still getting to know all the details.
But one of the things i noticed is that i could not find any
documentation (or even figure out how to do it, even browsing through
the code) is the ability to specify static arguments to the actions!
I was really excited to find out how powerful the module already is as
i could easily create loop and if conditions with it.
But what i'm really needing right now is the ability to do something like this:
<workflow>
<type>myworkflow</type>
<description>This is my workflow.</description>
<persister>MainPersister</persister>
<state name="INITIAL">
<description>this is the initial state</description>
<action name="create file">
<resulting_state return="OK" state="created file" />
<resulting_state return="*" state="error_handler" />
</action>
</state>
<state name="error_handler" autorun="yes">
<action name="log_error" resulting_state="failed">
<condition test="defined $context->{error_message}" />
</action>
<!-- even if we cant find anything to log, we still want to fail! -->
<action name="null" resulting_state="failed">
<condition test="!defined $context->{error_message}" />
</action>
</state>
</workflow>
And then have my log_error action configured like this:
<actions>
<action name="log_error" class="MyApp::Action::LogError">
<param name="log_message" value="An error occurred:
$context->{error_message}"/>
</action>
</actions>
Just so you better understand what i'm trying to do, i'm basically
creating a bunch of reutilizable modules and trying to create a
project that will allow people to either develop extra modules OR use
the pre existing ones and not have to develop a single line of code!
The objective is that people can fully customize their workflow logic,
just by editing the xml flows (which, in my opinion, is the whole
purpose of using a workflow engine ;o)).
Another really cool feature would be the ability to run multiple
actions when "autorun" is specified:
<state name="verified file" autorun="yes">
<action name="always_gets_run" resulting_state="verified file"
run_order="1"/>
<action name="does_not_get_run" resulting_state="loop_example"
run_order="2"/>
</state>
Right now, when autorun is activated, the flow will only run one if
there is only one action inside OR multiple actions do not conflict
with each other.
It would be a HUGE enhancement to be able to specify a "run_order" so
that individual states could have multiple actions!
I obviously understand this is a community so...if we want something
done, we should try and do it ourselves heheh ;o)
But i thought i would send out an email to send all you guys my
appreciation and try to understand if this already exists? (also
because i really believe it would be really useful for other users and
because i'm a novice perl coder and don't want to write something that
will never make it to the official repo :oP).
Thanks a lot!
Luis