Class WorkflowTool
- java.lang.Object
-
- com.logicaldoc.workflow.automation.WorkflowTool
-
public class WorkflowTool extends Object
Utility methods to handle workflows from Velocity- Since:
- 7.3
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description WorkflowTool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkflowHistory
addNote(String processId, String taskName, String note)
Adds a new noteWorkflowHistory
addNote(org.activiti.engine.task.Task task, String note)
Adds a new notevoid
appendDocument(org.activiti.engine.task.Task task, long docId)
Appends a document to the given workflowvoid
claim(org.activiti.engine.task.Task task, com.logicaldoc.core.security.User user)
void
claim(org.activiti.engine.task.Task task, String username)
Claims the given task for a defined userString
claimUrl(org.activiti.engine.task.Task task, com.logicaldoc.core.security.User assignee)
String
claimUrl(org.activiti.engine.task.Task task, String assignee)
void
complete(org.activiti.engine.task.Task task, String transition)
Completes the given task using a specific transitionString
completeUrl(org.activiti.engine.task.Task task, String transition, com.logicaldoc.core.security.User assignee)
String
completeUrl(org.activiti.engine.task.Task task, String transition, String username)
List<WorkflowHistory>
getHistories(String processId, String event)
Retrieve the list of events of the current workflowWorkflowHistory
getLastHistory(String processId, String event)
Retrieve the last history of a given typecom.logicaldoc.core.security.User
getUser(String username)
void
removeDocument(org.activiti.engine.task.Task task, long docId)
Removes a document to the given workflowString
startWorkflow(String workflowName, String tag, long docId, String username)
String
startWorkflow(String workflowName, String tag, Collection<Long> docIds, String username)
-
-
-
Method Detail
-
complete
public void complete(org.activiti.engine.task.Task task, String transition)
Completes the given task using a specific transition- Parameters:
task
- the task to completetransition
- name of the transition to take
-
appendDocument
public void appendDocument(org.activiti.engine.task.Task task, long docId)
Appends a document to the given workflow- Parameters:
task
- the taskdocId
- identifier of the document to append
-
removeDocument
public void removeDocument(org.activiti.engine.task.Task task, long docId)
Removes a document to the given workflow- Parameters:
task
- the taskdocId
- identifier of the document to remove
-
getHistories
public List<WorkflowHistory> getHistories(String processId, String event)
Retrieve the list of events of the current workflow- Parameters:
processId
- identifier of the current processevent
- optional filter on the type of event- Returns:
- list of histories
-
getLastHistory
public WorkflowHistory getLastHistory(String processId, String event)
Retrieve the last history of a given type- Parameters:
processId
- identifier of the current processevent
- optional name of the event- Returns:
- the found event
-
claim
public void claim(org.activiti.engine.task.Task task, String username)
Claims the given task for a defined user- Parameters:
task
- the taskusername
- username of the claimer
-
claim
public void claim(org.activiti.engine.task.Task task, com.logicaldoc.core.security.User user)
-
addNote
public WorkflowHistory addNote(org.activiti.engine.task.Task task, String note) throws com.logicaldoc.gui.common.client.ServerException
Adds a new note- Parameters:
task
- the tasknote
- text of the note to add- Returns:
- the event produced by the note
- Throws:
com.logicaldoc.gui.common.client.ServerException
- generic error
-
addNote
public WorkflowHistory addNote(String processId, String taskName, String note) throws com.logicaldoc.gui.common.client.ServerException
Adds a new note- Parameters:
processId
- identifier of the current processtaskName
- name of the tasknote
- text of the note to add- Returns:
- the event generated by the note
- Throws:
com.logicaldoc.gui.common.client.ServerException
- generic error
-
completeUrl
public String completeUrl(org.activiti.engine.task.Task task, String transition, com.logicaldoc.core.security.User assignee) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
completeUrl
public String completeUrl(org.activiti.engine.task.Task task, String transition, String username) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
claimUrl
public String claimUrl(org.activiti.engine.task.Task task, com.logicaldoc.core.security.User assignee) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
claimUrl
public String claimUrl(org.activiti.engine.task.Task task, String assignee) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
startWorkflow
public String startWorkflow(String workflowName, String tag, long docId, String username)
-
startWorkflow
public String startWorkflow(String workflowName, String tag, Collection<Long> docIds, String username)
-
getUser
public com.logicaldoc.core.security.User getUser(String username)
-
-