diff --git a/defaults/main.yaml b/defaults/main.yaml index 121a137..4421d61 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -18,7 +18,7 @@ workflows: # - add_all_system_services_to_vre # - create_workspace_client # - add_workspace_client_to_context - # - enable_workspace_clients_for_context + - enable_workspace_clients_for_context # - add_workspace_client_to_contexts # - ghn_client_add_to_context # - ghn_client_add_to_contexts @@ -26,7 +26,7 @@ workflows: # - ghn_client_delete # - ghn_client_remove_from_contexts # - ghn_client_remove_from_context - # - jupyterhub_add_serveroptions_to_context + - jupyterhub_add_serveroptions_to_context # - record_context_to_is # - create_vre_folder_for_context # - create_vre diff --git a/templates/enable_workspace_clients_for_context.json.j2 b/templates/enable_workspace_clients_for_context.json.j2 index 44e34d2..c4a64e3 100644 --- a/templates/enable_workspace_clients_for_context.json.j2 +++ b/templates/enable_workspace_clients_for_context.json.j2 @@ -8,15 +8,16 @@ "inputParameters" : ["filter", "context"], "tasks" : [ { - "name": "LAMBDA_TASK", + "name": "INLINE_TASK", "taskReferenceName": "init", - "type": "LAMBDA", + "type": "INLINE", "inputParameters": { "keycloak": "{{ keycloak }}/{{ keycloak_realm }}", "keycloak_admin" : "{{ keycloak_admin }}/{{ keycloak_realm }}", "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[]')}" + "evaluatorType" : "javascript", + "expression": "function e(v){ return (v == null || (v.trim && v.trim() === ''))} function f(){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[]')}} f()" } }, { @@ -59,23 +60,25 @@ } }, { - "name": "LAMBDA_TASK", + "name": "INLINE_TASK", "taskReferenceName": "filtered_workspace_client_names", - "type": "LAMBDA", + "type": "INLINE", "inputParameters": { + "evaluatorType" : "javascript", "names" : "${extract_workspace_client_names.output.result}", "filter" : "${init.output.result.filter}", - "scriptExpression": "names=Java.from($.names); f=Java.from($.filter); if(f.length === 0) output=names; else { output=[]; for(i=0;i 0 ? 'true' : 'false')", + "type": "SWITCH", + "evaluatorType" : "javascript", + "expression": "($.tasks.length > 0 ? 'true' : 'false')", "decisionCases": { "true": [ {