diff --git a/lib/flow/src/flows.json b/lib/flow/src/flows.json index 2b9ac14..21357fa 100644 --- a/lib/flow/src/flows.json +++ b/lib/flow/src/flows.json @@ -232,7 +232,7 @@ "type": "function", "z": "d4af305b.2ea44", "name": "Flow: processAssemblerTask", - "func": "\n// get request\nvar request = context.global.get('REQUEST');\n\n// define options\nnode.log(\"Prepare AssemblerTask for job \" + msg.job.jobId);\n\nvar options = {\n method: 'POST',\n url: 'https://' + env.get(\"SPO_URL\") + '/api/rest/assembler/',\n json: true,\n body: msg.assemblerTask,\n headers: {\n \"X-Tenant\" : env.get(\"SPO_TENANT\"),\n \"accept\" : \"application/json\",\n \"Authorization\" : 'Basic ' + new Buffer(env.get(\"SPO_USER\") + \":\" + env.get(\"SPO_PASSWORD\")).toString('base64')\n }\n}\n\n// execute request\nrequest(options, (error, response, body) => {\n if (error) {\n node.error(\"Unable to connect Assembler for job '\" + msg.job.jobId + \"'. Reason: \" + JSON.stringify(error));\n return;\n \n } else if (body['exception-Root'] !== undefined) {\n var err = body['exception-Root'];\n node.error(\"Assembler Exception for Job '\" + msg.job.jobId + \"': \" + err.name + \" (statusCode: \" + err.statusCode + \") - \" + err.message);\n return;\n \n } else {\n msg.binderySignatures = { binderySignature: body['assembler-Root'].result.binderySignatures.binderySignature };\n node.log(\"Assembler has been executed sucessfully for job '\" + msg.job.jobId + \"'. Number BinderySignatures: \" + msg.binderySignatures.binderySignature.length);\n node.send(msg);\n \n }\n});\n\n\n", + "func": "\n// get request\nvar request = context.global.get('REQUEST');\n\n// define options\nnode.log(\"Prepare AssemblerTask for job \" + msg.job.jobId);\n\nvar options = {\n method: 'POST',\n url: 'https://' + env.get(\"SPO_URL\") + '/api/rest/assembler/',\n json: true,\n body: msg.assemblerTask,\n headers: {\n \"X-Tenant\" : env.get(\"SPO_TENANT\"),\n \"accept\" : \"application/json\",\n \"Authorization\" : 'Basic ' + new Buffer(env.get(\"SPO_USER\") + \":\" + env.get(\"SPO_PASSWORD\")).toString('base64')\n }\n}\n\n// execute request\nrequest(options, (error, response, body) => {\n if (error) {\n node.error(\"Unable to connect Assembler for job '\" + msg.job.jobId + \"'. Reason: \" + JSON.stringify(error));\n return;\n \n } else if (body['exception-Root'] !== undefined) {\n var err = body['exception-Root'];\n node.error(\"Assembler Exception for Job '\" + msg.job.jobId + \"': \" + err.name + \" (statusCode: \" + err.statusCode + \") - \" + err.message);\n return;\n \n } else {\n msg.binderySignatures = body['assembler-Root'].result.binderySignatures.binderySignature;\n node.log(\"Assembler has been executed sucessfully for job '\" + msg.job.jobId + \"'. Number BinderySignatures: \" + msg.binderySignatures.length);\n node.send(msg);\n \n }\n});\n\n\n", "outputs": 1, "noerr": 0, "x": 1220, @@ -248,7 +248,7 @@ "type": "function", "z": "d4af305b.2ea44", "name": "Integration: processJobBinderySignatures", - "func": "\n// get input logic\nvar integration = context.global.get('INTEGRATION');\n\n// process jobs bindery signatures\nintegration.processJobBinderySignatures(msg.binderySignatures, msg.job).then((modifiedBinderySignatures) => {\n\n if(modifiedBinderySignatures !== null) {\n msg.binderySignatures = modifiedBinderySignatures.binderySignatures;\n node.log(\"Post-process BinderySignatures for job '\" + msg.job.jobId + \"'. Number of BinderySignatures: \" + msg.binderySignatures.length);\n } else {\n node.log(\"SKIP post-process of BinderySignatures for job \" + msg.job.jobId);\n }\n\n node.send(msg);\n});\n", + "func": "\n// get input logic\nvar integration = context.global.get('INTEGRATION');\n\n// process jobs bindery signatures\nintegration.processJobBinderySignatures(msg.binderySignatures, msg.job).then((modifiedBinderySignatures) => {\n if(modifiedBinderySignatures !== null) {\n msg.binderySignatures = modifiedBinderySignatures;\n node.log(\"Post-process BinderySignatures for job '\" + msg.job.jobId + \"'. Number of BinderySignatures: \" + msg.binderySignatures.length);\n } else {\n node.log(\"SKIP post-process of BinderySignatures for job \" + msg.job.jobId);\n }\n\n node.send(msg);\n});\n", "outputs": 1, "noerr": 0, "x": 1540,