From 2924a9e8a3495c14f851a293b56a153d69399245 Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Sun, 25 Nov 2018 16:08:10 +0100 Subject: [PATCH] more javascript --- camunda-overlay/sentiment-analysis.bpmn | 265 ++++++++++++------------ 1 file changed, 136 insertions(+), 129 deletions(-) diff --git a/camunda-overlay/sentiment-analysis.bpmn b/camunda-overlay/sentiment-analysis.bpmn index c9392d4..e8243ae 100644 --- a/camunda-overlay/sentiment-analysis.bpmn +++ b/camunda-overlay/sentiment-analysis.bpmn @@ -1,95 +1,84 @@ - - + + - - - - - - - SequenceFlow_0tu3w40 - - - SequenceFlow_0jebdb9 - SequenceFlow_0tu3w40 - - PT5S - - - - SequenceFlow_14nqu0e - SequenceFlow_0jebdb9 - - - SequenceFlow_0jumhlh - SequenceFlow_14nqu0e - - - SequenceFlow_0htopx7 - SequenceFlow_0jumhlh - - PT5S - - - - SequenceFlow_11xavl5 - SequenceFlow_0htopx7 + + + + + + + var results = S('{}'); +execution.setVariable("results", results) + + + 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(); +//print (termStr) +results.prop(termStr, analysis); +//print (analysis) +//print (results) +execution.setVariable("results", S(results)) + + + SequenceFlow_15dip2q + SequenceFlow_1j2y6tv - - SequenceFlow_0f6v4j4 - - + - - var term = execution.getVariable("term"); -'http://twitter:8084/search/tweets.json?q='+term.term; - - GET + http://analysis:8081/ + POST application/json + application/json - + ${tweets.toString()} + var response = connector.getVariable("response"); -S(response); +response.trim() http-connector - SequenceFlow_0f6v4j4 - SequenceFlow_0g6bfz6 + SequenceFlow_0g6bfz6 + SequenceFlow_1bz7zx2 - - - - SequenceFlow_1bz7zx2 - - - + - http://analysis:8081/ - POST + + var term = execution.getVariable("term"); +'http://twitter:8084/search/tweets.json?q='+term.prop('term').value() + + GET application/json - - var tweets = execution.getVariable("tweets"); -'{"q": "'+tweets+'"}'; - - + var response = connector.getVariable("response"); S(response); @@ -97,91 +86,109 @@ S(response); http-connector - SequenceFlow_0g6bfz6 - SequenceFlow_1bz7zx2 + SequenceFlow_0f6v4j4 + SequenceFlow_0g6bfz6 + + SequenceFlow_0f6v4j4 + + + + + + SequenceFlow_1bz7zx2 + - - SequenceFlow_11xavl5 - + + SequenceFlow_0jebdb9 + + + + + + http://reporting:80/generatePDF/ + GET + + + application/pdf + + + ${results.toString()} + + var response = connector.getVariable("response"); +response + + + http-connector + + + SequenceFlow_1j2y6tv + SequenceFlow_14nqu0e + + + SequenceFlow_14nqu0e + SequenceFlow_0jebdb9 + - - - + + + - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + + + + - - + + - - + + - - - - - - - - - - - - - - - + + + + + - + + + + - - - + + + + + + - - + + + + + + + + + + + + + + -- 2.43.0