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
ModelMapper.getLeanCopy() copies tasks #2829
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,9 @@ class ExternalPayloadStorageSpec extends AbstractSpecification { | |
@Shared | ||
def WORKFLOW_WITH_DECISION_AND_TERMINATE = 'ConditionalTerminateWorkflow' | ||
|
||
@Shared | ||
def WORKFLOW_WITH_SYNCHRONOUS_SYSTEM_TASK = 'workflow_with_synchronous_system_task' | ||
|
||
@Autowired | ||
UserTask userTask | ||
|
||
|
@@ -59,7 +62,8 @@ class ExternalPayloadStorageSpec extends AbstractSpecification { | |
'conditional_system_task_workflow_integration_test.json', | ||
'fork_join_integration_test.json', | ||
'simple_workflow_with_sub_workflow_inline_def_integration_test.json', | ||
'decision_and_terminate_integration_test.json' | ||
'decision_and_terminate_integration_test.json', | ||
'workflow_with_synchronous_system_task.json' | ||
) | ||
} | ||
|
||
|
@@ -125,6 +129,47 @@ class ExternalPayloadStorageSpec extends AbstractSpecification { | |
} | ||
} | ||
|
||
def "Test workflow with synchronous system task using external payload storage"() { | ||
given: "An existing workflow definition with sync system task followed by a simple task" | ||
metadataService.getWorkflowDef(WORKFLOW_WITH_SYNCHRONOUS_SYSTEM_TASK, 1) | ||
|
||
and: "input required to start large payload workflow" | ||
def correlationId = 'wf_external_storage' | ||
def workflowInputPath = INITIAL_WORKFLOW_INPUT_PATH | ||
|
||
when: "the workflow is started" | ||
def workflowInstanceId = workflowExecutor.startWorkflow(WORKFLOW_WITH_SYNCHRONOUS_SYSTEM_TASK, 1, correlationId, null, workflowInputPath, null, null) | ||
|
||
then: "verify that the workflow is in a RUNNING state" | ||
with(workflowExecutionService.getExecutionStatus(workflowInstanceId, true)) { | ||
status == Workflow.WorkflowStatus.RUNNING | ||
tasks.size() == 1 | ||
tasks[0].taskType == 'integration_task_1' | ||
tasks[0].status == Task.Status.SCHEDULED | ||
} | ||
|
||
when: "poll and complete the 'integration_task_1' with external payload storage" | ||
def taskOutputPath = TASK_OUTPUT_PATH | ||
def pollAndCompleteLargePayloadTask = workflowTestUtil.pollAndCompleteLargePayloadTask('integration_task_1', 'task1.integration.worker', taskOutputPath) | ||
|
||
then: "verify that the 'integration_task_1' was polled and acknowledged" | ||
verifyPolledAndAcknowledgedLargePayloadTask(pollAndCompleteLargePayloadTask) | ||
|
||
and: "verify that the 'integration_task1' is complete and the next task is scheduled" | ||
with(workflowExecutionService.getExecutionStatus(workflowInstanceId, true)) { | ||
status == Workflow.WorkflowStatus.COMPLETED | ||
tasks.size() == 2 | ||
tasks[0].taskType == 'integration_task_1' | ||
tasks[0].status == Task.Status.COMPLETED | ||
tasks[0].outputData.isEmpty() | ||
tasks[0].externalOutputPayloadStoragePath == taskOutputPath | ||
tasks[1].taskType == 'JSON_JQ_TRANSFORM' | ||
tasks[1].status == Task.Status.COMPLETED | ||
tasks[1].externalInputPayloadStoragePath == INPUT_PAYLOAD_PATH | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding an assert on the json task output |
||
tasks[1].outputData['result'] == 104 // output of .tp2.TEST_SAMPLE | length expression from output.json. On assertion failure, check workflow definition and output.json | ||
} | ||
} | ||
|
||
def "Test conditional workflow with system task using external payload storage"() { | ||
|
||
given: "An existing workflow definition" | ||
|
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
34 changes: 34 additions & 0 deletions
34
test-harness/src/test/resources/workflow_with_synchronous_system_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,34 @@ | ||
{ | ||
"name": "workflow_with_synchronous_system_task", | ||
"description": "A workflow with a simple task followed a synchronous task", | ||
"version": 1, | ||
"tasks": [ | ||
{ | ||
"name": "integration_task_1", | ||
"taskReferenceName": "t1", | ||
"type": "SIMPLE" | ||
}, | ||
{ | ||
"name": "jsonjq", | ||
"taskReferenceName": "jsonjq", | ||
"inputParameters": { | ||
"queryExpression": ".tp2.TEST_SAMPLE | length", | ||
"tp1": "${workflow.input.param1}", | ||
"tp2": "${t1.output.op}" | ||
}, | ||
"type": "JSON_JQ_TRANSFORM" | ||
} | ||
], | ||
"inputParameters": [], | ||
"outputParameters": { | ||
"data": "${jsonjq.output.resources}" | ||
}, | ||
"schemaVersion": 2, | ||
"restartable": true, | ||
"workflowStatusListenerEnabled": false, | ||
"ownerEmail": "example@email.com", | ||
"timeoutPolicy": "ALERT_ONLY", | ||
"timeoutSeconds": 0, | ||
"variables": {}, | ||
"inputTemplate": {} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯