52 lines
2.1 KiB
Django/Jinja
52 lines
2.1 KiB
Django/Jinja
{
|
|
"ownerApp" : "Orchestrator",
|
|
"name" : "ghn_client_remove_from_contexts",
|
|
"createBy" : "Marco Lettere",
|
|
"description": "The role Member for of all the passed contexts is removed from a GHN client",
|
|
"version" : 1,
|
|
"ownerEmail" : "marco.lettere@nubisware.com",
|
|
"inputParameters" : ["client_id", "context_list"],
|
|
"tasks" : [
|
|
{
|
|
"name": "INLINE_TASK",
|
|
"taskReferenceName": "init",
|
|
"type": "INLINE",
|
|
"inputParameters": {
|
|
"keycloak": "{{ keycloak }}/{{ keycloak_realm }}",
|
|
"id" : "${workflow.input.client_id}",
|
|
"keycloak_admin" : "{{ keycloak_admin }}/{{ keycloak_realm }}",
|
|
"evaluatorType" : "javascript",
|
|
"expression": "function e(v){ return (v == null || (v.trim && v.trim() === ''))}; function f(){if(e($.id)) throw('Client ID must not be empty'); return { }} f()"
|
|
}
|
|
},
|
|
{
|
|
"name": "INLINE",
|
|
"taskReferenceName": "build_tasks_to_remove_ghn_client_from_all_contexts",
|
|
"type": "INLINE",
|
|
"inputParameters": {
|
|
"context_list" : "${workflow.input.context_list}",
|
|
"client_id" : "${workflow.input.client_id}",
|
|
"evaluatorType" : "javascript",
|
|
"expression": "inputs={},tasks=[]; function f(){for(var i=0;i<$.context_list.length;i++)c=$.context_list[i],tasks.push({name:'sub_workflow_task',type:'SUB_WORKFLOW',taskReferenceName:'remove_ghn_client_from_context_'+i, subWorkflowParam:{ name:'ghn_client_remove_from_context'}}),inputs['remove_ghn_client_from_context_'+i]={client_id : $.client_id, context: c};return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs};} f()"
|
|
}
|
|
},
|
|
{
|
|
"name" : "fork_dynamic",
|
|
"type" : "FORK_JOIN_DYNAMIC",
|
|
"taskReferenceName" : "parallel_build_tasks_to_remove_ghn_client_from_all_contexts",
|
|
"inputParameters" : {
|
|
"tasks" : "${build_tasks_to_remove_ghn_client_from_all_contexts.output.result.tasks}",
|
|
"inputs" : "${build_tasks_to_remove_ghn_client_from_all_contexts.output.result.inputs}"
|
|
},
|
|
"dynamicForkTasksParam": "tasks",
|
|
"dynamicForkTasksInputParamName": "inputs"
|
|
},
|
|
{
|
|
"name" : "join",
|
|
"type" : "JOIN",
|
|
"taskReferenceName" : "join_build_tasks_to_remove_ghn_client_from_all_contexts"
|
|
}
|
|
]
|
|
}
|
|
|