Package io.toro.martini
Class WorkflowMethods
- java.lang.Object
-
- io.toro.martini.WorkflowMethods
-
public final class WorkflowMethods extends Object
-
-
Constructor Summary
Constructors Constructor Description WorkflowMethods(Supplier<com.torocloud.workflow.WorkflowLoader> defaultWorkflowLoader, com.torocloud.workflow.InvocableChainFactory invocableChainFactory, com.torocloud.workflow.WorkflowEventManager workflowEventManager)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GloopModel
invokeWorkflow(String workflowName)
Execute a Workflow service belonging to a certain package.static GloopModel
invokeWorkflow(String workflowName, GloopModel input)
Execute a Workflow service belonging to a certain package.static GloopModel
invokeWorkflow(String workflowName, Map<String,Object> input)
Execute a Workflow service belonging to a certain package.static List<com.torocloud.workflow.PostEventWorkflow>
sendEvent(com.torocloud.workflow.WorkflowEvent workflowEvent)
Send event to all running workflow.static com.torocloud.workflow.PostEventWorkflow
sendEvent(com.torocloud.workflow.WorkflowEvent workflowEvent, String contextId)
Sent event to a specific workflow by contextId
-
-
-
Constructor Detail
-
WorkflowMethods
public WorkflowMethods(Supplier<com.torocloud.workflow.WorkflowLoader> defaultWorkflowLoader, com.torocloud.workflow.InvocableChainFactory invocableChainFactory, com.torocloud.workflow.WorkflowEventManager workflowEventManager)
-
-
Method Detail
-
invokeWorkflow
public static GloopModel invokeWorkflow(@GloopParameter(allowNull=false) String workflowName, GloopModel input)
Execute a Workflow service belonging to a certain package.- Parameters:
workflowName
- The name of the Workflow file (with or without the file extension) to execute. If nested within a directory, parent directories must be prefixed while using . as a separator (e.g path.to.WorkflowService.input
- gloop model containing the inputs for the Workflow service- Returns:
- the GloopModel of the Context
- See Also:
invokeWorkflow(String, GloopModel)
-
invokeWorkflow
public static GloopModel invokeWorkflow(@GloopParameter(allowNull=false) String workflowName, Map<String,Object> input)
Execute a Workflow service belonging to a certain package.- Parameters:
workflowName
- The name of the Workflow file (with or without the file extension) to execute. If nested within a directory, parent directories must be prefixed while using . as a separator (e.g path.to.WorkflowService.input
- map containing the inputs for the Workflow service- Returns:
- the GloopModel of the Context
- See Also:
invokeWorkflow(String, Map)
-
invokeWorkflow
public static GloopModel invokeWorkflow(@GloopParameter(allowNull=false) String workflowName)
Execute a Workflow service belonging to a certain package.- Parameters:
workflowName
- The name of the Workflow file (with or without the file extension) to execute. If nested within a directory, parent directories must be prefixed while using . as a separator (e.g path.to.WorkflowService.- Returns:
- the GloopModel of the Context
- See Also:
invokeWorkflow(String)
-
sendEvent
public static List<com.torocloud.workflow.PostEventWorkflow> sendEvent(com.torocloud.workflow.WorkflowEvent workflowEvent)
Send event to all running workflow.- Parameters:
workflowEvent
- The name of the event to send.- Returns:
- the list of post event process result of each workflow
-
sendEvent
public static com.torocloud.workflow.PostEventWorkflow sendEvent(com.torocloud.workflow.WorkflowEvent workflowEvent, String contextId)
Sent event to a specific workflow by contextId- Parameters:
workflowEvent
- The name of the event to send.contextId
- The contextId of the workflow where the event will be sent.- Returns:
- the post event process result of the workflow
-
-