workflow-core icon indicating copy to clipboard operation
workflow-core copied to clipboard

How to use inputs and outputs in json?I got an error!

Open Jerryzxr opened this issue 5 years ago • 5 comments

When i define my workflows in JSON,vs warns me ‘No property or field 'XXX' exists in type 'Object'’. Why can't I find this field? How to get the value in output? Please help me, thank you!

Jerryzxr avatar Dec 11 '20 02:12 Jerryzxr

Can you provide your JSON ?

oicevar1 avatar Dec 11 '20 07:12 oicevar1

Can you provide your JSON ?

{ "Id": "HelloWorld", "Version": 1, "Steps": [ { "Id": "HelloWorld", "StepType": "WorkflowCoreTest.Steps.HelloWorld, WorkflowCoreTest", "NextStepId": "GoodbyeWorld", "Inputs": { "BMI": "data.BMI" }, "Outputs": { "Messages": "step.Messages" } }, { "Id": "GoodbyeWorld", "StepType": "WorkflowCoreTest.Steps.GoodbyeWorld, WorkflowCoreTest", } ] }

Jerryzxr avatar Dec 11 '20 08:12 Jerryzxr

You haven't set the DataType of your workflow - https://workflow-core.readthedocs.io/en/latest/json-yaml/

danielgerlag avatar Dec 12 '20 17:12 danielgerlag

You haven't set the DataType of your workflow - https://workflow-core.readthedocs.io/en/latest/json-yaml/

Sorry,i have one another question. How to spell my if condition? Just like"<<if(data=>data.XXX==‘’)>>"or"<<if(data.XXX==‘’)>>"?

{ "Id": "MyIfStep", "StepType": "WorkflowCore.Primitives.If, WorkflowCore", "NextStepId": "...", "Inputs": { "Condition": "<>" }, "Do": [[ { "Id": "do1", "StepType": "MyApp.DoSomething1, MyApp", "NextStepId": "do2" }, { "Id": "do2", "StepType": "MyApp.DoSomething2, MyApp" } ]] }

Jerryzxr avatar Dec 16 '20 08:12 Jerryzxr

Here is the docs for the expression language - https://github.com/zzzprojects/System.Linq.Dynamic.Core/wiki/Dynamic-Expressions#expression-language

danielgerlag avatar Dec 19 '20 15:12 danielgerlag