0
votes

As first, I'm new to camunda.. I've created a custom tasklist in camunda. I can claim / unclaim tasks etc and this is working.

Right now I'd like to complete a certain task, but when I'm calling:

public void completeSelectedTask() {
    taskService.complete(selectedTask.getId());
}

it seems as if camunda wants to go to the next step in THIS context, instead of the context where the BPMN schema has been deployed and where everything is deployed needed to perform the next step. So I'm getting "classNotFound" exceptions since I'm not having the same classes in my customTasklist.war as in the camundaProcessor.war..

How could I tell camunda to go to the next step in the correct context?! Or am I handeling this wrong and should I always complete the task in the camundaProccessor context?

Some more information: It's to complete a userTask, with a form. I currently added to form to customTasklist.war and not camundaProcessor.war (so the out of the box tasklist isn't working anymore ofcourse since he's looking for the form in the camundaProcessor.war)

1

1 Answers

0
votes

For explanation, I assume there is a context A and context B. These could for example be cluster nodes that run process engines against the same database. We assume, you complete the task in context A, but the resources to process the next task (e.g. a JavaDelegate implementation of a service task) are only available in context B.

Both ways to resolve the problem that you sketch are valid. Either, you make sure the task is completed in context B. Or you make sure that process execution continues in context B after you have completed the task in context A.

To implement the second solution, you can use asynchronous continuations. In particular, on the userTask element in the BPMN XML you can set the attribute camunda:asyncAfter="true". When the task is completed in context A, process execution continues until the activity instance of the user task has been completed. Instead of continuing execution at follow-up activities immediately, the process engine persists a job in the database. The job represents the task to continue process execution. It is eventually picked up and executed by the job executor component. Assuming that the job executor runs in context B, it will be able to resolve the resources correctly.