-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Description
During using the sdk-java I see the confusion of the workflow context when run the fork task
Here is my workflow dsl
parallelEnrichment: input: from: ${ $context.order } fork: compete: true branches: - pricingEnrichment: input: from: ${ . } set: subtotal: ${ .amount } tax: 20.00 total: ${ .amount + 20.00 } output: as: '${ $input + { "pricing": $output } }' export: as: '${ { "pricing": $output } }' - customerEnrichment: input: from: ${ .customer } set: loyaltyTier: "gold" discountPct: 5 output: as: '${ $input + { "profile": $output } }' export: as: '${ { "customer": $output } }' - riskAssessment: input: from: ${ . } set: riskScore: 12 riskBand: "low" output: as: '${ $input + { "risk": $output } }' export: as: '${ { "risk": $output } }'
- with compete false
The workflow output is the combined output from all branches but context is not, it is always the context from last updated branch not the combined context from all branches? - with compete flag true
When first complete branch completed and trigger complete to fork task (state COMPLETED) then the other branch get FAULTED, is fork task status be influented by the failed result or still keep COMPLETED? - also with compete flag true
The workflow output and context sometimes get from different branch like the log below
[io.serverlessworkflow.impl.BlockingExample.main()] INFO io.serverlessworkflow.impl.BlockingExample - Workflow context: { "pricing" : { "pricing" : { "subtotal" : null, "tax" : 20.0, "total" : 20.0 } } } [io.serverlessworkflow.impl.BlockingExample.main()] INFO io.serverlessworkflow.impl.BlockingExample - Final output: { "profile" : { "loyaltyTier" : "gold", "discountPct" : 5 } }
I expect the output and the context should be get from the branch winner who completed first. But the test shows output comes from first completed branch and context comes from last updated branch?
Please help to confirm what should I follow.
Thanks for your support.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels