use of com.graphaware.nlp.dsl.result.WorkflowTaskResult in project neo4j-nlp by graphaware.
the class WorkflowTaskProcedure method start.
@Procedure(name = "ga.nlp.workflow.task.start", mode = Mode.WRITE)
@Description("Start a Task")
public Stream<WorkflowTaskResult> start(@Name(value = "name") String name) {
try {
WorkflowTask workflowTask = getWorkflowManager().getWorkflowTask(name);
if (workflowTask == null) {
throw new RuntimeException("Pipeline task not found");
}
TaskManager.getInstance().execute(workflowTask);
return Stream.of(new WorkflowTaskResult(workflowTask));
} catch (Exception e) {
LOG.error("ERROR in WorkflowTaskProcedure", e);
throw new RuntimeException(e);
}
}
Aggregations