Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self Transitions and Feedback loops #37

Open
king612 opened this issue Apr 17, 2019 · 1 comment
Open

Self Transitions and Feedback loops #37

king612 opened this issue Apr 17, 2019 · 1 comment

Comments

@king612
Copy link

king612 commented Apr 17, 2019

Could you please provide guidance on how best to implement a self-transition? That is a state that transitions back to itself? Ideally, it would do this conditionally. So, maybe it transitions to an If that can transition back to the original state?

Geneally, the framework seems to only support acyclic paths through the state machine. Surely you can have a return transition that goes back to a previous state? Would you just 'reinstantiate' that step again in the WF definition?

I suspect it would involve ExecutionResult.branch() but there is apparently no documentation of that nor any samples that use it. The If example also appears to be a once-through with no feedback loop.

Any help would be greatly appreciated. If all workflows have to be acyclical, that would be a dealbreaker for us using it.

@king612 king612 changed the title Self Transitions Self Transitions and Feedback loops Apr 17, 2019
@danielgerlag
Copy link
Owner

It is possible but you have to do it like this currently:

let step1 = builder.startWith(HelloWorld);
let step2 = step1.then(GoodbyeWorld);
step2.thenStep(step1);

On the .net version we did implement a nicer syntax - here: https://github.com/danielgerlag/workflow-core/releases/tag/1.8.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants