Complete step on a Workflow programmatically
I have a workflow and I would like to complete steps without any action of the user. That means istead of going inside each document to click on the finish button, I would prefer to implement one common button relating to a list of documents, which complete the same step for each document of the list.
Is that possible and how can I achieve that task?
You can use the following method from DocumentRoutingService:
/** * Ends a task * * @param session * @param task * @param data * @param status name of the button clicked to submit the task form * * @since 5.6, was on RoutingTaskService before */ void endTask(CoreSession session, Task task, Map<String, Object> data, String status) throws ClientException;
- the name of the button is the id of the button you configured on the Tab Form on the Studio side when configuring your task node.
- data is a hashMap containg all the nodes and workflow variables