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.

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

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