Package com.vdoc.sdk.commons.utils
Class WorkflowInstanceUtils
java.lang.Object
com.vdoc.sdk.commons.utils.WorkflowInstanceUtils
A VDoc tool class for
IWorkflowInstance.- Since:
- 1.9
- Author:
- famaridon
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumthis enum contains how to build past actors set when step is delegated. -
Method Summary
Modifier and TypeMethodDescriptionstatic IWorkflowInstancecreateLinkedWorkflowInstance(IContext context, IWorkflowInstance parentWorkflowInstance, IWorkflowContainer workflowContainer, String fieldName) Create a linked workflowinstance for a workflowinstance and save it in a fieldstatic voidendTaskInstance(IWorkflowModule workflowModule, IWorkflowInstance workflowInstance, String actionName, IUser actor, String comment) end the currentITaskInstance.static voidendTaskInstanceWithFirstOperator(IWorkflowModule workflowModule, IWorkflowInstance workflowInstance, String actionName) same asendTaskInstanceWithFirstOperator(IWorkflowModule, IWorkflowInstance, String, String)without commentstatic voidendTaskInstanceWithFirstOperator(IWorkflowModule workflowModule, IWorkflowInstance workflowInstance, String actionName, String comment) with actor = null and comment = "WorkflowHelper.endTaskInstance"static voidendTaskInstanceWithUser(IWorkflowModule workflowModule, IWorkflowInstance workflowInstance, String actionName, IUser actor) static voidendTaskInstanceWithUser(IWorkflowModule workflowModule, IWorkflowInstance workflowInstance, String actionName, IUser actor, String comment) getAllPastActors(IWorkflowInstance workflowInstance) getAllPastActors(IWorkflowInstance workflowInstance, WorkflowInstanceUtils.DelegationMode delegationMode) static IWorkflowInstancegetWorkflowInstance(IWorkflowModule workflowModule, IResource resource) getWorkflowInstance
-
Method Details
-
getAllPastActors
callgetAllPastActors(IWorkflowInstance, DelegationMode)with the defaultWorkflowInstanceUtils.DelegationMode(WorkflowInstanceUtils.DelegationMode.ADDRESSEE_AND_FULFILLER)- Parameters:
workflowInstance- theIWorkflowInstancewhose you want get all past actors- Returns:
- a
Setwith all past actors
-
getAllPastActors
public static Set<IUser> getAllPastActors(IWorkflowInstance workflowInstance, WorkflowInstanceUtils.DelegationMode delegationMode) - Parameters:
workflowInstance- workflowInstance theIWorkflowInstancewhose you want get all past actorsdelegationMode- the method used to build the outputSetwhen aIResourceHistory.IEvent's fulfiller is not the addressee- Returns:
- a
Setwith all past actors
-
createLinkedWorkflowInstance
public static IWorkflowInstance createLinkedWorkflowInstance(IContext context, IWorkflowInstance parentWorkflowInstance, IWorkflowContainer workflowContainer, String fieldName) throws WorkflowModuleException Create a linked workflowinstance for a workflowinstance and save it in a field- Parameters:
context- context for creator of the linked workflowinstanceparentWorkflowInstance- the workflowinstance parentworkflowContainer- the workflowContainer of the linked workflowinstancefieldName- the field of the parent- Returns:
- IWorkflowInstance
- Throws:
WorkflowModuleException- Workflow Module Exception
-
endTaskInstance
public static void endTaskInstance(IWorkflowModule workflowModule, IWorkflowInstance workflowInstance, String actionName, IUser actor, String comment) throws WorkflowModuleException end the currentITaskInstance.- Parameters:
workflowModule- an initIWorkflowModuleworkflowInstance- theIWorkflowInstanceto end currentITaskInstanceactionName- the action system nameactor-IUserwill be used to end task. (nullable : if null the first operator is used)comment- the history comment. (nullable : if null empty string is used)- Throws:
WorkflowModuleException- Workflow Module ExceptionIllegalArgumentException- if theIWorkflowInstancehave not started task instance or is in parallelism state
-
endTaskInstanceWithUser
public static void endTaskInstanceWithUser(IWorkflowModule workflowModule, IWorkflowInstance workflowInstance, String actionName, IUser actor, String comment) throws WorkflowModuleException same asendTaskInstance(com.axemble.vdoc.sdk.modules.IWorkflowModule, com.axemble.vdoc.sdk.interfaces.IWorkflowInstance, java.lang.String, com.axemble.vdoc.sdk.interfaces.IUser, java.lang.String)but actor is mandatory.- Parameters:
workflowModule- an initIWorkflowModuleworkflowInstance- theIWorkflowInstanceto end currentITaskInstanceactionName- the action system nameactor-IUserwill be used to end task.comment- the history comment. (nullable : if null empty string is used)- Throws:
WorkflowModuleException- Workflow Module Exception
-
endTaskInstanceWithUser
public static void endTaskInstanceWithUser(IWorkflowModule workflowModule, IWorkflowInstance workflowInstance, String actionName, IUser actor) throws WorkflowModuleException same asendTaskInstanceWithUser(com.axemble.vdoc.sdk.modules.IWorkflowModule, com.axemble.vdoc.sdk.interfaces.IWorkflowInstance, java.lang.String, com.axemble.vdoc.sdk.interfaces.IUser, java.lang.String)with no comment.- Parameters:
workflowModule- an initIWorkflowModuleworkflowInstance- theIWorkflowInstanceto end currentITaskInstanceactionName- the action system nameactor-IUserwill be used to end task.- Throws:
WorkflowModuleException- Workflow Module Exception
-
endTaskInstanceWithFirstOperator
public static void endTaskInstanceWithFirstOperator(IWorkflowModule workflowModule, IWorkflowInstance workflowInstance, String actionName) throws WorkflowModuleException same asendTaskInstanceWithFirstOperator(IWorkflowModule, IWorkflowInstance, String, String)without comment- Parameters:
workflowModule- an initIWorkflowModuleworkflowInstance- theIWorkflowInstanceto end currentITaskInstanceactionName- the action system name- Throws:
WorkflowModuleException- Workflow Module ExceptionIllegalArgumentException- if theIWorkflowInstancehave not started task instance or is in parallelism state
-
endTaskInstanceWithFirstOperator
public static void endTaskInstanceWithFirstOperator(IWorkflowModule workflowModule, IWorkflowInstance workflowInstance, String actionName, String comment) throws WorkflowModuleException with actor = null and comment = "WorkflowHelper.endTaskInstance"- Parameters:
workflowModule- an initIWorkflowModuleworkflowInstance- theIWorkflowInstanceto end currentITaskInstanceactionName- the action system namecomment- the history comment. (nullable : if null empty string is used)- Throws:
WorkflowModuleException- Workflow Module ExceptionIllegalArgumentException- if theIWorkflowInstancehave not started task instance or is in parallelism state
-
getWorkflowInstance
public static IWorkflowInstance getWorkflowInstance(IWorkflowModule workflowModule, IResource resource) getWorkflowInstance- Parameters:
workflowModule- IWorkflowModuleresource- IResource- Returns:
- IWorkflowInstance
-