From a64ea6f2a5257eb2593922cf0d1360ab0f3c56c6 Mon Sep 17 00:00:00 2001 From: "m.lettere" Date: Thu, 25 Nov 2021 14:51:07 +0100 Subject: [PATCH] removed unnecessary parameters, make workspace_to_vre more resilient to already member, hooked enable_workspace_clients workflow to group_created --- templates/add_workspace_client_to_context.json.j2 | 1 + .../enable_workspace_clients_for_context.json.j2 | 2 -- templates/group_created.json.j2 | 13 ++++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/templates/add_workspace_client_to_context.json.j2 b/templates/add_workspace_client_to_context.json.j2 index 8286976..7fbf568 100644 --- a/templates/add_workspace_client_to_context.json.j2 +++ b/templates/add_workspace_client_to_context.json.j2 @@ -188,6 +188,7 @@ "inputParameters" : { "url" : "${init.input.storagehub}/workspace/groups/${shubify_context_name.output.result.shubified_context_name}/users", "method" : "PUT", + "expect" : [200, 400], "body" :{ "userId" : "${get_service_account_user.output.body.username}" }, diff --git a/templates/enable_workspace_clients_for_context.json.j2 b/templates/enable_workspace_clients_for_context.json.j2 index 2d9c9d0..44e34d2 100644 --- a/templates/enable_workspace_clients_for_context.json.j2 +++ b/templates/enable_workspace_clients_for_context.json.j2 @@ -12,10 +12,8 @@ "taskReferenceName": "init", "type": "LAMBDA", "inputParameters": { - "root_vo": "{{ root_vo }}", "keycloak": "{{ keycloak }}/{{ keycloak_realm }}", "keycloak_admin" : "{{ keycloak_admin }}/{{ keycloak_realm }}", - "id" : "${workflow.input.client_id}", "ctx" : "${workflow.input.context}", "filter" : "${workflow.input.filter}", "scriptExpression": "function e(v){ return (v == null || (v.trim && v.trim() === ''))} if(e($.ctx)) throw('Context must not be empty'); f=$.filter; if(e(f)) f = []; else if(typeof(f) === 'string') f=[f]; else f=Java.from(f); return { encoded_root_vo : encodeURI($.root_vo), filter : Java.to(f,'java.lang.String[]')}" diff --git a/templates/group_created.json.j2 b/templates/group_created.json.j2 index f010c66..5ae47fa 100644 --- a/templates/group_created.json.j2 +++ b/templates/group_created.json.j2 @@ -487,6 +487,17 @@ "Content-Type" : "application/json" } } - } + }, + { + "name": "sub_workflow_task", + "taskReferenceName": "call_enable_workspace_clients_for_context", + "inputParameters": { + "subWorkflowParam": { + "name": "add_workspace_client_to_context" + }, + "context" : "${workflow.input.group}" + }, + "type": "SUB_WORKFLOW" + } ] }