moved to fork-join with descriptor

This commit is contained in:
dcore94 2021-07-16 10:46:36 +02:00
parent f4176bdfe0
commit b26258551d
1 changed files with 26 additions and 22 deletions

View File

@ -8,28 +8,32 @@
"inputParameters" : ["token", "descriptor"],
"tasks" : [
{
"name" : "pyrestbridge",
"taskReferenceName" : "bridge",
"type" : "SIMPLE",
"inputParameters" : {
"endpoint1" :{
"url" : "https://ent3szkgiak1.x.pipedream.net"
},
"datamap" : {
"place" : "files",
"name" : "file"
},
"endpoint2" :{
"url" : "https://workspace-repository.dev.d4science.org/storagehub/workspace//items/68e30cd7-8728-429e-9a98-50039e309095/create/FILE",
"headers" : {
"Authorization" : "Bearer ${workflow.input.token}"
},
"files" : {
"name" : "f1.json",
"description" : "Example file"
}
}
}
"name": "LAMBDA_TASK",
"taskReferenceName": "build_transfer_tasks",
"type": "LAMBDA",
"inputParameters": {
"downloads" : "${workflow.input.descriptor.downloads}",
"upload" : "https://workspace-repository.dev.d4science.org/storagehub/workspace/items/68e30cd7-8728-429e-9a98-50039e309095/create/FILE",
"auth" : "Bearer ${workflow.input.token}",
"description" : "${workflow.input.descriptor.order_name}",
"scriptExpression": "inputs={};tasks=[];for(var i=0;i<$.downloads.length;i++)download=$.downloads[i],tasks.push({name:'pyrestbridge',type:'SIMPLE',taskReferenceName:'bridge_'+i}),inputs['bridge_'+i]={ datamap : { place: "files", name : "file"}, endpoint1 : { url: download.url}, endpoint2 : { url: $.upload, headers: { Authorization : $.auth}, files: { name : "file" + download.number, description : $.description}} };return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs};"
}
},
{
"name" : "fork_dynamic",
"type" : "FORK_JOIN_DYNAMIC",
"taskReferenceName" : "parallel_downloads",
"inputParameters" : {
"tasks" : "${build_transfer_tasks.output.result.tasks}",
"inputs" : "${build_transfer_tasks.output.result.inputs}"
},
"dynamicForkTasksParam": "tasks",
"dynamicForkTasksInputParamName": "inputs"
},
{
"name" : "join",
"type" : "JOIN",
"taskReferenceName" : "join_parallel_downloads"
}
]
}