Package com.logicaldoc.workflow
Class WorkflowUtil
- java.lang.Object
-
- com.logicaldoc.workflow.WorkflowUtil
-
public class WorkflowUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description WorkflowUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static WorkflowHistory
addNote(String sid, String taskName, String taskId, String processId, String note, com.logicaldoc.core.security.User user)
static WorkflowHistory
addNote(String sid, org.activiti.engine.task.Task task, String note, com.logicaldoc.core.security.User user)
static void
appendDocument(String taskId, long docId)
static void
appendDocuments(String taskId, Long[] docIds, WorkflowHistory transaction)
static void
claim(String sid, String taskId, com.logicaldoc.core.security.User user, WorkflowHistory transaction)
static void
complete(String sid, String taskId, String transitionName, com.logicaldoc.core.security.User user)
static void
complete(String sid, org.activiti.engine.task.Task task, String transitionName, com.logicaldoc.core.security.User user)
static Set<Long>
deserializeDocIds(String str)
static List<String>
deserializeSupervisors(String supervisor)
static com.logicaldoc.core.document.Document
getAttachedDocument(String processInstanceId)
Returns one of the attached documents in the given WF instancestatic com.logicaldoc.core.security.User
getInitiator(String processInstanceId, org.activiti.engine.delegate.DelegateTask delegate)
Retrieves the user that initiated the workflow(if any)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)
Prepares a dictionary to be passed to the scripting enginestatic void
reassign(String sid, String taskId, com.logicaldoc.core.security.User user)
static void
removeDocument(String taskId, long docId)
static void
removeDocument(String taskId, long docId, WorkflowHistory transaction)
static void
sendNotifications(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 String
serializeActorIds(Collection<String> ids)
static String
serializeDocIds(Collection<Long> ids)
static String
serializeDocIdsForDisplay(Collection<Long> ids)
static String
startWorkflow(String workflowName, String workflowDescription, String tag, Set<Long> docIds, com.logicaldoc.core.security.Session session, com.logicaldoc.core.security.User user)
static void
unclaim(String taskId)
-
-
-
Method Detail
-
getAttachedDocument
public static com.logicaldoc.core.document.Document getAttachedDocument(String processInstanceId)
Returns one of the attached documents in the given WF instance- Parameters:
processInstanceId
- identifier of the process instance- Returns:
- the document
-
serializeDocIds
public static String serializeDocIds(Collection<Long> ids)
-
serializeDocIdsForDisplay
public static String serializeDocIdsForDisplay(Collection<Long> ids)
-
serializeActorIds
public static String serializeActorIds(Collection<String> ids)
-
addNote
public static WorkflowHistory addNote(String sid, String taskName, String taskId, String processId, String note, com.logicaldoc.core.security.User user) throws com.logicaldoc.gui.common.client.ServerException
- Throws:
com.logicaldoc.gui.common.client.ServerException
-
addNote
public static WorkflowHistory addNote(String sid, org.activiti.engine.task.Task task, String note, com.logicaldoc.core.security.User user) throws com.logicaldoc.gui.common.client.ServerException
- Throws:
com.logicaldoc.gui.common.client.ServerException
-
complete
public static void complete(String sid, org.activiti.engine.task.Task task, String transitionName, com.logicaldoc.core.security.User user) throws com.logicaldoc.gui.common.client.ServerException
- Throws:
com.logicaldoc.gui.common.client.ServerException
-
complete
public static void complete(String sid, String taskId, String transitionName, com.logicaldoc.core.security.User user) throws com.logicaldoc.gui.common.client.ServerException
- Throws:
com.logicaldoc.gui.common.client.ServerException
-
claim
public static void claim(String sid, String taskId, com.logicaldoc.core.security.User user, WorkflowHistory transaction)
-
reassign
public static void reassign(String sid, String taskId, com.logicaldoc.core.security.User user)
-
getInitiator
public static com.logicaldoc.core.security.User getInitiator(String processInstanceId, org.activiti.engine.delegate.DelegateTask delegate)
Retrieves the user that initiated the workflow(if any)- Parameters:
processInstanceId
- identifier of the process instancedelegate
- the task- Returns:
- the user
-
prepareDictionary
public 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)
Prepares a dictionary to be passed to the scripting engine- Parameters:
delegate
- delegate of the tasktask
- the tasktaskName
- name of the taskcandidates
- List of unique user namesprocessInstanceId
- identifier of the process instanceprocessDefinitionId
- identifier of the workflow definitionkeys
- map of parameter to be added to the dictionary- Returns:
- map key - value
-
sendNotifications
public static void sendNotifications(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 node- Parameters:
actors
- Names of the actorsemailTemplate
- The email template to usetaskName
- Name of the current nodetask
- Current taskprocessInstanceId
- The identifier of the current process instanceprocessDefinitionId
- The identifier of the current process definitionkeys
- Dictionary to use, it could be null
-
unclaim
public static void unclaim(String taskId) throws com.logicaldoc.gui.common.client.ServerException
- Throws:
com.logicaldoc.gui.common.client.ServerException
-
appendDocument
public static void appendDocument(String taskId, long docId) throws com.logicaldoc.gui.common.client.ServerException
- Throws:
com.logicaldoc.gui.common.client.ServerException
-
appendDocuments
public static void appendDocuments(String taskId, Long[] docIds, WorkflowHistory transaction) throws com.logicaldoc.gui.common.client.ServerException
- Throws:
com.logicaldoc.gui.common.client.ServerException
-
removeDocument
public static void removeDocument(String taskId, long docId) throws com.logicaldoc.gui.common.client.ServerException
- Throws:
com.logicaldoc.gui.common.client.ServerException
-
removeDocument
public static void removeDocument(String taskId, long docId, WorkflowHistory transaction) throws com.logicaldoc.gui.common.client.ServerException
- Throws:
com.logicaldoc.gui.common.client.ServerException
-
-