Class WorkflowTool
java.lang.Object
com.logicaldoc.workflow.automation.WorkflowTool
Utility methods to handle workflows from Velocity
- Since:
- 7.3
- Author:
- Marco Meschieri - LogicalDOC
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAdds a new noteAdds a new notevoidappendDocument(org.activiti.engine.task.Task task, long docId, String username) Appends a document to the given workflowvoidclaim(org.activiti.engine.task.Task task, com.logicaldoc.core.security.user.User user) voidClaims the given task for a defined userclaimUrl(org.activiti.engine.task.Task task, com.logicaldoc.core.security.user.User assignee) voidCompletes the given task using a specific transitionvoidCompletes the given task using a specific transitioncompleteUrl(org.activiti.engine.task.Task task, String transition, com.logicaldoc.core.security.user.User assignee) completeUrl(org.activiti.engine.task.Task task, String transition, String username) voiddeleteInstance(String processInstanceId) Deletes a given workflow process instancegetHistories(String processId, WorkflowEvent event) Retrieve the list of events of the current workflowgetHistories(String processId, String event) getLastHistory(String processId, WorkflowEvent event) Retrieve the last history of a given typegetLastHistory(String processId, String event) Gets the notes of the given workfloworg.activiti.engine.task.TaskList<org.activiti.engine.task.Task> getTasksByName(String processInstanceId, String taskName) Retrieves the tasks in a given instance that match the name expressioncom.logicaldoc.core.security.user.UsergetVariable(String processInstanceId, String name) Gets the value of a variable of the specified workflow instancegetVariables(String processInstanceId) Gets the variables of the specified workflow instancevoidremoveDocument(org.activiti.engine.task.Task task, long docId, String username) Removes a document to the given workflowvoidsetVariable(String processInstanceId, String name, Object value) Sets the value of a variable of the specified workflow instancestartWorkflow(String workflowName, long docId, String username) startWorkflow(String workflowName, String tag, long docId, String username) startWorkflow(String workflowName, String tag, String color, Collection<Long> docIds, String username) startWorkflow(String workflowName, String tag, Collection<Long> docIds, String username) voidstopInstance(String processInstanceId) Stops a given workflow process instance
- 
Constructor Details- 
WorkflowToolpublic WorkflowTool()
 
- 
- 
Method Details- 
completeCompletes the given task using a specific transition- Parameters:
- task- the task to complete
- transition- name of the transition to take
 
- 
completeCompletes the given task using a specific transition- Parameters:
- task- the task to complete
- transition- name of the transition to take
- username- user under which name the action is taken
 
- 
getVariablesGets the variables of the specified workflow instance- Parameters:
- processInstanceId- identifier of the current workflow instance
- Returns:
- the map(name/value) of the variables
 
- 
setVariableSets the value of a variable of the specified workflow instance- Parameters:
- processInstanceId- identifier of the workflow instance
- name- name of the variable
- value- value of the variable
 
- 
getVariableGets the value of a variable of the specified workflow instance- Parameters:
- processInstanceId- identifier of the workflow instance
- name- name of the variable
- Returns:
- value value of the variable
 
- 
appendDocumentpublic void appendDocument(org.activiti.engine.task.Task task, long docId, String username) throws com.logicaldoc.gui.common.client.ServerException, com.logicaldoc.core.PersistenceException Appends a document to the given workflow- Parameters:
- task- the task
- docId- identifier of the document to append
- username- the user in whose name the method is run (it can be null)
- Throws:
- com.logicaldoc.gui.common.client.ServerException- a generic error
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
removeDocumentpublic void removeDocument(org.activiti.engine.task.Task task, long docId, String username) throws com.logicaldoc.gui.common.client.ServerException, com.logicaldoc.core.PersistenceException Removes a document to the given workflow- Parameters:
- task- the task
- docId- identifier of the document to remove
- username- the user in whose name the method is run (it can be null)
- Throws:
- com.logicaldoc.gui.common.client.ServerException- a generic error
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
getHistories
- 
getHistoriesRetrieve the list of events of the current workflow- Parameters:
- processId- identifier of the current process
- event- optional filter on the type of event
- Returns:
- list of histories
 
- 
getNotesGets the notes of the given workflow- Parameters:
- processId- identifier of the current process
- Returns:
- list of notes
 
- 
getLastHistoryRetrieve the last history of a given type- Parameters:
- processId- identifier of the current process
- event- optional name of the event
- Returns:
- the found event
 
- 
getLastHistory
- 
claimpublic void claim(org.activiti.engine.task.Task task, String username) throws com.logicaldoc.core.PersistenceException Claims the given task for a defined user- Parameters:
- task- the task
- username- username of the claimer
- Throws:
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
claimpublic void claim(org.activiti.engine.task.Task task, com.logicaldoc.core.security.user.User user) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
- 
addNotepublic WorkflowHistory addNote(org.activiti.engine.task.Task task, String note) throws com.logicaldoc.core.PersistenceException Adds a new note- Parameters:
- task- the task
- note- text of the note to add
- Returns:
- the event produced by the note
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the data layer
 
- 
addNotepublic WorkflowHistory addNote(String processId, String taskName, String note) throws com.logicaldoc.core.PersistenceException Adds a new note- Parameters:
- processId- identifier of the current process
- taskName- name of the task
- note- text of the note to add
- Returns:
- the event generated by the note
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the data layer
 
- 
completeUrlpublic String completeUrl(org.activiti.engine.task.Task task, String transition, com.logicaldoc.core.security.user.User assignee) throws UnsupportedEncodingException - Throws:
- UnsupportedEncodingException
 
- 
completeUrlpublic String completeUrl(org.activiti.engine.task.Task task, String transition, String username) throws UnsupportedEncodingException - Throws:
- UnsupportedEncodingException
 
- 
claimUrlpublic String claimUrl(org.activiti.engine.task.Task task, com.logicaldoc.core.security.user.User assignee) throws UnsupportedEncodingException - Throws:
- UnsupportedEncodingException
 
- 
claimUrlpublic String claimUrl(org.activiti.engine.task.Task task, String assignee) throws UnsupportedEncodingException - Throws:
- UnsupportedEncodingException
 
- 
startWorkflowpublic String startWorkflow(String workflowName, long docId, String username) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
- 
startWorkflowpublic String startWorkflow(String workflowName, String tag, long docId, String username) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
- 
startWorkflowpublic String startWorkflow(String workflowName, String tag, Collection<Long> docIds, String username) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
- 
startWorkflowpublic String startWorkflow(String workflowName, String tag, String color, Collection<Long> docIds, String username) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
- 
getUser
- 
deleteInstanceDeletes a given workflow process instance- Parameters:
- processInstanceId- identifier of the instance to delete
 
- 
stopInstanceStops a given workflow process instance- Parameters:
- processInstanceId- identifier of the instance to stop
 
- 
getTask
- 
getTasksByNamepublic List<org.activiti.engine.task.Task> getTasksByName(String processInstanceId, String taskName) Retrieves the tasks in a given instance that match the name expression- Parameters:
- processInstanceId- ID of the Process Instance
- taskName- The task name, it may be a like expression
- Returns:
- the Tasks that match the name criteria
 
 
-