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

Nested branches

Open tvetan opened this issue 5 years ago • 1 comments

Hello,

Using the Decision Branches doesn't seem to work for nested branches.

Example:


var branch3 = builder.CreateBranch()
            .StartWith<PrintMessage>()
                .Input(step => step.Message, data => "hi from 3")
            .Then<PrintMessage>()
                .Input(step => step.Message, data => "bye from 3")
                .Then<PrintMessage>();

var branch2 = builder.CreateBranch()
                .StartWith<PrintMessage>()
                    .Input(step => step.Message, data => "hi from 2")
                    .Output(step => step.Value, data => 3)
                .Then<PrintMessage>()
                    .Input(step => step.Message, data => "hi from 2 then")
                    .Output(step => step.Value, data => 3)
                .Decide(data => data.Value)
                   .Branch(4, branch4)
                   .Branch(3, branch3);
 
builder.StartWith<SayHello>()
            .Output(step => step.Value, data => 2)
            .Decide(data => data.Value)
            .Branch(1, branch1)
            .Branch(2, branch2)

Actual Result: hi from 2 bye from 3

Expected Result: hi from 2 hi from 2 then hi from 3 bye from 3

How can something like this be achieved?

tvetan avatar Apr 13 '20 09:04 tvetan

Hi,

It's working for me on version 3.6.4

cjundt avatar Aug 19 '22 14:08 cjundt