ruote log_2010-11-17

2010-11-17 08:43:06 utc jmettraux gonzalo: hello, still trying to access process variables from a participant ?
2010-11-17 08:47:35 utc jmettraux from inside the participant, you can do something like
2010-11-17 08:47:42 utc jmettraux fexp.lookup_variable("x")
2010-11-17 10:03:22 utc gonzalo hi john, I'm trying with Ruote:Engine#process(wfid).variables as suggested by rebo. got to see if it fits my needs :)
2010-11-18 00:12:42 utc hassox hey guys
2010-11-18 00:12:44 utc hassox jmettraux: are you about mate?
2010-11-18 00:13:05 utc jmettraux hassox: good morning, about to get a coffee, I'll be back in 10 minutes
2010-11-18 00:13:10 utc hassox rgr
2010-11-18 00:25:37 utc jmettraux hassox: back
2010-11-18 00:25:43 utc hassox hey mate
2010-11-18 00:25:52 utc hassox how's things?
2010-11-18 00:26:06 utc jmettraux doing fine and you ?
2010-11-18 00:26:31 utc jmettraux coffee in, engine ready
2010-11-18 00:26:52 utc hassox good mate :D
2010-11-18 00:27:02 utc hassox trying to do some testing though and getting stuck again :(
2010-11-18 00:27:09 utc jmettraux ouch
2010-11-18 00:27:19 utc hassox I've fired up an engine (without a worker) using a dm storage backend
2010-11-18 00:27:48 utc hassox but trying to query the engine for the wfid doesn't return anything unless there's a worker presetn
2010-11-18 00:28:14 utc jmettraux sounds normal
2010-11-18 00:28:18 utc jmettraux (so far)
2010-11-18 00:28:41 utc hassox really?
2010-11-18 00:28:51 utc jmettraux yes
2010-11-18 00:28:52 utc hassox I was expecting there to be stuff (there's rows in the db)
2010-11-18 00:29:06 utc jmettraux are those configuration rows ?
2010-11-18 00:29:11 utc hassox why do I need a worker for it to show up
2010-11-18 00:29:23 utc hassox there's a couple of msgs items
2010-11-18 00:29:30 utc hassox and one variables
2010-11-18 00:29:42 utc hassox but I have kicked in a worker
2010-11-18 00:29:44 utc hassox jsut a sec
2010-11-18 00:33:08 utc hassox jmettraux: https://gist.github.com/2eede2f9970fcad12944
2010-11-18 00:33:43 utc hassox but...
2010-11-18 00:33:53 utc jmettraux all good, the msgs are only "informative"
2010-11-18 00:33:54 utc hassox ruby-1.8.7-p299 > RuoteKit.engine.processes
2010-11-18 00:33:55 utc hassox => []
2010-11-18 00:34:12 utc hassox so I need a worker to fire it off?
2010-11-18 00:34:19 utc jmettraux yes, there are no processes running
2010-11-18 00:34:20 utc jmettraux yes
2010-11-18 00:34:25 utc hassox oh right
2010-11-18 00:34:38 utc hassox hrm
2010-11-18 00:34:47 utc jmettraux ah right, the last msg is a "launch" order
2010-11-18 00:35:49 utc jmettraux sorry, I'm in my own jail with this "engine" term
2010-11-18 00:35:54 utc hassox :)
2010-11-18 00:36:03 utc jmettraux I kept it from previous versions of ruote
2010-11-18 00:36:05 utc hassox so, how come that one doesn't show up int he processes list?
2010-11-18 00:36:24 utc jmettraux no "interpretation" occurred yet
2010-11-18 00:37:01 utc jmettraux only workers can "apply" / "interpret" orders to run processes
2010-11-18 00:37:28 utc jmettraux in fact, only workers can consume msgs
2010-11-18 00:37:45 utc jmettraux others can put msgs on the stack, but they don't fetch them
2010-11-18 00:38:04 utc jmettraux this msg : {"_rev":1,"put_at":"2010-11-18 00:35:25.965673 UTC","wfid":"20101118-benoyopubo","variables":{},"workitem":{"fields":{}},"action":"launch","_id":"13668!2148446640!2010-11-18!1290040525.965598!002","type":"msgs","tree":["define",{"name":"market close"},[["concurrence",{},[["sequence",{"name":"pending calculations"},[["echo",{},[]],["force_pending_calculations",{},[]]]]]]]]}
2010-11-18 00:38:44 utc jmettraux has :action => 'launch' and :tree => [ ... ] with an initial workitem":{"fields":{}}
2010-11-18 00:39:43 utc jmettraux it's like saying "could please some worker launch the process whose AST is :tree with an initial context/token of :workitem ?"
2010-11-18 00:40:22 utc jmettraux a worker will come and take that msg and start the process execution, node by node
2010-11-18 00:40:40 utc jmettraux for each node, there will be a child msg emitted
2010-11-18 00:40:51 utc hassox i see
2010-11-18 00:41:09 utc hassox so, I need a worker to actually reply and do all that good stuff
2010-11-18 00:41:17 utc hassox I can't just manually fetch and reply
2010-11-18 00:41:18 utc jmettraux yes
2010-11-18 00:41:21 utc hassox for testing
2010-11-18 00:42:11 utc jmettraux I usually do the testing with engine(worker(storage)) but with a bit of configuration/forking you could do engine(storage) + worker(storage)
2010-11-18 00:42:30 utc hassox ?
2010-11-18 00:42:42 utc hassox what's worker(storage) ?
2010-11-18 00:42:48 utc hassox does that not automaticlaly fetch things?
2010-11-18 00:42:58 utc hassox I mean... do you get to drive that one manually?
2010-11-18 00:43:31 utc jmettraux I usually do all my testing with a worker inside of my front app
2010-11-18 00:43:52 utc jmettraux but with a rails/web front end, it's better to have workers in the back end
2010-11-18 00:44:08 utc jmettraux so the launch orders are coming from the front end, are executed in the back end
2010-11-18 00:44:14 utc hassox yup
2010-11-18 00:44:22 utc hassox bit how to test it
2010-11-18 00:44:27 utc hassox it's still so difficult for me to get the testing
2010-11-18 00:44:39 utc jmettraux I guess it's similar to test rails + resque and co
2010-11-18 00:45:03 utc hassox hrm
2010-11-18 00:45:14 utc hassox would you suggest that for testing _only_ using a catchall
2010-11-18 00:45:25 utc jmettraux well
2010-11-18 00:45:53 utc jmettraux catchall is a different concept from separating workers
2010-11-18 00:46:11 utc hassox right
2010-11-18 00:46:25 utc jmettraux why don't you fork a worker in your before(:all/:each) ?
2010-11-18 00:46:27 utc hassox the idea for me is to have seperate workers and launching in production
2010-11-18 00:46:34 utc jmettraux +1
2010-11-18 00:46:35 utc hassox I want to test the process definition
2010-11-18 00:46:43 utc hassox not have them run
2010-11-18 00:47:10 utc jmettraux ?
2010-11-18 00:47:28 utc jmettraux how can you test a program without running it ?
2010-11-18 00:47:33 utc hassox so, I want to test the process definition
2010-11-18 00:47:47 utc hassox I was hoping to launch it, and then step through it
2010-11-18 00:47:56 utc hassox make sure things are happening correctly
2010-11-18 00:48:07 utc jmettraux ok
2010-11-18 00:48:22 utc jmettraux are you telling me you want to run the process definition with mock participants ?
2010-11-18 00:48:35 utc hassox I guess it boils down to that yeah
2010-11-18 00:49:30 utc jmettraux let me cook up a gist
2010-11-18 00:49:54 utc hassox would it be just changing the participant list to a catchall ?
2010-11-18 00:50:04 utc hassox simliar to this: http://ruote.rubyforge.org/process_testing.html
2010-11-18 00:50:26 utc jmettraux yes
2010-11-18 00:50:33 utc hassox gotcha
2010-11-18 00:50:50 utc hassox ok I'll change my test participant list to catchall