virta v0.1.2 Virta.Executor

Provides methods to interact with the workflow.

Link to this section Summary

Functions

When a workflow uses Virta.Core.Out component, i.e, the workflow returns output from the execution to the process which invoked it, call needs to be used

When a workflow doesn’t use Virta.Core.Out component, i.e, the workflow doesn’t return any data to the process which invoked it, cast needs to be used

Link to this section Functions

Link to this function call(name, data)

When a workflow uses Virta.Core.Out component, i.e, the workflow returns output from the execution to the process which invoked it, call needs to be used.

name is the name with which the workflow is registered.

The data should be a Map with the keys as the %Virta.Node{} and values as a list of messages with the format { request_id, port, value } for the respective node. Example:

data = %{
  %Node{ module: Virta.Core.In, id: 0 } => [
    { 1, :augend, 10 }, { 1, :addend, 20 }
  ]
}
Link to this function cast(name, data)

When a workflow doesn’t use Virta.Core.Out component, i.e, the workflow doesn’t return any data to the process which invoked it, cast needs to be used.

name is the name with which the workflow is registered.

The data should be a Map with the keys as the %Virta.Node{} and values as a list of messages with the format { request_id, port, value } for the respective node. Example:

data = %{
  %Node{ module: Virta.Core.In, id: 0 } => [
    { 1, :augend, 10 }, { 1, :addend, 20 }
  ]
}