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

Introduce SWITCH action for selecting proper transition #128

Open
marcinus opened this issue Mar 16, 2020 · 0 comments
Open

Introduce SWITCH action for selecting proper transition #128

marcinus opened this issue Mar 16, 2020 · 0 comments

Comments

@marcinus
Copy link
Contributor

Is your feature request related to a problem? Please describe.

  • Imagine you want to process different responses from HTTP action differently. Say, the service you interact with is pointing you in the right direction, but different directions require different processing.
  • Or let's say processing should be varied by a configuration parameter specified for the Fragment
  • Or there is a need to diverge processing of graph based on some previous action's result

Describe the solution you'd like
switch Action Factory to the rescue! Configuration could look like this:

stuff {
   factory = switch
   config {
      condition = "{gateway-call._result.operationStatus}"
      _success = [ OK, ONGOING ]
      _error = [ FAILED, ABORTED ]
      defaultTransition = _fallback
    }
}

The syntax could be simple or rich:

  • could support only single values
  • could support arrays of accepted values
  • could support regular expressions
  • could support OR or AND logic between conditions
  • could support parenthnesses and provide a full boolean logic support.

Note: a resolution mechanism should be considered for the cases when many transitions fit

Describe alternatives you've considered
An alternative is to write a custom action for each diversion case. It is actually a good solution for actions written for the specific job. But this does not really work when using builtin actions, like HttpAction - to apply such behaviour, a new action has to be written just to handle the transition.

Additional context
This is somehow related #49, but does not solve the issue.

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