> However this one fails because I can't load the Time (standard)
> library properly. I tried including "require 'time'" in various source
> files, but it keeps failing with the following exception:
>
> exception : undefined method `parse' for Time:Class
Hi Maarten,
I managed to fix the "flattened time in db" issue :
http://github.com/jmettraux/ruote/commit/3340464c366bb91293f07f5b79a9c54581d570f9
I have also made sure Date is handled correctly as well, see tests 6 and 6b :
http://github.com/jmettraux/ruote/commit/3340464c366bb91293f07f5b79a9c54581d570f9#diff-3
About the missing parse method, I discovered that by putting "require
'date'" at the top of the rufus/eval.rb file, I was able to use
Time.parse(). Maybe by putting that require before the first mention
to "require 'openwfe/...'" would do the trick.
I hope this will help, thanks for the feedback,
--
John Mettraux - http://jmettraux.wordpress.com
This workitem.start_time is your own field, right (and if I understand
correctly: is some time in the future)?
For such "wait" expression, can one access :launch_time from
OpenWFE::ProcessStatus?
${f:launch_time} seems empty. In Densha, ${f:launcher} is set in app/
controllers/launchp_controller.rb -- in which I can easily add
something:
def launch
:
li = OpenWFE::LaunchItem.new
li.workflow_definition_url = lp.real_url
li.launcher = user.name
# NEW
li.launched_at = Time.now
:
...and then use "${f:launch_time}" in my process definition.
Or is there a way to get to the actual process information directly?
Thanks!
Arjan.
In those "r" prefixed expression attributes, "wi" and "fe" are
available, being respectively the current workitem and the current
flowexpression.
You could thus do
<wait runtil="Time.now >=
fe.get_engine.process_status(fe.fei.wfid).launch_time + x" />
but maybe the intention is just
<sleep for="x" />
> ${f:launch_time} seems empty. In Densha, ${f:launcher} is set in app/
> controllers/launchp_controller.rb -- in which I can easily add
> something:
>
> def launch
> :
> li = OpenWFE::LaunchItem.new
> li.workflow_definition_url = lp.real_url
> li.launcher = user.name
>
> # NEW
> li.launched_at = Time.now
> :
>
> ...and then use "${f:launch_time}" in my process definition.
It's more economical than fetching the process status (an operation
that has to query the expression storage... with a cache on, it's not
a big problem though).
Best regards,
Great explanation!
By the way: I did consider using sleep, but for my process definition
that would imply a concurrence spanning from the very start of my
process all the way to the end (after some initial steps, the user is
to receive an email some days after starting the process, and the
process is to be cancelled if not completed within some specific time).
Thanks,
Arjan.
Hello,
something like :
---8<---
class ArjanProcess0 < OpenWFE::ProcessDefinition
concurrence :count => 1 do
# with count set to 1, when 1 branch replies
# the other branches get cancelled
core
sequence do
sleep "7d"
send_warning
sleep "3d"
# exit (other branches will get cancelled)
end
end
process_definition :name => "core" do
# ...
end
end
--->8---
?
Note that the process "core" could be another process (document)
referenced by URL or name. This this "ArjanProcess0" could become a
"pattern" and wrap any other process. See
http://openwferu.rubyforge.org/expressions.html#exp_subprocess or
http://github.com/jmettraux/ruote/tree/master/test/ft_29_httprb.rb
(where the <subprocess ref="http://process.server/definitionX.xml" />
is used).
Cheers,