Need help with task flow

Hello i have this king of model. i was wondering what do i do to make whenever i press a button on angular it would complete a task. i have 2 different buttons and they go different directions. i might have more so boolean wont work. I also am using Java api not Rest.

I do start the process:

ProcessInstance pi = runtimeService.startProcessInstanceByKey(PbsBpmConsts.MAIN_PROCESS_NAME, processParams);
tc.setProcessInstanceId(pi.getProcessInstanceId());

and i complete it with:
tasksService.completeTask(taskId);

The complete is called whenever i press the button. however my process does not go further. My qeustion how can i accomplish that and what should i do? Thanks in Advance!

Can you explain what exactly happens when you complete the task? is there an error?

Hi. Im not at work anymore. However it doesnt start new UserTask. It completes the first task and that is it. I would love to know how do i make it go further?

Well if you complete the first task, it will be waiting at one of the following tasks.

Ok i found the problem :slight_smile: i re-drawed the process altho i did not run the new process so it took the last process i was using :slight_smile: thank you for all your help :slight_smile: