On Tue, Jul 03, 2012 at 03:11:01AM -0700, Amedeo wrote:
>
> We are trying to retrieve the list of all participants involved (or
> potentially involved) in a process. Is there any api or way to retrieve
> this list?

Hello Amedeo,

no, but would something like (https://gist.github.com/3040131) this help?

---8<---
require 'pp'
require 'ruote'

pdef = Ruote.define do
  alice
  concurrence do
    bob
    charly
  end
  participant :ref => 'doug'
end

dboard = Ruote::Dashboard.new(Ruote::HashStorage.new)

dboard.register do
  alice Ruote::NoOpParticipant
  participant /.+/, Ruote::StorageParticipant
end

def find_participants(dboard, tree, accu=[])

  if tree[0] == 'participant'
    accu << [ tree[1]['ref'], dboard.participant(tree[1]['ref']).class ]
  elsif exp_class = dboard.context.expmap.expression_class(tree[0])
    # do nothing
  elsif pa = dboard.participant(tree[0])
    accu << [ tree[0], pa.class ]
  end

  tree[2].each do |t|
    find_participants(dboard, t, accu)
  end

  accu
end

pp find_participants(dboard, pdef)
--->8---


Best regards,

--
John Mettraux - http://lambda.io/jmettraux

-- 
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