Hello,

I am a beginner with ruote.

I use "ruote-on-rails" as starting point, and a derived my on class 
"MyParticipant" from "Storgage particpant".

When I check the workitem received by the "accept?" methode, these workitem 
is empty. When I check the workitem in the "on_workitem" method, the 
workitem is not empty.
Is it normal ? 

Thanks you for your help.

See some code below.

Best regards

Laurent

//////////// Code ///////////

lass MyParticipant < Ruote::StorageParticipant
  
   def on_workitem(workitem)
     workitem.fields['time'] = Time.now
     puts "I do my job !"
     puts "workitem : #{workitem.fields}\n\n"
     #  reply
     # the consume method doesn’t reply to the engine, at all. 
     # The reply occurs later, in the #reply class method. 
     # If a cancel order comes, the workitem stored on disk has to be 
removed.
   end

   def on_cancel(fei, flavour)
     # nothing to do
   end
   
   #def on_reply(workitem)
   
   def accept?(workitem)
     puts "I accept !"
     puts "workitem : #{workitem.fields}\n\n"
     true
   end
   
  # def self.reply(workitem_h)
  #     FileUtils.rm("worklist/workitem_#{workitem_h['fei']}.yaml")
  #     reply_to_engine(workitem)
  # end
   
end

/// my first definition of process (the one in ruote-on-rails) is start by 
hand in the web interface

/////////////// Console Output //////////////////

   0  define "my first definition"
    0_0    sequence
  0_0_0      alice
  0_0_1      bob
8 57:06.880 20:     ap * 20120807-1057-mimimeka-kawomezo 15dc5 0_0 wi: 
[0_0!15dc5...!, 0], t: [sequence, {}, [[alice, {}, []], [bob, {}, []]]], 
pi: 0!d2549...!
I accept !
workitem : {}

///////////////////////// why {} ? /////////////////////////////

9 57:06.892 20:       ap * 20120807-1057-mimimeka-kawomezo ff727 0_0_0 wi: 
[0_0_0!ff727...!, 1], t: [participant, {ref: alice}, []], pi: 0_0!15dc5...!
I do my job !
workitem : {"params"=>{"ref"=>"alice"}, "dispatched_at"=>"2012-08-07 
10:57:06.896858 UTC", "time"=>2012-08-07 12:57:06 +0200}

0 57:06.898 20:       di * 20120807-1057-mimimeka-kawomezo ff727 0_0_0 
alice wi: [0_0_0!ff727...!, 3], part: [MyParticipant, {ici: 3}]
1 57:06.903 20:       dd * 20120807-1057-mimimeka-kawomezo ff727 0_0_0 
participant_name: alice, wi: [0_0_0!ff727...!, 3]



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