接口 IWorkflowService


  • public interface IWorkflowService
    • 方法详细资料

      • getWorkflow

        ExecutingWorkflow getWorkflow​(String workflowId,
                                      boolean includeTasks)
        Retrieve a workflow by workflow id
        参数:
        workflowId - the id of the workflow
        includeTasks - 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 workflow
        correlationId - the correlation id
        includeClosed - specify if all workflows are to be returned or only running workflows
        includeTasks - 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 deleted
        archiveWorkflow - 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 workflow
        version - 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 workflow
        version - the version of the workflow definition. Defaults to 1.
        startTime - the start time of the period
        endTime - 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 instance
        taskReferenceName - 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 workflow
        workflowRerunRequest - 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 restarted
        useLatestDefinitions - 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 terminated
        reason - 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 terminated
        reason - 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 workflows
        includeTasks - 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 workflow
        variables - 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