This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do_while task relevant loop over task calculation fix (#3351)
* Simplifying the logic to check relevant task for do_while task The cases where decision/ fork_join, dynamic_fork is part of loop over task then ideally do_while task must wait before all the task gets completed. * integration tests * spotless * proper fix * spotless * integration test for remaining scenario. * removed not necessary test case. The test case was when decision task is part of loop over task and decision task contains two tasks and only one task is scheduled. But there will not be any case where we schedule only one task given the decision case has two tasks. * spotless * spotless 2 * spotless 3
- Loading branch information
Showing
3 changed files
with
161 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
test-harness/src/test/resources/do_while_with_decision_task.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"name": "DO_While_with_Decision_task", | ||
"description": "Program for testing loop behaviour", | ||
"version": 1, | ||
"schemaVersion": 2, | ||
"ownerEmail": "xyz@company.eu", | ||
"tasks": [ | ||
{ | ||
"name": "LoopTask", | ||
"taskReferenceName": "LoopTask", | ||
"type": "DO_WHILE", | ||
"inputParameters": { | ||
"list": "${workflow.input.list}" | ||
}, | ||
"loopCondition": "$.LoopTask['iteration'] < $.list.length", | ||
"loopOver": [ | ||
{ | ||
"name": "GetNumberAtIndex", | ||
"taskReferenceName": "GetNumberAtIndex", | ||
"type": "INLINE", | ||
"inputParameters": { | ||
"evaluatorType": "javascript", | ||
"list": "${workflow.input.list}", | ||
"iterator": "${LoopTask.output.iteration}", | ||
"expression": "function getElement() { return $.list.get($.iterator - 1); } getElement();" | ||
} | ||
}, | ||
{ | ||
"name": "SwitchTask", | ||
"taskReferenceName": "SwitchTask", | ||
"type": "SWITCH", | ||
"evaluatorType": "javascript", | ||
"inputParameters": { | ||
"param": "${GetNumberAtIndex.output.result}" | ||
}, | ||
"expression": "$.param > 0", | ||
"decisionCases": { | ||
"true": [ | ||
{ | ||
"name": "WaitTask", | ||
"taskReferenceName": "WaitTask", | ||
"type": "WAIT", | ||
"inputParameters": { | ||
} | ||
}, | ||
{ | ||
"name": "ComputeNumber", | ||
"taskReferenceName": "ComputeNumber", | ||
"type": "INLINE", | ||
"inputParameters": { | ||
"evaluatorType": "javascript", | ||
"number": "${GetNumberAtIndex.output.result.number}", | ||
"expression": "function compute() { return $.number+10; } compute();" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |