moved from decision to switch for compatibility with new conductor

This commit is contained in:
Marco Lettere 2023-10-12 14:08:23 +02:00
parent d61e893a8b
commit f0c3e9ab12
3 changed files with 25 additions and 21 deletions

View File

@ -7,7 +7,7 @@ workflows:
# - group_created
# - invitation-accepted
# - user-group_deleted
# - user-group-role_deleted
- user-group-role_deleted
# - delete-user-account
# - role_deleted
# - role_created

View File

@ -63,20 +63,20 @@
"name": "check_user_existance",
"taskReferenceName": "check_user_existance",
"inputParameters": {
"user": "${select_user.output.result[0]}"
"users": "${select_user.output.result}"
},
"type": "SWITCH",
"evaluatorType": "javascript",
"expression": "($.user == null ? 'true' : 'false')",
"expression": "($.users.length !== 1 ? 'true' : 'false')",
"decisionCases": {
"true": [
"true": [y
{
"name" : "terminate",
"taskReferenceName" : "terminate_when_no_user",
"type" : "TERMINATE",
"inputParameters" : {
"terminationStatus" : "COMPLETED"
}
"name" : "terminate",
"taskReferenceName" : "terminate_when_no_user",
"type" : "TERMINATE",
"inputParameters" : {
"terminationStatus" : "COMPLETED"
}
}
]
}

View File

@ -8,13 +8,14 @@
"inputParameters" : ["role", "user", "group"],
"tasks" : [
{
"name": "LAMBDA_TASK",
"name": "INLINE_TASK",
"taskReferenceName": "init",
"type": "LAMBDA",
"type": "INLINE",
"inputParameters": {
"keycloak": "{{ keycloak }}/{{ keycloak_realm }}",
"keycloak_admin" : "{{ keycloak_admin }}/{{ keycloak_realm }}",
"scriptExpression": "1"
"expression": "1",
"evaluatorType" : "javascript"
}
},
{
@ -48,23 +49,25 @@
}
},
{
"name": "LAMBDA_TASK",
"name": "INLINE_TASK",
"taskReferenceName": "select_user",
"inputParameters": {
"foundusers": "${lookup_user.output.body}",
"username": "${workflow.input.user}",
"scriptExpression": "for(var i=0; i < $.foundusers.length;i++){if($.foundusers[i]['username'] == $.username) return Java.to([$.foundusers[i]], 'java.lang.Object[]')}"
"evaluatorType" : "javascript",
"expression": "function(){for(var i=0; i < $.foundusers.length;i++){if($.foundusers[i]['username'] == $.username) return Java.to([$.foundusers[i]], 'java.lang.Object[]')}} f()"
},
"type": "LAMBDA"
"type": "INLINE"
},
{
"name": "check_user_existance",
"taskReferenceName": "check_user_existance",
"inputParameters": {
"user": "${select_user.output.result[0]}"
"users": "${select_user.output.result}"
},
"type": "DECISION",
"caseExpression": "($.user == null ? 'true' : 'false')",
"evaluatorType" : "javascript",
"expression": "($.users.length !== 1 ? 'true' : 'false')",
"decisionCases": {
"true": [
{
@ -106,13 +109,14 @@
}
},
{
"name": "LAMBDA_TASK",
"name": "INLINE_TASK",
"taskReferenceName": "select_role",
"type": "LAMBDA",
"type": "INLINE",
"inputParameters": {
"role": "${workflow.input.role}",
"roles" : "${get_client_roles.output.body}",
"scriptExpression": "for(var i=0; i < $.roles.length;i++){if($.roles[i]['name'] == $.role) return Java.to([$.roles[i]], 'java.lang.Object[]')}"
"evaluatorType" : "javascript",
"expression": "for(var i=0; i < $.roles.length;i++){if($.roles[i]['name'] == $.role) return Java.to([$.roles[i]], 'java.lang.Object[]')}"
}
},
{