On Wed, Apr 21, 2010 at 4:58 AM, Karsten <[email protected]> wrote:
>
> Subject : How scalable is the Storage Participant ?

It depends on the storage implementation.


> While my play-around-rails-application is evolving fields in the
> workitem begin to increase.
> Now I want to filter all workitems in the SP according to their
> fields. My question is now: How scalable is the SP.query method? Is it
> a good idea to use it with a lange amount of workitems in the SP?

Hello Karsten,

the storage participant and the query method are very naive, they are made for 
generic scenarii like "get me all the workitems for the participant name" or 
"all the workitems for that wfid" or "that workitem with this fei".

I don't know your exact needs, but it's easy to write test benches with lots of 
workitems to try.

Maybe you will come up with a specialized version of query.


> Or should I try to do some workitem <-> ActiveRecord mapping ?

Nothing prevents you from using a specialized/extended version of 
StorageParticipant. The ruote-dm one is not bad.

The composite storage lets you mix storage implementations :

  http://ruote.rubyforge.org/configuration.html#composite_storage

But you could totally do something like :

  engine.register_participant :alpha, KarstenParticipant

and store via active record, in a special way, with the indexes the way you 
want. As long as your reply to the consume(workitem) and the cancel(fei, 
flavour) methods (and you known how to reply to the engine when the work is 
done).


> And here's another questions concerning workitems and workflows: Am I
> right with the assumption that there is supposed to be one workitem
> per workflow (which may double if there is a concurrence expresseion
> in the workflow) and the wfid returned from the engine launched is the
> same as the workitem's fei?

Yes, you are right.


> Last but not least:  Is there any way to get information about the
> subprocess the workitem is currently in?

Maybe some filtering could help :

---8<---
require 'rubygems'
require 'ruote'

engine = Ruote::Engine.new(Ruote::Worker.new(Ruote::HashStorage.new()))

sp = engine.register_participant '.+', Ruote::StorageParticipant

pdef = Ruote.process_definition :name => 'test' do
  sequence do
    sub0
  end
  define 'sub0' do
    alpha
  end
end

wfid = engine.launch(pdef)

engine.wait_for(:alpha)

ps = engine.process(wfid)

ps.expressions.each do |exp|
  print exp.fei.sub_wfid ? ' * ' : ' . '
  puts exp.fei.to_storage_id
end
--->8---

It lists the expressions that have a non-nil sub_wfid in their fei.

If you have a more difficult subprocess case to deal with, I'll be glad to help 
you.


Best regards,

-- 
John Mettraux   -   http://jmettraux.wordpress.com

-- 
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en

Reply via email to