Replies: 2 comments 2 replies
-
Very valid points! I think the source of ambiguity is that there are multiple ways of doing flow control: i.e. In my opinion: When
* skipping the output transformation simplifies the expression because otherwise one would have to handle both the raw task output ( |
Beta Was this translation helpful? Give feedback.
-
@matthias-pichler I agree with you concerning 1 and 2, but not regarding 3. IMHO, if the task is skipped, so should its do:
- registerUser:
call: http
with:
uri: https://sample-api.com/users/register
method: post
body:
firstName: John
lastName: Doe
email: [email protected]
- throwIfAlreadyRegistered:
if: '.registration.outcome == "Failed" and .registration.statusReason == "User already exists"'
set: {}
then: end
- sendConfirmationEmail:
... In above example, I'd personally expect the |
Beta Was this translation helpful? Give feedback.
-
Hello folks,
I'm not sure I have the right understanding of tasks transitions when they are
skipped
.From my understanding of the docs, if the
if
condition is not met, the task is skipped and its output becomes itsraw
input. Therefore, if I follow the logic of the data flow graph, the rest of the logic should apply and the flow directive should still be respected.For instance, given the tasks list:
If the workflow input is
keyword: foo
,setFoo
is executed, thenconditionalFoo
is skipped and respecting its flow directive,finalTask
is executed, therefore the output of the workflow isanwser: final
.If the workflow input is
keyword: bar
,setBar
is executed, thenconditionalBar
is skipped and respecting its flow directive, the workflow ends, the output isbar: true
.setFoo
is skipped but its flow directive is respected, thenconditionalFoo
and finalTaskis executed, therefore the output of the workflow is
anwser: final. The
setBar` "branch" is never executed as there is no flow directive to reach it.Is it the proper way of thinking about conditional tasks ?
As a side question, should the output transformation be skipped or not ? (orange or red arrow ?)
Beta Was this translation helpful? Give feedback.
All reactions