Loading workflow definitions from JSON #1150
Replies: 1 comment
-
I was missing this piece of code. It is now resolved.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am trying to trigger the workflow using JSON Input. But it is not triggering the workflow or steps mentioned.
Please help if I am missing something.
This is the main method:
static void Main(string[] args)
{
IServiceProvider serviceProvider = ConfigureServices();
string json = File.ReadAllText("steps.json");
var loader = serviceProvider.GetService();
loader.LoadDefinition(json, Deserializers.Json);
}
But I can see the workflow is registered.
Do i need to start/build it somewhere?
This is the workflow class:
public class HelloWorldWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder)
{
builder
.UseDefaultErrorBehavior(WorkflowErrorHandling.Suspend);
}
Sample JSON:
{
"Id": "HelloWorld",
"Version": 1,
"Steps": [
{
"Id": "Hello",
"StepType": "WorkflowPOC.Steps.HelloWorld, WorkflowPOC",
"NextStepId": "Bye"
},
{
"Id": "Bye",
"StepType": "WorkflowPOC.Steps.GoodbyeWorld, WorkflowPOC"
}
]
}
Beta Was this translation helpful? Give feedback.
All reactions