cancel
Showing results for 
Search instead for 
Did you mean: 

Timeouts on servicetask

stroobat
Champ in-the-making
Champ in-the-making
I'm using a servicetask to call some bussiness logic (using Spring beans).

Suppose that for some reason or another the Java code hangs (doesn't respond anymore, no exception is thrown). Can I handle this in the Activiti flow ?
I tried it using a bounderyEvent with a timer but doesn't seem to work because the commit of the timer is done after the flow finishes (correct ?).

I suppose the best way to handle this is to handle it in the bussiness function itself, but I was just wondering if it could be done in Activiti ?

I tested this as follows. I started a 5 second timer just before my servicetask is executed, and in my servicetask I put a Thread.Sleep(10000).
My opion was that the timer got fired before the sleep finishes, but doesn't seem to happen.

Best regards,

Tom.
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
Tom,

You are right, the boundry timer-event won't be fired since it never ends up in the DB for the jobexecutor to pick up. So putting a timer on a non-waitstate in activiti is quite useless.
You could work around this using some subprocess and waitstate-magic I guess, but seems best to handle this in your service-code.

Once asyncronous continuations are available in activiti, the boundry timer would work, if the service-task is execute asynchronously (timer will be comitted). But currently no concrete timing on that, so I'd stick with the Java-solution.