接口 IWorkflowService
-
public interface IWorkflowService
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
deleteWorkflow(String workflowId, boolean archiveWorkflow)
Removes a workflow from the systemList<String>
getRunningWorkflow(String workflowName, Integer version)
Retrieve all running workflow instances for a given name and versionExecutingWorkflow
getWorkflow(String workflowId, boolean includeTasks)
Retrieve a workflow by workflow idList<ExecutingWorkflow>
getWorkflows(String name, String correlationId, boolean includeClosed, boolean includeTasks)
Retrieve all workflows for a given correlation id and nameMap<String,List<ExecutingWorkflow>>
getWorkflowsByNamesAndCorrelationIds(Boolean includeClosed, Boolean includeTasks, CorrelationIdsSearchRequest request)
Search workflows based on correlation ids and namesList<String>
getWorkflowsByTimePeriod(String workflowName, int version, Long startTime, Long endTime)
Retrieve all workflow instances for a given workflow name between a specific time periodvoid
pauseWorkflow(String workflowId)
Pause a workflow by workflow idString
rerunWorkflow(String workflowId, WorkflowRerunRequest workflowRerunRequest)
Reruns the workflow from a specific taskvoid
resetWorkflow(String workflowId)
Resets the callback times of all IN PROGRESS tasks to 0 for the given workflowvoid
restart(String workflowId, boolean useLatestDefinitions)
Restart a completed workflowvoid
resumeWorkflow(String workflowId)
Resume a paused workflow by workflow idvoid
retryLastFailedTask(String workflowId)
Retries the last failed task in a workflowvoid
runDecider(String workflowId)
Starts the decision task for the given workflow instancevoid
skipTaskFromWorkflow(String workflowId, String taskReferenceName)
Skips a given task from a current RUNNING workflowString
startWorkflow(StartWorkflowRequest startWorkflowRequest)
Starts a workflow.void
terminateWorkflow(String workflowId, String reason)
Terminates the execution of the given workflow instanceBulkResponseResult
terminateWorkflows(List<String> workflowIds, String reason)
Terminates the execution of all given workflows instancesExecutingWorkflow
updateVariables(String workflowId, Map<String,Object> variables)
Update the workflow by setting variables as given.WorkflowRun
updateWorkflow(WorkflowProgressUpdate body)
Update a runningw workflow by updating its variables or one of the scheduled task identified by task reference name
-
-
-
方法详细资料
-
startWorkflow
String startWorkflow(StartWorkflowRequest startWorkflowRequest) throws ConflictException
Starts a workflow. If the size of the workflow input payload is bigger thanExternalPayloadStorage
, if enabled, else the workflow is rejected.- 参数:
startWorkflowRequest
- theStartWorkflowRequest
object to start the workflow- 返回:
- the id of the workflow instance that can be used for tracking
- 抛出:
ConflictException
-
getWorkflow
ExecutingWorkflow getWorkflow(String workflowId, boolean includeTasks)
Retrieve a workflow by workflow id- 参数:
workflowId
- the id of the workflowincludeTasks
- specify if the tasks in the workflow need to be returned- 返回:
- the requested workflow
-
getWorkflows
List<ExecutingWorkflow> getWorkflows(String name, String correlationId, boolean includeClosed, boolean includeTasks)
Retrieve all workflows for a given correlation id and name- 参数:
name
- the name of the workflowcorrelationId
- the correlation idincludeClosed
- specify if all workflows are to be returned or only running workflowsincludeTasks
- specify if the tasks in the workflow need to be returned- 返回:
- list of workflows for the given correlation id and name
-
deleteWorkflow
void deleteWorkflow(String workflowId, boolean archiveWorkflow)
Removes a workflow from the system- 参数:
workflowId
- the id of the workflow to be deletedarchiveWorkflow
- flag to indicate if the workflow should be archived before deletion
-
getRunningWorkflow
List<String> getRunningWorkflow(String workflowName, Integer version)
Retrieve all running workflow instances for a given name and version- 参数:
workflowName
- the name of the workflowversion
- the version of the wokflow definition. Defaults to 1.- 返回:
- the list of running workflow instances
-
getWorkflowsByTimePeriod
List<String> getWorkflowsByTimePeriod(String workflowName, int version, Long startTime, Long endTime)
Retrieve all workflow instances for a given workflow name between a specific time period- 参数:
workflowName
- the name of the workflowversion
- the version of the workflow definition. Defaults to 1.startTime
- the start time of the periodendTime
- the end time of the period- 返回:
- returns a list of workflows created during the specified during the time period
-
runDecider
void runDecider(String workflowId)
Starts the decision task for the given workflow instance- 参数:
workflowId
- the id of the workflow instance
-
pauseWorkflow
void pauseWorkflow(String workflowId)
Pause a workflow by workflow id- 参数:
workflowId
- the workflow id of the workflow to be paused
-
resumeWorkflow
void resumeWorkflow(String workflowId)
Resume a paused workflow by workflow id- 参数:
workflowId
- the workflow id of the paused workflow
-
skipTaskFromWorkflow
void skipTaskFromWorkflow(String workflowId, String taskReferenceName)
Skips a given task from a current RUNNING workflow- 参数:
workflowId
- the id of the workflow instancetaskReferenceName
- the reference name of the task to be skipped
-
rerunWorkflow
String rerunWorkflow(String workflowId, WorkflowRerunRequest workflowRerunRequest)
Reruns the workflow from a specific task- 参数:
workflowId
- the id of the workflowworkflowRerunRequest
- the request containing the task to rerun from- 返回:
- the id of the workflow
-
restart
void restart(String workflowId, boolean useLatestDefinitions)
Restart a completed workflow- 参数:
workflowId
- the workflow id of the workflow to be restarteduseLatestDefinitions
- if true, use the latest workflow and task definitions when restarting the workflow if false, use the workflow and task definitions embedded in the workflow execution when restarting the workflow
-
retryLastFailedTask
void retryLastFailedTask(String workflowId)
Retries the last failed task in a workflow- 参数:
workflowId
- the workflow id of the workflow with the failed task
-
terminateWorkflow
void terminateWorkflow(String workflowId, String reason)
Terminates the execution of the given workflow instance- 参数:
workflowId
- the id of the workflow to be terminatedreason
- the reason to be logged and displayed
-
terminateWorkflows
BulkResponseResult terminateWorkflows(List<String> workflowIds, String reason)
Terminates the execution of all given workflows instances- 参数:
workflowIds
- the ids of the workflows to be terminatedreason
- the reason to be logged and displayed- 返回:
- the
BulkResponseResult
contains bulkErrorResults and bulkSuccessfulResults
-
getWorkflowsByNamesAndCorrelationIds
Map<String,List<ExecutingWorkflow>> getWorkflowsByNamesAndCorrelationIds(Boolean includeClosed, Boolean includeTasks, CorrelationIdsSearchRequest request)
Search workflows based on correlation ids and names- 参数:
includeClosed
- if set, includes workflows that are terminal. Otherwise, only returns RUNNING workflowsincludeTasks
- if set, returns tasks.- 返回:
- Map with a key as correlation id and value as a list of matching workflow executions
-
updateVariables
ExecutingWorkflow updateVariables(String workflowId, Map<String,Object> variables)
Update the workflow by setting variables as given. This is similar to SET_VARIABLE task except that with this API, the workflow variables can be updated any anytime while the workflow is in RUNNING state. This API is useful for cases where the state of the workflow needs to be updated based on an external trigger, such as terminate a long-running do_while loop with a terminating condition based on the workflow variables.- 参数:
workflowId
- Id of the workflowvariables
- Workflow variables. The variables are merged with existing variables.- 返回:
- Updated state of the workflow
-
updateWorkflow
WorkflowRun updateWorkflow(WorkflowProgressUpdate body)
Update a runningw workflow by updating its variables or one of the scheduled task identified by task reference name
-
resetWorkflow
void resetWorkflow(String workflowId)
Resets the callback times of all IN PROGRESS tasks to 0 for the given workflow- 参数:
workflowId
- the id of the workflow
-
-