NewSetVariable builds a SetVariable node.
(id string, variable workflow.Reference, value workflow.Expression)
| 27 | |
| 28 | // NewSetVariable builds a SetVariable node. |
| 29 | func NewSetVariable(id string, variable workflowapi.Reference, value workflowapi.Expression) *SetVariable { |
| 30 | return &SetVariable{ |
| 31 | LinearNode: engine.NewLinearNode(id), |
| 32 | variable: variable, |
| 33 | value: value, |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | func (n *SetVariable) Execute(ctx context.Context, scope *engine.Scope) (string, error) { |
| 38 | val, err := expr.Eval(n.value, scope) |
no outgoing calls