Open bbollard opened 5 years ago
you can pass object graphs to step inputs as opposed to just scalar values
"inputs":
{
"Body": {
"Value1": 1,
"Value2": 2
},
"Headers": {
"Content-Type": "application/json"
}
},
If you want to evaluate an expression for a given property of your object, simply prepend and @ and pass an expression string
"inputs":
{
"Body": {
"@Value1": "data.MyValue * 2",
"Value2": 5
},
"Headers": {
"Content-Type": "application/json"
}
},
Hello,
I tried to pass scalar values to step inputs but met error: "Object of type 'Newtonsoft.Json.Linq.JObject' cannot be converted to type 'ZL.WorflowCoreDemo.InputDictionary.StepPara'."
The json file likes:
{ "Id": "ManualWorkflow", "Version": 1, "DataType": "ZL.WorflowCoreDemo.InputDictionary.ManualWorkflowData,ZL.WorflowCoreDemo", "Steps": [ { "Id": "EnterName1", "StepType": "ZL.WorflowCoreDemo.InputDictionary.ManualInput,ZL.WorflowCoreDemo", "NextStepId": "EnterName2", "inputs": { "stepPara": { "ParaValue": 1 } } }, { "Id": "EnterName2", "StepType": "ZL.WorflowCoreDemo.InputDictionary.ManualInput,ZL.WorflowCoreDemo"
}
] }
The class StepPara: namespace ZL.WorflowCoreDemo.InputDictionary { public class StepPara { public int ParaValue { get; set; } } }
Did I miss something?
I am building workflows using JSON definitions and would like to define my workflow data object in a loosely coupled manner like so:
And would like to be able to access both objects within JSON workflow definitions, such as:
Any suggestions would be appreciated. The alternative, of course, would be to create a more formally defined data object as most of the samples demonstrate.
Thank you, Brian