-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetDataAllInOne.bpmn
76 lines (70 loc) · 4.01 KB
/
getDataAllInOne.bpmn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0ae55bk" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.15.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.19.0">
<bpmn:process id="Process_1nmycre" isExecutable="true" camunda:historyTimeToLive="11">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>Flow_1cac370</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:serviceTask id="Activity_06o8yuc" name="Get data from Orion-LDurn:ngsi-ld:ed:TemperatureSensor1">
<bpmn:extensionElements>
<camunda:connector>
<camunda:inputOutput>
<camunda:inputParameter name="url">http://ed-orion-ld:1026/ngsi-ld/v1/entities/urn:ngsi-ld:ed:TemperatureSensor1</camunda:inputParameter>
<camunda:inputParameter name="method">GET</camunda:inputParameter>
<camunda:inputParameter name="headers">
<camunda:map>
<camunda:entry key="Link"><http://ed-ld-context/ed-context.jsonld></camunda:entry>
</camunda:map>
</camunda:inputParameter>
<camunda:outputParameter name="sensorData">${response}</camunda:outputParameter>
</camunda:inputOutput>
<camunda:connectorId>http-connector</camunda:connectorId>
</camunda:connector>
<camunda:executionListener event="end">
<camunda:script scriptFormat="groovy">import groovy.json.JsonSlurper
System.out.println("____________________________________")
def response = execution.getVariable('sensorData')
def jsonSlurper = new JsonSlurper()
def jsonResponse = jsonSlurper.parseText(response)
// Now you can access keys and values
println "Keys: ${jsonResponse.keySet()}"
println "Values: ${jsonResponse.values()}"
println "Value for 'temparature': ${jsonResponse.temperature.value}"
System.out.println("____________________________________")
execution.setVariable('TemperatureSensor1', jsonResponse.temperature.value)
def TemperatureSensor1 = execution.getVariable('TemperatureSensor1')
println "Values TemperatureSensor1: ${TemperatureSensor1}"</camunda:script>
</camunda:executionListener>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1cac370</bpmn:incoming>
<bpmn:outgoing>Flow_0dyg0z0</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="Flow_1cac370" sourceRef="StartEvent_1" targetRef="Activity_06o8yuc" />
<bpmn:endEvent id="Event_0w182w1">
<bpmn:extensionElements />
<bpmn:incoming>Flow_0dyg0z0</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_0dyg0z0" sourceRef="Activity_06o8yuc" targetRef="Event_0w182w1" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1nmycre">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="179" y="99" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1qq2c4p_di" bpmnElement="Activity_06o8yuc">
<dc:Bounds x="380" y="77" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0w182w1_di" bpmnElement="Event_0w182w1">
<dc:Bounds x="752" y="99" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_1cac370_di" bpmnElement="Flow_1cac370">
<di:waypoint x="215" y="117" />
<di:waypoint x="380" y="117" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0dyg0z0_di" bpmnElement="Flow_0dyg0z0">
<di:waypoint x="480" y="117" />
<di:waypoint x="752" y="117" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>