// make variable global
execution.setVariable("results", S('[]'))
SequenceFlow_15dip2q
// make variables local to loop
execution.setVariable("analysis", 0, "terms_loop");
execution.setVariable('tweets', S('[]'), "terms_loop");
var results = execution.getVariable("results");
var term = execution.getVariable("term");
var analysis = execution.getVariable("analysis");
var termStr = term.prop('term').value();
// this is for dictionary
//results.prop(termStr, analysis);
// this is for list
var item = {};
item[termStr] = analysis;
results.append(item)
execution.setVariable("results", S(results))
SequenceFlow_15dip2q
SequenceFlow_1j2y6tv
http://analysis:8081/
POST
application/json
application/json
${tweets.toString()}
var response = connector.getVariable("response");
response.trim()
http-connector
SequenceFlow_0g6bfz6
SequenceFlow_1bz7zx2
SequenceFlow_0f6v4j4
SequenceFlow_1bz7zx2
SequenceFlow_0jebdb9
http://reporting:80/generatePDF/
POST
application/pdf
application/json
${results.toString()}
var response = connector.getVariable("response");
print ("response: ")
print (response)
var file = Java.type('org.camunda.bpm.engine.variable.Variables').fileValue("pdfTest").file(response.getBytes("utf-8")).mimeType('application/pdf').create()
//response.getBytes("utf-8")
file
http-connector
SequenceFlow_1j2y6tv
SequenceFlow_14nqu0e
SequenceFlow_14nqu0e
SequenceFlow_0jebdb9