Hello John,
set-fields seems like a good idea, it seems appropriate for our situation,
but we have the following problem:
-In Ruby:
set_fields :value => { "name" => "", "addr" => ""}
-In JSON:
['set_fields',{'value':{'name': '', 'addr': ''}}]
But... how would you write it in XML notation?
<set-fields value="..." />
Thanks for your help,
Kind regards,
Emilio and Diego
-----Mensaje original-----
De: [email protected]
[mailto:[email protected]] En nombre de John Mettraux
Enviado el: martes, 20 de enero de 2009 13:17
Para: [email protected]
Asunto: [openwferu-users] Re: Workflow start-up time
On Tue, Jan 20, 2009 at 7:50 PM, <[email protected]> wrote:
>
> The conclusion we get is that it is very time consuming to initialize a
lot
> of fields, and that using variables is even worse, and we were wondering
if
> there is any way to improve that (e.g. loading a lot of fields at once).
Can
> you help us?
OK,
a certain number of points :
1). use a cached version of the engine
the cached version of the engine maintains a cache of the expressions
composing the process instances (the latest used are kept in memory)
so less reads are needed, it also optimizes disk writes, ie access is
buffered and a minimal amount of writes is performed.
There is a cached version of the file persisted engine and also one
for the db persisted engine.
2). use the set-field expression
http://openwferu.rubyforge.org/expressions.html#exp_restore
it can set a certain number of fields in 1 sweep.
3). set the initial fields of the engine via the launch item
a certain number of ways to launch a process :
engine.launch('http://data.example.com/procdefs/definition1.xml')
li = OpenWFE::LaunchItem.new
li.wfdurl = 'http://data.example.com/procdefs/definition1.xml')
li.fields = { 'x' => 0, 'y' => 1 }
engine.launch(li)
In the second example, the fields are passed in 1 sweep, at launch time.
4). if you're already using ruote 0.9.19, you can pass variables at
launch time :
engine.launch('http://data.example.com/procdefs/definition1.xml',
:variables => { 'var0' => 'val0' })
li = OpenWFE::LaunchItem.new
li.wfdurl = 'http://data.example.com/procdefs/definition1.xml')
li.fields = { 'x' => 0, 'y' => 1 }
engine.launch(li, :variables => { 'var0' => 'val0' })
5). you can wrap the field setting in a participant :
engine.register_participant 'initializator' do |workitem|
workitem.fields['f0'] = 'val0'
# ...
end
(you can do a similar thing for the variables, but settings variables
is less performant).
6). live in a web world
pass the references (URIs) to the information, not the information
itself. In an active_record world, it's OK as well to pass the db id
of records.
As always if there are points in the documentation that are difficult
to understand or missing, pointing at them or providing better
formulations would be appreciated. Questions are welcome.
OK, still waiting for your version information.
Best regards,
--
John Mettraux - http://jmettraux.wordpress.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruote (OpenWFEru) users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---