introduced termination when folder exists meaning order already processed
This commit is contained in:
parent
c173f3441c
commit
0ee189e8e0
|
@ -59,7 +59,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "decision",
|
"name": "decision",
|
||||||
"taskReferenceName": "check_user_existance",
|
"taskReferenceName": "check_folder_existance",
|
||||||
"inputParameters": {
|
"inputParameters": {
|
||||||
"folders": "${check_folder.output.response.body.itemlist}"
|
"folders": "${check_folder.output.response.body.itemlist}"
|
||||||
},
|
},
|
||||||
|
@ -108,31 +108,69 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name" : "pyrest",
|
"name" : "http",
|
||||||
"taskReferenceName" : "create_destination_folder",
|
"taskReferenceName" : "check_destination_folder",
|
||||||
"type" : "SIMPLE",
|
"type" : "HTTP",
|
||||||
"inputParameters" : {
|
"inputParameters" : {
|
||||||
"url" : "${init.input.storagehub}/workspace/items/${workflow.variables.parent_folder_id}/create/FOLDER",
|
"http_request": {
|
||||||
"method" : "POST",
|
"uri" : "${init.input.storagehub}/workspace/items/${workflow.variables.parent_folder_id}/items/${init.input.folder}",
|
||||||
"headers" : {
|
"method" : "GET",
|
||||||
"Content-type": "application/x-www-form-urlencoded",
|
"headers" : { "Authorization" : "${init.input.auth}" }
|
||||||
"Accept" : "text/plain",
|
}
|
||||||
"Authorization" : "${init.input.auth}"
|
}
|
||||||
},
|
|
||||||
"body" : {
|
|
||||||
"name" : "${init.input.folder}",
|
|
||||||
"description" : "Target folder of Bluecloud data downloads",
|
|
||||||
"hidden" : "false"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SET_VARIABLE",
|
"name": "decision",
|
||||||
"name": "store_target_folderid",
|
"taskReferenceName": "check_destination_folder_existance",
|
||||||
"taskReferenceName": "store_target_folderid",
|
"inputParameters": {
|
||||||
"inputParameters": {
|
"folders": "${check_destination_folder.output.response.body.itemlist}"
|
||||||
"target_folder_id": "${create_destination_folder.output.body}"
|
},
|
||||||
}
|
"type": "DECISION",
|
||||||
|
"caseExpression": "($.folders.length === 0 ? 'create' : 'exists')",
|
||||||
|
"decisionCases": {
|
||||||
|
"create": [
|
||||||
|
{
|
||||||
|
"name" : "pyrest",
|
||||||
|
"taskReferenceName" : "create_destination_folder",
|
||||||
|
"type" : "SIMPLE",
|
||||||
|
"inputParameters" : {
|
||||||
|
"url" : "${init.input.storagehub}/workspace/items/${workflow.variables.parent_folder_id}/create/FOLDER",
|
||||||
|
"method" : "POST",
|
||||||
|
"headers" : {
|
||||||
|
"Content-type": "application/x-www-form-urlencoded",
|
||||||
|
"Accept" : "text/plain",
|
||||||
|
"Authorization" : "${init.input.auth}"
|
||||||
|
},
|
||||||
|
"body" : {
|
||||||
|
"name" : "${init.input.folder}",
|
||||||
|
"description" : "Target folder of Bluecloud data downloads",
|
||||||
|
"hidden" : "false"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "SET_VARIABLE",
|
||||||
|
"name": "store_target_folderid",
|
||||||
|
"taskReferenceName": "store_target_folderid",
|
||||||
|
"inputParameters": {
|
||||||
|
"target_folder_id": "${create_destination_folder.output.body}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"exists" : [
|
||||||
|
{
|
||||||
|
"name": "terminate",
|
||||||
|
"taskReferenceName": "duplicate_folder",
|
||||||
|
"inputParameters": {
|
||||||
|
"terminationStatus": "FAILED",
|
||||||
|
"workflowOutput": "Order already processed."
|
||||||
|
},
|
||||||
|
"type": "TERMINATE",
|
||||||
|
"startDelay": 0,
|
||||||
|
"optional": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "LAMBDA_TASK",
|
"name": "LAMBDA_TASK",
|
||||||
|
|
Loading…
Reference in New Issue