SMA-2417 workaround to catch errors

- refactored awx template id evauluation to allow error handling
main
Sven Ketelsen 2 years ago
parent 1d9e180d51
commit 58d2df4f80

@ -11,19 +11,6 @@
<bpmn2:incoming>Flow_1ow8whd</bpmn2:incoming>
<bpmn2:outgoing>Flow_0qfq760</bpmn2:outgoing>
</bpmn2:scriptTask>
<bpmn2:task id="Activity_1igdww7" name="AWX Job-Template-ID auslesen">
<bpmn2:extensionElements>
<camunda:inputOutput>
<camunda:outputParameter name="job_template_id">
<camunda:script scriptFormat="groovy">def templates = datasources.query('awx-job-templates').processScope(contextScopeId, contextProcessId).parameters([name:smardigoManagementAction]).list();
templates.size()==0 ? -1 : templates[0]['id'];</camunda:script>
</camunda:outputParameter>
</camunda:inputOutput>
</bpmn2:extensionElements>
<bpmn2:incoming>Flow_1xdj53u</bpmn2:incoming>
<bpmn2:outgoing>Flow_1cnt5hf</bpmn2:outgoing>
</bpmn2:task>
<bpmn2:sequenceFlow id="Flow_1ow8whd" sourceRef="Event_02kqmmg" targetRef="Activity_1olpao9" />
<bpmn2:sequenceFlow id="Flow_0qfq760" sourceRef="Activity_1olpao9" targetRef="Gateway_0n3j4hy" />
<bpmn2:sequenceFlow id="Flow_1nqz9ya" sourceRef="Activity_1hwc1va" targetRef="Activity_0wn3csk" />
@ -31,7 +18,7 @@ templates.size()==0 ? -1 : templates[0]['id'];</camunda:script>
<bpmn2:sequenceFlow id="Flow_0tmasvl" name="simulation active " sourceRef="Gateway_0n3j4hy" targetRef="Gateway_0p57e80">
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">${simulation}</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="Flow_1cnt5hf" sourceRef="Activity_1igdww7" targetRef="Gateway_11tein2" />
<bpmn2:sequenceFlow id="Flow_1cnt5hf" sourceRef="Activity_0kftgey" targetRef="Gateway_11tein2" />
<bpmn2:sequenceFlow id="Flow_1nuku1o" sourceRef="Activity_12p300g" targetRef="Event_0tax83l" />
<bpmn2:sequenceFlow id="Flow_0gcsmj7" sourceRef="Event_0tax83l" targetRef="Gateway_0p57e80" />
<bpmn2:sequenceFlow id="Flow_1rngywr" name="default" sourceRef="Gateway_0n3j4hy" targetRef="Activity_1ewqrs7" />
@ -53,7 +40,7 @@ templates.size()==0 ? -1 : templates[0]['id'];</camunda:script>
<bpmn2:incoming>Flow_1rngywr</bpmn2:incoming>
<bpmn2:outgoing>Flow_1xdj53u</bpmn2:outgoing>
</bpmn2:callActivity>
<bpmn2:sequenceFlow id="Flow_1xdj53u" sourceRef="Activity_1ewqrs7" targetRef="Activity_1igdww7" />
<bpmn2:sequenceFlow id="Flow_1xdj53u" sourceRef="Activity_1ewqrs7" targetRef="Activity_0kftgey" />
<bpmn2:sequenceFlow id="Flow_065a4cq" name="job_template_id found" sourceRef="Gateway_11tein2" targetRef="Activity_1hwc1va">
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">${job_template_id != -1}</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
@ -117,21 +104,38 @@ processes.byId(contextScopeId, contextProcessId).createComment('current_job_id :
<bpmn2:sequenceFlow id="Flow_0mtnk56" name="job_template_id not found" sourceRef="Gateway_11tein2" targetRef="Event_1bfppnu">
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">${job_template_id == -1}</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:endEvent id="Event_1bfppnu">
<bpmn2:endEvent id="Event_1bfppnu" name="job_template_id not found">
<bpmn2:incoming>Flow_0mtnk56</bpmn2:incoming>
<bpmn2:errorEventDefinition id="ErrorEventDefinition_1ww36kh" errorRef="Error_1m76bd5" />
</bpmn2:endEvent>
<bpmn2:scriptTask id="Activity_0kftgey" name="Aktuelle Job Id übernehmen" scriptFormat="groovy" camunda:resultVariable="job_template_id">
<bpmn2:incoming>Flow_1xdj53u</bpmn2:incoming>
<bpmn2:outgoing>Flow_1cnt5hf</bpmn2:outgoing>
<bpmn2:script>def templates = datasources.query('awx-job-templates').processScope(contextScopeId, contextProcessId).parameters([name:smardigoManagementAction]).list();
templates.size()==0 ? -1 : templates[0]['id'];</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:endEvent id="Event_1gny0cr" name="job_template_id not readable">
<bpmn2:incoming>Flow_0ny162r</bpmn2:incoming>
<bpmn2:errorEventDefinition id="ErrorEventDefinition_1t2wut9" errorRef="Error_1vjes4v" />
</bpmn2:endEvent>
<bpmn2:boundaryEvent id="Event_07ol7ch" attachedToRef="Activity_0kftgey">
<bpmn2:outgoing>Flow_0ny162r</bpmn2:outgoing>
<bpmn2:errorEventDefinition id="ErrorEventDefinition_0yv2don" />
</bpmn2:boundaryEvent>
<bpmn2:sequenceFlow id="Flow_0ny162r" sourceRef="Event_07ol7ch" targetRef="Event_1gny0cr" />
<bpmn2:textAnnotation id="TextAnnotation_0bt6e0d">
<bpmn2:text>Anmerkung
* teams-Benachrichtigung nur, wenn teams_channel_url exisitiert</bpmn2:text>
</bpmn2:textAnnotation>
</bpmn2:process>
<bpmn2:message id="Message_13oyyv2" name="action-executed-${execution.getVariable(&#39;smardigoManagementAction&#39;)}" />
<bpmn2:error id="Error_1m76bd5" name="job_template_id not found" errorCode="10" camunda:errorMessage="job_template_id not found" />
<bpmn2:error id="Error_1m76bd5" name="job_template_id not found" errorCode="200" camunda:errorMessage="job_template_id not found" />
<bpmn2:error id="Error_1vjes4v" name="job_template_id not readable" errorCode="100" camunda:errorMessage="job_template_id not readable" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_12geczp">
<bpmndi:BPMNShape id="Participant_08rb9rc_di" bpmnElement="Participant_08rb9rc" isHorizontal="true">
<dc:Bounds x="350" y="150" width="1700" height="460" />
<dc:Bounds x="350" y="150" width="1700" height="420" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_02kqmmg_di" bpmnElement="Event_02kqmmg">
<dc:Bounds x="402" y="392" width="36" height="36" />
@ -139,9 +143,6 @@ processes.byId(contextScopeId, contextProcessId).createComment('current_job_id :
<bpmndi:BPMNShape id="Activity_1olpao9_di" bpmnElement="Activity_1olpao9">
<dc:Bounds x="470" y="370" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1igdww7_di" bpmnElement="Activity_1igdww7">
<dc:Bounds x="880" y="370" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_0n3j4hy_di" bpmnElement="Gateway_0n3j4hy" isMarkerVisible="true">
<dc:Bounds x="605" y="385" width="50" height="50" />
</bpmndi:BPMNShape>
@ -176,12 +177,28 @@ processes.byId(contextScopeId, contextProcessId).createComment('current_job_id :
<bpmndi:BPMNShape id="Gateway_11tein2_di" bpmnElement="Gateway_11tein2" isMarkerVisible="true">
<dc:Bounds x="1045" y="385" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_10n5few_di" bpmnElement="Event_1bfppnu">
<dc:Bounds x="1052" y="242" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1031" y="212" width="78" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_1gjmvpo" bpmnElement="Activity_0kftgey">
<dc:Bounds x="880" y="370" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_10hrh8w" bpmnElement="Event_1gny0cr">
<dc:Bounds x="932" y="242" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="911" y="212" width="78" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="TextAnnotation_0bt6e0d_di" bpmnElement="TextAnnotation_0bt6e0d">
<dc:Bounds x="390" y="240" width="355" height="58" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_10n5few_di" bpmnElement="Event_1bfppnu">
<dc:Bounds x="1052" y="242" width="36" height="36" />
<bpmndi:BPMNShape id="Event_0os3moe_di" bpmnElement="Event_07ol7ch">
<dc:Bounds x="932" y="352" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_1ow8whd_di" bpmnElement="Flow_1ow8whd">
<di:waypoint x="438" y="410" />
@ -201,11 +218,11 @@ processes.byId(contextScopeId, contextProcessId).createComment('current_job_id :
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0tmasvl_di" bpmnElement="Flow_0tmasvl">
<di:waypoint x="630" y="435" />
<di:waypoint x="630" y="550" />
<di:waypoint x="1740" y="550" />
<di:waypoint x="630" y="520" />
<di:waypoint x="1740" y="520" />
<di:waypoint x="1740" y="435" />
<bpmndi:BPMNLabel>
<dc:Bounds x="648" y="533" width="82" height="14" />
<dc:Bounds x="648" y="503" width="82" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1cnt5hf_di" bpmnElement="Flow_1cnt5hf">
@ -253,6 +270,10 @@ processes.byId(contextScopeId, contextProcessId).createComment('current_job_id :
<dc:Bounds x="1081" y="296" width="78" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0ny162r_di" bpmnElement="Flow_0ny162r">
<di:waypoint x="950" y="352" />
<di:waypoint x="950" y="278" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>

Loading…
Cancel
Save