Hi John, Kenneth, and all.

It's been a while since I've been around these parts. Glad to see
Ruote is alive and doing so well.

I've got a single worker using MongDbStorage and a catch_all, Storage
Participant, running behind ruote-kit. I've got a small, sample test
app running separately, which runs a very basic workflow. It accepts a
post, initiates the workflow with ruote-kit, and immediately asks
ruote-kit for any resultant workitems before redirecting according to
the workitem payload. It follows the same model when proceeding to
subsequent steps (a call to ruote-kit to proceed, followed immediately
by a workitem query). Mostly it works as expected, but sometimes the
query for resultant workitems either yields no results (when starting
a workflow), or yields a workitem denoting the previous step (when
proceeding). If I then query for workitems again then the expected one
appears. This leads me to believe that somewhere something is
happening asynchronously, and I'm querying before the process has
completed. I've looked into the code for ruote and ruote-kit (briefly,
I admit) and can't find anywhere that this is happening. As far as I
understand the local participant does not thread, and anyway I am
passing the do_not_thread_participants option, and the storage
participant should also not be returning before completing, right? I
know there's possibility that it's Mongo, but I am not running any
replication sets, just a single node, so the eventually-consistent
data store shouldn't be a problem.

I have no idea why this is happening. Any help would be greatly
appreciated. I hope I've explained the problem okay.

I hope you're well, John, and I know Kenneth is.

Thanks.

Specifics below.

-Nic


-----Ruote-Kit config-----

engine = RuoteKit.engine = Ruote::Engine.new(
  Ruote::Worker.new(
    Ruote::MongoDbStorage.new( :connection => { "host" => "localhost",
                                                "port" => 27017,
                                                "database" =>
"RuoteKit22Seven"}
    )
  )
)

# I have also tried passing this into the MongoDbStorage initialiser,
but to no avail, and anyway it's the default so shouldn't be
necessary.
engine.configure('do_not_thread_participants', true)


RuoteKit.engine.register do
  catchall
end



---Workflow---

Ruote.process_definition :name => 'envelopes intro' do
  participant 'show_tutorial', Ruote::StorageParticipant
  participant 'view_unlocked_page', Ruote::StorageParticipant
end



---Stripped-down Ruote-Kit interaction----

post('/processes', :body => {:definition => **as_above**, :fields =>
{"customer_id" : "xxxxxx"})
workitem = JSON.parse(get('/workitems.json', "customer_id" =>
"xxxxxx").body)["workitems"].first  # and here I sometime get the old
one or none at all.

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