Package com.logicaldoc.workflow
Class WorkflowUtil
java.lang.Object
com.logicaldoc.workflow.WorkflowUtil
- 
Method SummaryModifier and TypeMethodDescriptionstatic WorkflowHistoryaddNote(String sid, String taskId, String transitionName, String note, com.logicaldoc.core.security.user.User user) static WorkflowHistoryaddNote(String sid, String taskName, String taskId, String processId, String transitionName, String note, com.logicaldoc.core.security.user.User user) static WorkflowHistoryaddNote(String sid, org.activiti.engine.task.Task task, String transitionName, String note, com.logicaldoc.core.security.user.User user) static voidappendDocument(String taskId, long docId, String username) Appends a document to a given workflowstatic voidappendDocuments(String taskId, List<Long> docIds, WorkflowHistory transaction) static voidclaim(String sid, String taskId, com.logicaldoc.core.security.user.User user, WorkflowHistory transaction) static voidcomplete(String taskId, String transitionName, WorkflowHistory transaction) static voidcomplete(org.activiti.engine.task.Task task, String transitionName, WorkflowHistory transaction) static voiddeleteInstance(String processInstanceId) Deletes a given workflow process instancedeserializeDocIds(String str) deserializeSupervisors(String supervisor) static com.logicaldoc.core.document.DocumentgetAttachedDocument(String processInstanceId) Returns one of the attached documents in the given WF instancestatic Collection<com.logicaldoc.core.document.Document> getAttachedDocuments(String processInstanceId) Returns the documents attache to the given WF instancestatic com.logicaldoc.core.security.user.UsergetInitiator(String processInstanceId, org.activiti.engine.delegate.DelegateTask delegate) Retrieves the user that initiated the workflow(if any)static org.activiti.engine.task.Taskstatic ObjectgetVariable(String processInstanceId, String name) Gets the value of a variable of the specified workflow instancegetVariables(String processInstanceId) Gets the variables of the specified workflow instancestatic WorkflowDefinitiongetWorkflowDefinition(WorkflowTemplate template) Builds the object model of the workflowprepareDictionary(org.activiti.engine.delegate.DelegateTask delegate, org.activiti.engine.task.Task task, String taskName, List<String> candidates, String processInstanceId, String processDefinitionId, Map<String, Object> keys) Prepares a dictionary to be passed to the scripting enginestatic voidstatic voidremoveDocument(String taskId, long docId, WorkflowHistory transaction) static voidremoveDocument(String taskId, long docId, String username) Removes a document from a given workflowstatic voidsaveHistory(WorkflowHistory transaction) Saves a workflow history into the databasestatic voidsendNotifications(List<String> actors, String emailTemplate, String taskName, String processInstanceId, String processDefinitionId, Map<String, Object> keys, org.activiti.engine.task.Task task) Notifies the actors of a specified workflow nodestatic Stringstatic StringserializeDocIds(Collection<Long> ids) static Stringstatic StringserializeFileNames(Collection<Long> ids) static voidsetVariable(String processInstanceId, String name, Object value) Sets the value of a variable of the specified workflow instancestatic StringstartWorkflow(String workflowName, String workflowDescription, String tag, String color, Set<Long> docIds, com.logicaldoc.core.security.Session session, com.logicaldoc.core.security.user.User user) static voidstopInstance(String processInstanceId) Stops a given workflow process instancestatic void
- 
Method Details- 
getAttachedDocumentReturns one of the attached documents in the given WF instance- Parameters:
- processInstanceId- identifier of the process instance
- Returns:
- the document
 
- 
getAttachedDocumentspublic static Collection<com.logicaldoc.core.document.Document> getAttachedDocuments(String processInstanceId) Returns the documents attache to the given WF instance- Parameters:
- processInstanceId- identifier of the process instance
- Returns:
- the collection of documents
 
- 
deserializeDocIds
- 
serializeFileNames
- 
serializeDocIds
- 
serializeDocIdsForDisplay
- 
serializeActorIds
- 
deserializeSupervisors
- 
addNotepublic static WorkflowHistory addNote(String sid, String taskId, String transitionName, String note, com.logicaldoc.core.security.user.User user) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
- 
addNotepublic static WorkflowHistory addNote(String sid, org.activiti.engine.task.Task task, String transitionName, String note, com.logicaldoc.core.security.user.User user) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
- 
addNotepublic static WorkflowHistory addNote(String sid, String taskName, String taskId, String processId, String transitionName, String note, com.logicaldoc.core.security.user.User user) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
- 
completepublic static void complete(org.activiti.engine.task.Task task, String transitionName, WorkflowHistory transaction) throws WorkflowValidationException - Throws:
- WorkflowValidationException
 
- 
completepublic static void complete(String taskId, String transitionName, WorkflowHistory transaction) throws WorkflowValidationException - Throws:
- WorkflowValidationException
 
- 
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
 
- 
claimpublic static void claim(String sid, String taskId, com.logicaldoc.core.security.user.User user, WorkflowHistory transaction) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
- 
getTask
- 
reassignpublic static void reassign(String sid, String taskId, com.logicaldoc.core.security.user.User user) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
- 
getInitiatorpublic static com.logicaldoc.core.security.user.User getInitiator(String processInstanceId, org.activiti.engine.delegate.DelegateTask delegate) throws com.logicaldoc.core.PersistenceException Retrieves the user that initiated the workflow(if any)- Parameters:
- processInstanceId- identifier of the process instance
- delegate- the task
- Returns:
- the user
- Throws:
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
prepareDictionarypublic static Map<String,Object> prepareDictionary(org.activiti.engine.delegate.DelegateTask delegate, org.activiti.engine.task.Task task, String taskName, List<String> candidates, String processInstanceId, String processDefinitionId, Map<String, Object> keys) throws com.logicaldoc.core.PersistenceExceptionPrepares a dictionary to be passed to the scripting engine- Parameters:
- delegate- delegate of the task
- task- the task
- taskName- name of the task
- candidates- List of unique user names
- processInstanceId- identifier of the process instance
- processDefinitionId- identifier of the workflow definition
- keys- map of parameter to be added to the dictionary
- Returns:
- map key - value
- Throws:
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
sendNotificationspublic static void sendNotifications(List<String> actors, String emailTemplate, String taskName, String processInstanceId, String processDefinitionId, Map<String, Object> keys, org.activiti.engine.task.Task task) throws com.logicaldoc.core.PersistenceExceptionNotifies the actors of a specified workflow node- Parameters:
- actors- Names of the actors
- emailTemplate- The email template to use
- taskName- Name of the current node
- processInstanceId- The identifier of the current process instance
- processDefinitionId- The identifier of the current process definition
- keys- Dictionary to use, it could be null
- task- Current task
- Throws:
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
unclaim
- 
appendDocumentpublic static void appendDocument(String taskId, long docId, String username) throws com.logicaldoc.core.PersistenceException Appends a document to a given workflow- Parameters:
- taskId- identifier of the current task in the workflow
- docId- identifier of the document to append
- username- optional the user in name of which the action must be taken
- Throws:
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
getVariablesGets the variables of the specified workflow instance- Parameters:
- processInstanceId- identifier of the workflow instance
- Returns:
- map of variables name-value
 
- 
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
 
- 
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
 
- 
appendDocumentspublic static void appendDocuments(String taskId, List<Long> docIds, WorkflowHistory transaction) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
- 
removeDocumentpublic static void removeDocument(String taskId, long docId, String username) throws com.logicaldoc.core.PersistenceException Removes a document from a given workflow- Parameters:
- taskId- identifier of the current task in the workflow
- docId- identifier of the document to append
- username- optional user in name of which the action must be taken
- Throws:
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
removeDocumentpublic static void removeDocument(String taskId, long docId, WorkflowHistory transaction) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
- 
startWorkflowpublic static String startWorkflow(String workflowName, String workflowDescription, String tag, String color, Set<Long> docIds, com.logicaldoc.core.security.Session session, com.logicaldoc.core.security.user.User user) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
- 
getWorkflowDefinitionBuilds the object model of the workflow- Parameters:
- template- the templates that stores the XML definition of the workflow
- Returns:
- the workflow object model
 
- 
saveHistorypublic static void saveHistory(WorkflowHistory transaction) throws com.logicaldoc.core.PersistenceException Saves a workflow history into the database- Parameters:
- transaction- the history to save
- Throws:
- com.logicaldoc.core.PersistenceException- error at data layer
 
 
-