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
>
> i want to get the wfid and participant.but it doesn't work?
Hello Eric,
what about something like :
---8<---
module TestWoo
class TestParticipant < Ruote::StorageParticipant
def consume (workitem)
workitem.fields['user'] = Csru.find_by_role(workitem.participant_name)
super.consume(workitem)
end
end
end
--->8---
So that the field 'user' is filled with a value extracted from your Crsu model
before the workitem gets placed in the storage.
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