passthroughFn returns a Function with one Int arg "a" and one Int return "ret" where ret = a (passthrough). InitialState is idle so Function.Call evaluates only the OutputAssignments — no actions required.
()
| 23 | // where ret = a (passthrough). The entry transition targets StateIdle so |
| 24 | // Function.Call evaluates only the OutputAssignments — no executable nodes required. |
| 25 | func passthroughFn() *engine.Function { |
| 26 | return &engine.Function{ |
| 27 | Info: workflowapi.FunctionInfo{ |
| 28 | Id: "fn1", |
| 29 | Name: "passthrough", |
| 30 | Arguments: []workflowapi.Variable{ |
| 31 | {Uid: "a", Name: "a", DataType: workflowapi.Int}, |
| 32 | }, |
| 33 | Returns: []workflowapi.Variable{ |
| 34 | {Uid: "ret", Name: "value", DataType: workflowapi.Int}, |
| 35 | }, |
| 36 | }, |
| 37 | EntryTransition: engine.Transition{TargetID: engine.StateIdle}, |
| 38 | Executables: map[string]engine.Executable{}, |
| 39 | OutputAssignments: map[string]workflowapi.Expression{ |
| 40 | "ret": { |
| 41 | Expression: "${}", |
| 42 | DataType: workflowapi.Int, |
| 43 | References: []workflowapi.Reference{{SrcId: engine.SrcFnArg, VarId: "a"}}, |
| 44 | }, |
| 45 | }, |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | func TestNewFunctionCall(t *testing.T) { |
| 50 | t.Run("missing input binding errors", func(t *testing.T) { |
no outgoing calls
no test coverage detected