-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The aim is to have a simple API to be able to recreate a case/when block with TRB.
Here the flowchart of an operation using a Switch
macro:
Requirements:
- one branch step in the beginning
- one "track" or whatever (path??) per option
- multiple ends per "path"
- arbitrary connections amongst the "paths" (as an additional feature)
Possible API solution:
class ChargeSwitch < Trailblazer::Operation
class Braintree < Trailblazer::Activity::Signal; end
.....
step Switch(condition: :set_condition) {
option "stripe", Trailblazer::Operation::Nested(ChargeStripe)
option "braintree", :braintree, Output(Braintree, :success) => Track(:braintree)
option /./, :unsupported
}
......
end
Here the branch where a draft implementation has been done (not the best but the tests are reusable): https://github.com/trailblazer/trailblazer-macro/tree/macro_switch
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request