Or more precisely - is there a way to remove a participant from subsequent iterations if it was "deleted" at the first iteration?
What I mean...
For example, there is a some parallel workflow. I choose 10
participants and initiated this business process. Thus, 10
tasks were created, one for each participant. But then I decided to delete a few participants.
As far as I know, I can't remove the task. But I can to complete these tasks by using WebScript. For example, as follows. I know the workflowId
and taskId
:
...
Map<String, String> templateArgs = req.getServiceMatch().getTemplateVars();
// String workflowId = templateArgs.get("workflowId");
String taskId = templateArgs.get("taskId");
Map<QName, Serializable> updatedProperties = new HashMap<>();
updatedProperties.put(TaskRemoverModel.REVIEW_OUTCOME_PROPERTY, "Approve");
updatedProperties.put(TaskRemoverModel.COMMENT_PROPERTY,
"The user was excluded from the list of participants.");
workflowService.updateTask(taskId, updatedProperties, null, null);
workflowService.endTask(taskId, null);
...
But the problem is that at the stage of revise, the initiator can send for approval again. Then tasks for excluded participants will be created again.
Is there a way to "mark" these participants, so that no tasks were created for them in the future?
I would be very grateful for the information. Thanks to all.