cancel
Showing results for 
Search instead for 
Did you mean: 

Completing a task does not continue process

kaech
Champ in-the-making
Champ in-the-making
Hi,

I am completing a task from a second process engine instance.
Neither calling TaskService.Complete nor calling FormService.submitTaskFormData continues the process.
Completing the task in the Activiti Explorer works.

What am I doing wrong?
9 REPLIES 9

trademak
Star Contributor
Star Contributor
Hi,

From what you explain here it's a bit hard to comment.
Could you add the Java code where you do this, add the bpmn20.xml and explain what you mean with a "second" process engine instance?

Best regards,

kaech
Champ in-the-making
Champ in-the-making
Hi,

unfortunately I am not able to send you the source.

But actually the process is very simple. Just like this:

start -> script1-> usertask1 -> usertask2 -> script2 -> end

The process is deployed using Activiti Explorer.

We implemented a web application (war) that exposes some operations via SOAP, e.g. FormService.submitTaskData, to external clients (.NET, Swing, etc.), so that they can update form properties and interact with the process. This war is deployed on the same Tomcat as Actitiviti itself. That's what I meant with second web application.

Everything works fine except that lwhen usertask2 is completed (via FormService.submitUserTaskData or TaskService.complete called from within our web service) the process does not continue with script2. Going from usertask1 to usertask2 works. When I complete usertask2 from within Activiti Explorer script2 is executed as well.
Very strange.

What is the best way to check the state of the process using Actitviti probe?
Do I probably have to call RuntimeService.signal? to trigger the process to continue?

Any ideas would be very much appreciated.

frederikherema1
Star Contributor
Star Contributor
When completing a task, the next step should be executed automatically (your scripttask2) so no need to signal. In probe, you should have a look at theACT_RU_EXECUTION, which contains current activity for the execution.

Does the thread that triggers the usertask2 complete return, or is it stuck waiting?

kaech
Champ in-the-making
Champ in-the-making
Is is unlikely because the transition from usertask1 to usertask 2 works. Maybe it has to do with the fact that script2 is a groovy script task?

How can I find out whether the thread is stuck?

What I see in ACT_RU_EXECUTION is this:

ID_ 6516
PROC_INST_ID_ 6516
BUSINESS_KEY_ null
PARENT_ID_ null
PROC_DEF_ID_ myprocess:4524
SUPER_EXEC_ null
ACT_ID_ script2
IS_ACTIVE_ true
IS_CONCURRENT_ false
IS_SCOPE_ true

To me that looks quite normal. But the process is not continued.

trademak
Star Contributor
Star Contributor
Hi,

Did you look at the Tomcat log file to look if you see any error messages?

Best regards,

kaech
Champ in-the-making
Champ in-the-making
I checked the Tomcat log.

When I complete the usertask2 using Activiti Explorer it shows:

FINE: — starting CompleteTaskCmd ——————————————————–
May 16, 2011 1:58:58 PM org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior performOutgoingBehavior
FINE: Leaving activity 'usertask2'
May 16, 2011 1:58:58 PM org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake execute
FINE: ProcessInstance[6727] takes transition (usertask2)–flow5–>(script2)
May 16, 2011 1:58:58 PM org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute execute
FINE: ProcessInstance[6727] executes Activity(script2): org.activiti.engine.impl.bpmn.behavior.ScriptTaskActivityBehavior
May 16, 2011 1:58:58 PM org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior performOutgoingBehavior
FINE: Leaving activity 'script2'
May 16, 2011 1:58:58 PM org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake execute
FINE: ProcessInstance[6727] takes transition (script2)–flow1–>(end)
May 16, 2011 1:58:58 PM org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute execute
FINE: ProcessInstance[6727] executes Activity(end): org.activiti.engine.impl.bpmn.behavior.NoneEndEventActivityBehavior
May 16, 2011 1:58:58 PM org.activiti.engine.impl.runtime.ExecutionEntity destroy
FINE: destroying ProcessInstance[6727]

When I complete the usertask2 using the Web Service call of our custom web app it shows:

FINE: — starting CompleteTaskCmd ——————————————————–
May 16, 2011 1:15:57 PM org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior performOutgoingBehavior
FINE: Leaving activity 'usertask2'
May 16, 2011 1:15:57 PM org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake execute
FINE: ProcessInstance[6710] takes transition (usertask2)–flow5–>(script2)
May 16, 2011 1:15:57 PM org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute execute
FINE: ProcessInstance[6710] executes Activity(script2): org.activiti.engine.impl.bpmn.behavior.ScriptTaskActivityBehavior
May 16, 2011 1:15:59 PM org.activiti.engine.impl.jobexecutor.JobAcquisitionThread run
FINE: job acquisition thread woke up
May 16, 2011 1:15:59 PM org.activiti.engine.impl.interceptor.LogInterceptor execute
FINE:                                                                                                    
May 16, 2011 1:15:59 PM org.activiti.engine.impl.interceptor.LogInterceptor execute

It doesn't seem to leave script2.
When I change the flow so that after usertask2 the process continues with the task end, everything works fine and the process instance disappears from ACT_RU_EXECUTION.

The script task simply writes a log message to the console via groovy outSmiley Tonguerint.

Any ideas?

kaech
Champ in-the-making
Champ in-the-making
I am still looking for a solution.
Help would be appreciated.

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
it's kind of hard for us to help you if you cannot show what you do. Making a minimal testcase that demonstrates the problem is what you should at least do. Besides that, you assume things like 'it is unlikely the thread is stuck since the transistion from usertask 1 to 2 is taken…' but if it does not return AFTER that, it still is kind of stuck. Maybe you should set the log level to finest to see more details… or….

frederikherema1
Star Contributor
Star Contributor
Indeed, a small test-case reproducing this problem would help alot…