From 8805ceb94412dad0a714dc15a2f0d7a0f4cb3c3f Mon Sep 17 00:00:00 2001 From: "m.lettere" Date: Tue, 1 Mar 2022 16:09:27 +0100 Subject: [PATCH] adapted delete user from group to also handle gateways --- templates/user-group_deleted.json.j2 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/templates/user-group_deleted.json.j2 b/templates/user-group_deleted.json.j2 index fe21e1a..7e06ddd 100644 --- a/templates/user-group_deleted.json.j2 +++ b/templates/user-group_deleted.json.j2 @@ -102,6 +102,27 @@ "scriptExpression": "function selectByPath(groups, path, level) { for (var i=0; i < groups.length; i++) {if (groups[i].name === path[level]) {if (level === path.length - 1) return groups[i];return selectByPath(groups[i].subGroups, path, level+1)}} return null; } return { 'group' : selectByPath($.groups, $.tree, 0)}" } }, + { + "name" : "check_group_existance", + "taskReferenceName" : "check_group_existance", + "type" : "DECISION", + "inputParameters" :{ + "group" : "${extract_group.output.result.group}" + }, + "caseExpression": "(($.group != null) ? 'delete' : 'skip')", + "decisionCases" : { + "skip" : [ + { + "name" : "terminate", + "taskReferenceName" : "terminate_when_no_group", + "type" : "TERMINATE", + "inputParameters" : { + "terminationStatus" : "COMPLETED" + } + } + ] + } + }, { "name" : "pyrest", "taskReferenceName" : "delete_user_from_group",