cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with finishing process after receiveTask or manualTask

Olrajt
Champ in-the-making
Champ in-the-making

Hello,

I have a problem with finish of the process. 

My current end flow looks like this: 

image

I have two last branches. In the Manual Task I am waiting for execution of both branches. 
In the service class I am waiting for execution and when both variables are filled up, I want to push frocess further, which should be end. My code looks like this: 

public void listen(DelegateExecution delegateExecution, String resultVar1, String resultVar2) {
        Object variable = delegateExecution.getVariable(resultVar1);
        Object variable2 = delegateExecution.getVariable(resultVar2);
        if (variable != null && variable2 != null) {
            runtimeService.trigger(delegateExecution.getId());
        }
    }

Code executes successfuly, but process is not finished, it stays in the state with red arrow into end event

I tried with Manual task, Receive task, but nothing helps. Is there any other option? 
The last idea I have is to put user task, and then complete user task. But this does not look properly, since this is nothing related to user. 

Thank you

1 REPLY 1

abbask01
Star Collaborator
Star Collaborator

You should join your fork using an exclusive gateway. It ensures both of your synchronized service tasks are completed before forwarding to next task (receive task, in your case).

Hope it helps.

Regards,
Abbas
Getting started

Explore our Alfresco products with the links below. Use labels to filter content by product module.