> On Mon, May 17, 2010 at 5:01 PM, eric <[email protected]> wrote:
>
> i just create a subclass of Ruote::StorageParticipant.
> just like:
>
> module TestWoo
> class WooTestParticipant < Ruote::StorageParticipant
> # include Ruote::LocalParticipant
> def consume (workitem)
> puts "1----------------------__>"
> wfid = workitem.h.fei
> puts "2----------------------__>"
> participant = workitem.participant_name
> puts "3----------------------__>"
> # puts "4===>wfid = " + wfid
> # puts "5===>participant = " + participant
> map_participant_user(wfid,participant)
> puts "4----------------------__>"
> reply_to_engine( workitem )
> end
> def map_participant_user(wfid,participant)
> ActiveRecord::Base.connection.insert("insert into
> wfwiparticitant(workitem_id,participant,parrticipant2,workitem_state,extend1)"
> +
> "select
> #{wfid},#{participant},csru.user_id,1,'' from" +
> "cloudsoft_security_role
> csr,cloudsoft_security_roleuser csru" +
> "where csr.role_id =
> csru.role_id ");
> end
> end
> end
Eric,
what about a classical approach where the processes look like
---8<---
Ruote.process_definition do
sequence do
role1
role2
role3
end
end
--->8---
and your Rails views look like
---8<---
class WorkController
def index
@roles = Roles.find_by_user(current_user)
@workitems = @roles.inject([]) do |a, role|
RuoteKit.storage_participant.by_participant(role)
end
end
end
--->8---
?
There are multiple advantages to this approach, for example, you can change the
roles independently from the process definitions and of the already existing
(waiting) workitems...
If you want me to help you, please try to explain what you are trying to do,
else I'm just emitting useless pieces of advice.
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