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

Question: conditionally skip multiple actions based on an event #29

Open
max-arnold opened this issue Mar 13, 2024 · 0 comments
Open

Question: conditionally skip multiple actions based on an event #29

max-arnold opened this issue Mar 13, 2024 · 0 comments

Comments

@max-arnold
Copy link

Let's assume the following orchestration:

def orch(ctx: task.OrchestrationContext, _):
    result = yield ctx.call_activity(hello, input='Tokyo')
    if result:
         yield ctx.call_activity(hello, input='Seattle')
    else:
         yield ctx.call_activity(hello, input='London')

    yield ctx.call_activity(hello, input='END')
    return None

How can I modify it to listen for an external event that will skip the pending activities and jump directly to the END one?

In other words, how to model complex FSMs when some of the state transitions (fast-forward, or continue-as-new) are triggered externally and I do not want to wrap every activity call with yield task.when_any?

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

1 participant