public interface WorkflowManager extends Closeable
WorkflowManagerBuilder
Modifier and Type | Method and Description |
---|---|
boolean |
cancelRun(RunId runId)
Attempt to cancel the given run.
|
WorkflowAdmin |
getAdmin()
Return administration operations
|
Optional<TaskExecutionResult> |
getTaskExecutionResult(RunId runId,
TaskId taskId)
Return the result for a given task of a given run
|
WorkflowListenerManager |
newWorkflowListenerManager()
Allocate a new WorkflowListenerManager
|
void |
start()
The manager must be started before use.
|
RunId |
submitSubTask(RunId runId,
RunId parentRunId,
Task task)
Same as
submitTask(Task) except that, when completed, the parent run will
be notified. |
RunId |
submitSubTask(RunId parentRunId,
Task task)
Same as
submitTask(Task) except that, when completed, the parent run will
be notified. |
RunId |
submitTask(RunId runId,
Task task)
Submit a task for execution.
|
RunId |
submitTask(Task task)
Submit a task for execution.
|
void |
updateTaskProgress(RunId runId,
TaskId taskId,
int progress)
Update task progress info.
|
void start()
The manager must be started before use. Call Closeable.close()
when done
with the manager. Every instance that starts a manager using
the same WorkflowManagerBuilder.withCurator(CuratorFramework, String, String)
namespace
and version
will participate in the workflow.
One instance will be nominated as the scheduler and will be responsible for starting tasks and advancing the workflow.
Task executors will be started based on the values in the WorkflowManagerBuilder
.
Each WorkflowManager can declare a different combination of task executors
as needed.
RunId submitTask(Task task)
task
- task to executeRunId submitTask(RunId runId, Task task)
runId
- the RunId to use - MUST BE GLOBALLY UNIQUEtask
- task to executeRunId submitSubTask(RunId parentRunId, Task task)
submitTask(Task)
except that, when completed, the parent run will
be notified. This method is meant to be used inside of TaskExecutor
for a task
that needs to initiate a sub-run and have the parent run wait for the sub-run to complete.parentRunId
- run id of the parent runtask
- task to executeRunId submitSubTask(RunId runId, RunId parentRunId, Task task)
submitTask(Task)
except that, when completed, the parent run will
be notified. This method is meant to be used inside of TaskExecutor
for a task
that needs to initiate a sub-run and have the parent run wait for the sub-run to complete.runId
- the RunId to use - MUST BE GLOBALLY UNIQUEparentRunId
- run id of the parent runtask
- task to executevoid updateTaskProgress(RunId runId, TaskId taskId, int progress)
TaskExecutor
for a running task to update its execution progress(0-100).runId
- run id of the tasktaskId
- the taskprogress
- progress to be setboolean cancelRun(RunId runId)
runId
- the run to cancelOptional<TaskExecutionResult> getTaskExecutionResult(RunId runId, TaskId taskId)
runId
- the runtaskId
- the taskWorkflowAdmin getAdmin()
WorkflowListenerManager newWorkflowListenerManager()
Copyright © 2014–2018 Nirmata. All rights reserved.