call to add_ws_client subworkflow

This commit is contained in:
Marco Lettere 2021-11-25 13:13:44 +01:00
parent 4c57be3f45
commit 6fd9e3c590
1 changed files with 26 additions and 0 deletions

View File

@ -69,6 +69,32 @@
"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<names.length;i++){ if(f.indexOf(names[i]) !== -1) output.push(names[i])}} return { 'names' : Java.to(output, 'java.lang.String[]')}"
}
},
{
"name": "LAMBDA_TASK",
"taskReferenceName": "build_add_workspace_client_to_context_tasks",
"type": "LAMBDA",
"inputParameters": {
"context" : "${workflow.input.context}",
"names" : "${filtered_workspace_client_names.output.result}",
"scriptExpression": "inputs={},tasks=[];for(var i=0;i<$.names.length;i++),tasks.push({name:'sub_workflow_task',type:'SUB_WORKFLOW',taskReferenceName:'call_add_ws_client_to_context_'+i, subWorkflowParam:{ name:'add_workspace_client_to_context'}}),inputs['call_add_ws_client_to_context_'+i]={client_id:$.names[i], context:$.context};return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs};"
}
},
{
"name" : "fork_dynamic",
"type" : "FORK_JOIN_DYNAMIC",
"taskReferenceName" : "parallel_add_workspace_client_to_context_tasks",
"inputParameters" : {
"tasks" : "${build_add_workspace_client_to_context_tasks.output.result.tasks}",
"inputs" : "${build_add_workspace_client_to_context_tasks.output.result.inputs}"
},
"dynamicForkTasksParam": "tasks",
"dynamicForkTasksInputParamName": "inputs"
},
{
"name" : "join",
"type" : "JOIN",
"taskReferenceName" : "parallel_add_workspace_client_to_context_tasks"
}
]
}