Participants list

32 views
Skip to first unread message

Amedeo

unread,
Jul 3, 2012, 6:11:01 AM7/3/12
to openwfe...@googlegroups.com
Hello,

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?

Thanks 

John Mettraux

unread,
Jul 3, 2012, 10:39:25 AM7/3/12
to openwfe...@googlegroups.com
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

Amedeo

unread,
Jul 3, 2012, 11:04:18 AM7/3/12
to openwfe...@googlegroups.com
Perfect! Thanks John ;-)


On Tuesday, July 3, 2012 4:39:25 PM UTC+2, John Mettraux wrote:

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?


Reply all
Reply to author
Forward
0 new messages