added catch for user not found on KC

This commit is contained in:
Marco Lettere 2020-11-13 10:42:50 +01:00
parent dbc16ae1bc
commit 04c6e0b701
4 changed files with 64 additions and 1 deletions

View File

@ -26,6 +26,6 @@
src: "{{ target_path }}/{{ item }}.json" src: "{{ target_path }}/{{ item }}.json"
body_format: json body_format: json
follow_redirects: yes follow_redirects: yes
status_code: [200, 204, 409, 500] status_code: [200, 204, 409]
loop: loop:
"{{ workflows }}" "{{ workflows }}"

View File

@ -47,6 +47,27 @@
} }
} }
}, },
{
"name": "check_user_existance",
"taskReferenceName": "check_user_existance",
"inputParameters": {
"user": "${lookup_user.output.body[0]}"
},
"type": "DECISION",
"caseExpression": "($.user == null ? 'true' : 'false')",
"decisionCases": {
"true": [
{
"name" : "terminate",
"taskReferenceName" : "terminate_when_no_user",
"type" : "TERMINATE",
"inputParameters" : {
"terminationStatus" : "COMPLETED"
}
}
]
}
},
{ {
"name" : "pyrest", "name" : "pyrest",
"taskReferenceName" : "lookup_client", "taskReferenceName" : "lookup_client",

View File

@ -47,6 +47,27 @@
} }
} }
}, },
{
"name": "check_user_existance",
"taskReferenceName": "check_user_existance",
"inputParameters": {
"user": "${lookup_user.output.body[0]}"
},
"type": "DECISION",
"caseExpression": "($.user == null ? 'true' : 'false')",
"decisionCases": {
"true": [
{
"name" : "terminate",
"taskReferenceName" : "terminate_when_no_user",
"type" : "TERMINATE",
"inputParameters" : {
"terminationStatus" : "COMPLETED"
}
}
]
}
},
{ {
"name" : "pyrest", "name" : "pyrest",
"taskReferenceName" : "lookup_client", "taskReferenceName" : "lookup_client",

View File

@ -48,6 +48,27 @@
} }
} }
}, },
{
"name": "check_user_existance",
"taskReferenceName": "check_user_existance",
"inputParameters": {
"user": "${lookup_user.output.body[0]}"
},
"type": "DECISION",
"caseExpression": "($.user == null ? 'true' : 'false')",
"decisionCases": {
"true": [
{
"name" : "terminate",
"taskReferenceName" : "terminate_when_no_user",
"type" : "TERMINATE",
"inputParameters" : {
"terminationStatus" : "COMPLETED"
}
}
]
}
},
{ {
"name" : "pyrest", "name" : "pyrest",
"taskReferenceName" : "lookup_client", "taskReferenceName" : "lookup_client",