Thanks for the prompt response.
It is because, from overall process perspective (where P1 and P2 can be thought as children processes), It is the same user-task -
in P1 its created and in P2 it is performed -
and the task’s life-cycle has to be tracked (so I suppose doing it by task id is natural). Does it make sense?
Because, that is our use case. The two activities (creating of task and performance of task) to be tracked as part of two processes.
There is a custom controller that spins out different processes (1 followed by 2) at different time.
A user task gets created as part of the process 1.
The same task should be performed as part of the process 2.
Is it achievable / advisable through help of standalone task with the pattern above?
There is not much I could find. Thanks for the help in advance.
In the UserTask Task 2.2 → TaskListener → Complete Event → Delegate Expression → Provide implementation to correlate the message with name “completeTask”.
In the messageSender listener provide the implementation like this:
delegateTask.getExecution().getProcessEngineServices().getRuntimeServices()
.createMessageCorrelation("completeTask")
.processInstanceBusinessKey("someOrderId")
.setVariable("CANCEL_REASON", "someReason")
.setVariable("CANCEL_TIMESTAMP", new Date())
.correlate();
In the ReceiveTask 1.2 → Message Name → configure the message name as “completeTask”.
Thanks Aarvind. I am interested to know if one can do it using standalone task as well?
With standalone user-task, one can have user-defined task id.
However, it does not look like the same is possible when a user-task is not standalone and defined in a process definition. (You can set task-id in the properties panel, but that will be registered as task name in the db instead.)
@andypr Are you refering standalone user task as manual task?
If yes, you can have that in the process but engine doesn’t provide any life cycle or execution of such task types. It’s used in the BPMN process for just representation purpose and engine will pass through that activity always.
The example below shows the process of Cart Inspection. The tasks about sign-off are both manual task that are performed without the aid of any process execution engine or software systems.
The two are different. Standalone User task (which I recently learned about.) does not require one to start a process shell ( and hence no corresponding process definition and instance id). A user-action can create a standalone user-task through rest/java (taskService.newTask()) api. and it will appear in task-list, will have its life-cycle.
Here you can define the id as well. Not sure if the same can be done when it is part of a process.