Complete step on a Workflow programmatically

Hi,

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?

Thanks

Charles

0 votes

1 answers

1856 views

ANSWER



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;

where

  • 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
0 votes