e2ebridge / bpmn

BPMN 2.0 execution engine
466 stars 138 forks source link

Processes getting stuck in converging parallel gateway #17

Open lindleycb opened 9 years ago

lindleycb commented 9 years ago

Hi,

Not sure why, but I'm having processes getting stuck at converging parallel gateways. Is this a known problem? Is there anything can be done about it? I've attached the process diagram. The orders seem to get stuck occasionally in "Order Built" and "Doors Built". I've tried a few things to work around it thinking it might be to do with the combination of exclusive gateways and parallel ones (ideally I want an inclusive gateway - is that anywhere near available?) e.g. I inserted a "Doors Start" activity which just calls done and "Track Cut" etc. to join the exclusive gateways (I couldn't get exclusive gateways to join any other way).

Please help! I was SO pleased when I found a Javascript BPMN engine but I'm now getting ready to give up and just go back to using Activiti via REST!

bpmnorder

lindleycb commented 9 years ago

P.S. Ignore the batch process - this is not being used.

lindleycb commented 9 years ago

Some further investigation on this. It seems this may linked to the persistency - see attached screenshot - when I query the state from within JS (black terminal), I get 3 tokens (Pick Order, Order Built, Order Built) i.e. the 2 queued parallel gateway tokens and the one awaiting a user task. When I look in the database (Robomongo), there is only the userTask token. Is this intentional? I think this means if the service is restarted (as it does often when developing with Meteor) the state is reloaded but the parallel gateway can never be passed. I think this may be the key to the problem. Is there a reason for it? And if not is it easy to fix?

screen shot 2015-07-30 at 16 57 00

lindleycb commented 9 years ago

NOTE: I think this and https://github.com/e2ebridge/bpmn/issues/16 are related.

cyrilschmitt commented 9 years ago

Hello lindleycb,

Thank you for using our bpmn module and for reporting bugs.

For the inclusive gateways we are not planning that yet.

I will investigate more on this issue, it effectively seems that it is not persisted when arriving converging parallel gateways.

lindleycb commented 9 years ago

That's great and thanks for making this software available - if I can get it to work for me it will be a real find!

A bit of further information from my struggles yesterday: I found that orders sent through which passed the test "Doors To Cut" and "Track To Cut" but not "Items To Pick" got through without getting stuck, but orders that passed all 3 tests got stuck in what was "Build Doors" and is now "Doors Start" (even though "Doors Start" just has a done() in it). Not sure if this is related but it does seem to be reproducable.

cyrilschmitt commented 9 years ago

I fixed the persistency issue. The process is now persisted when arriving to a converging parallel gateway if it is not the last path to arrive. It should solve at least some of your issues.

Please try by getting the module form github and let me now before I publish a new version.

lindleycb commented 9 years ago

I'm afraid I'm still seeing the same problem - but it's possible that meteor is refetching the tagged version from github rather than using my patched version as I also don't see the console.logs I put in there either - hence the delay in getting back to you. I've tried a few things but I'm not sure how I can prevent this. Would it be possible to include this fix in a tagged version so that I can test it?

I just tried attaching the BPMN diagram in case it helps but github refused it. Let me know if you want me to send it via other means. Thank you so much for looking into this so promptly.

lindleycb commented 9 years ago

Just tried to fake a 0.2.1 in my ~/.npm but meteor insists on going to the npm registry for the official version I'm afraid so I think my recent tests have neither proved nor disproved your fix - sorry I think making it official might be the only way.

cyrilschmitt commented 9 years ago

I published a new version.

lindleycb commented 9 years ago

That's great and seems to have fixed something - but either the problem has moved or it's highlighting the other problem. I'm running a bulk order through that should only need "picking" i.e. as you can see from the screenshot the property "doorsToCut" (on which the decision is made) is false - but, on passing through "Schedule Order" I somehow now end up stuck in "Doors Cut" whose handler (with just a log and a done()) never seems to get called). You can see from the log on the right that the one in "Track_Cut" logs perfectly but "Doors_Cut" shows a "begin" but no log. Bizarre? I hope this is something as straight-forward as the persisting.

screen shot 2015-07-31 at 10 32 05

cyrilschmitt commented 9 years ago

I don't understand why it doesn't work. Could I see the full code of bpmnOrder.js? are you sur you don't override the exports.Doors_Cut somewhere after?

I also don't understand how the done can be undefined in Track_Cut as it seems to be regarding the logs.

lindleycb commented 9 years ago

Hi Cyril, I think "done" seeming to be undefined is a "red herring" - the debug call is trying to JSON.stringify it and, as it's a function, that just prints "undefined" you can see this if you type the following in to the console:

var f = function(x,y) {}; console.log( "f="+JSON.stringify(f));

More concerning is that it never logs at all from Doors_Cut implying it never calls this handler. It's possible I have something wrong in the bpmn or the js but it was flowing through OK this before the patch. I've uploaded the bpmn and js files here: http://expirebox.com/download/9787264f1e3c14141e40956096de1196.html http://expirebox.com/download/04810d30e1824d79c3dbd87932fd1fe6.html

It shouldn't be too hard to get remove unnecessary meteor and ZUUK stuff if you want to take it for a spin. Many thanks for looking into this.

cyrilschmitt commented 9 years ago

I found the issue, new version is published

lindleycb commented 9 years ago

Genius! That's cracked it. Thank you so much for all your help.

wiltshirek commented 9 years ago

hi, is this still an issue for you? You have to call self.taskDone('taskName',data); in your Q.success. Once the process leaves that task it will not return.

hope this helps. its the best I can do without seeing some sample code.

On Thu, Jul 30, 2015 at 10:54 AM, Chris Lindley notifications@github.com wrote:

Hi,

Not sure why, but I'm having processes getting stuck at converging parallel gateways. Is this a known problem? Is there anything can be done about it? I've attached the process diagram. The orders seem to get stuck occasionally in "Order Built" and "Doors Built". I've tried a few things to work around it thinking it might be to do with the combination of exclusive gateways and parallel ones (ideally I want an inclusive gateway - is that anywhere near available?) e.g. I inserted a "Doors Start" activity which just calls done and "Track Cut" etc. to join the exclusive gateways (I couldn't get exclusive gateways to join any other way).

Please help! I was SO pleased when I found a Javascript BPMN engine but I'm now getting ready to give up and just go back to using Activiti via REST!

[image: bpmnorder] https://cloud.githubusercontent.com/assets/5908831/8986108/8361164c-36d2-11e5-9dd9-d81326bad0df.png

— Reply to this email directly or view it on GitHub https://github.com/e2ebridge/bpmn/issues/17.

Ken Wiltshire* |* Computer Applications Developer 5715 Ave N | Brooklyn, NY 11234

Direct (347) 675-5213

wiltshirek commented 9 years ago

oh, sorry for the late response. I see you got it handled.

best.

On Fri, Jul 31, 2015 at 3:40 PM, Ken Wiltshire wiltshirek@gmail.com wrote:

hi, is this still an issue for you? You have to call self.taskDone('taskName',data); in your Q.success. Once the process leaves that task it will not return.

hope this helps. its the best I can do without seeing some sample code.

On Thu, Jul 30, 2015 at 10:54 AM, Chris Lindley notifications@github.com wrote:

Hi,

Not sure why, but I'm having processes getting stuck at converging parallel gateways. Is this a known problem? Is there anything can be done about it? I've attached the process diagram. The orders seem to get stuck occasionally in "Order Built" and "Doors Built". I've tried a few things to work around it thinking it might be to do with the combination of exclusive gateways and parallel ones (ideally I want an inclusive gateway - is that anywhere near available?) e.g. I inserted a "Doors Start" activity which just calls done and "Track Cut" etc. to join the exclusive gateways (I couldn't get exclusive gateways to join any other way).

Please help! I was SO pleased when I found a Javascript BPMN engine but I'm now getting ready to give up and just go back to using Activiti via REST!

[image: bpmnorder] https://cloud.githubusercontent.com/assets/5908831/8986108/8361164c-36d2-11e5-9dd9-d81326bad0df.png

— Reply to this email directly or view it on GitHub https://github.com/e2ebridge/bpmn/issues/17.

Ken Wiltshire* |* Computer Applications Developer 5715 Ave N | Brooklyn, NY 11234

Direct (347) 675-5213

Ken Wiltshire* |* Computer Applications Developer 5715 Ave N | Brooklyn, NY 11234

Direct (347) 675-5213

joaoap commented 7 years ago

Hello, I'm having the same problem here, my process gets stuck inside a parallel gateway. Anyone has the solution for this?

Best Regards