Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
productive improvment
Browse files Browse the repository at this point in the history
  • Loading branch information
meiXXI committed Oct 28, 2019
1 parent d09c751 commit 04e6ba5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/flow/src/flows.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 04e6ba5

Please sign in to comment.