Hi John,

Thanks for your prompt reply.


On Mar 10, 7:08 pm, John Mettraux <[email protected]> wrote:
> On Fri, Mar 11, 2011 at 09:51:45AM +0900, John Mettraux wrote:
> > 2011/3/11 Iuri G. <[email protected]>:
>
> > > #<NoMethodError: You have a nil object when you didn't expect it!
> > > You might have expected an instance of ActiveRecord::Base.
> > > The error occurred while evaluating nil.[]>
>
> > ActiveRecord::Base...
>
> > I need the backtrace as well.
>

Unfortunately there is no backtrace... Only thing that I get in
console/development logs is the error message that I posted. I did
little more searching and what happens is that when trying complete
participant (engine.reply(workitem)) it goes once into the reply
method an it calls itself again (return reply(workitem) if r != nil in
storage_participant.rb) and it fails (when failing it calls cancel
method on the participant) and I get a process in undefined state with
1 participant out and 0 in storage.

> Hello Iuri,
>
> how does this
>
>  https://gist.github.com/865288
>
> ---8<---
> require 'rubygems'
> require 'yajl'
> require 'ruote'
>
> #require 'ruote/storage/fs_storage'
> #engine = 
> Ruote::Engine.new(Ruote::Worker.new(Ruote::FsStorage.new('iuri_work')))
>
> require 'logger'
> require 'ruote/sequel/storage'
> s = Sequel.connect('mysql://root:root@localhost/ruote_test')
> #logger = Logger.new($stdout)
> #logger.level = Logger::DEBUG
> #s.loggers << logger
> Ruote::Sequel.create_table(s, true)
> engine = Ruote::Engine.new(Ruote::Worker.new(Ruote::Sequel::Storage.new(s)))
>
> pdef = Ruote.process_definition :on_error => "error_handler", :revision => 
> "0.1", :name => "Ethics Violation" do
>
>   define "error_handler" do
>     set :_model => "Error"
>     participant "[email protected]", :task => "process ${wfid}
> has gone ballistic"
>   end
>
>   sequence do
>     set :field => "_form_name", :value => "Ethical Violation Project"
>     participant :name => "Review potential Ethics Violation", :task =>
> "Review potential Ethics Violation", :ref => "${f:_gatekeeper_email}"
>     participant :task => "Create Project", :ref => "create_project" # HERE
>     set :field => "_form_name", :value => "Next Action"
>     participant :name => "Begin documentation collection", :task =>
> "Schedule first action", :ref => "${f:_gatekeeper_email}"
>   end
> end
>
> class TraceParticipant
>   include Ruote::LocalParticipant
>   def consume(workitem)
>     p [ workitem.participant_name ]
>     reply_to_engine(workitem)
>   end
> end
>
> engine.register do
>   catchall TraceParticipant
> end
>
> engine.noisy = true
>
> wfid = engine.launch(
>   pdef,
>   '_gatekeeper_email' => '[email protected]')
>
> engine.wait_for(wfid)
> --->8---
>
> work for you ? (it works for me)
>
> How does it work for you if you add a "require 'activerecord'" something on 
> top ?
>
> Best regards,
>
> --
> John Mettraux -http://jmettraux.wordpress.com

I noticed you are using reply_to_engine(workitem) instead of
reply(workitem)...  Using reply_to_engine(workitem) in my code with
ruote-sequel results in bugs. I was wondering what are the differences
between those to methods? when should one use reply instead of
reply_to_engine?

Best Regards,
Iuri

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