DEV-500 bugfix: backwards compatibility for processes

- added null check to variable usages for newly added
  variables. some older processes ran into npe's
feature/SC-55
Sven Ketelsen 4 years ago
parent 454b04838f
commit c2a323789a

@ -1200,6 +1200,7 @@ Variables.userId(authenticatedUserId)</camunda:script>
<bpmn2:incoming>Flow_1kxc9t0</bpmn2:incoming> <bpmn2:incoming>Flow_1kxc9t0</bpmn2:incoming>
<bpmn2:outgoing>Flow_1nuku1o</bpmn2:outgoing> <bpmn2:outgoing>Flow_1nuku1o</bpmn2:outgoing>
<bpmn2:script>def jobs = processes.byId(contextScopeId, contextProcessId).getVariable('jobs') <bpmn2:script>def jobs = processes.byId(contextScopeId, contextProcessId).getVariable('jobs')
jobs = !!jobs ? jobs : []
jobs.add(0, awxResponse.job) jobs.add(0, awxResponse.job)
processes.byId(contextScopeId, contextProcessId).setVariable('jobs', jobs) processes.byId(contextScopeId, contextProcessId).setVariable('jobs', jobs)
@ -1248,6 +1249,10 @@ processes.byId(contextScopeId, contextProcessId).createComment('current_job_id :
<bpmndi:BPMNShape id="Participant_19lpjee_di" bpmnElement="Participant_19lpjee" isHorizontal="true"> <bpmndi:BPMNShape id="Participant_19lpjee_di" bpmnElement="Participant_19lpjee" isHorizontal="true">
<dc:Bounds x="160" y="900" width="6160" height="3650" /> <dc:Bounds x="160" y="900" width="6160" height="3650" />
</bpmndi:BPMNShape> </bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_11fywti_di" bpmnElement="Flow_11fywti">
<di:waypoint x="5290" y="2900" />
<di:waypoint x="5322" y="2900" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1d07vge_di" bpmnElement="Flow_1d07vge"> <bpmndi:BPMNEdge id="Flow_1d07vge_di" bpmnElement="Flow_1d07vge">
<di:waypoint x="3135" y="2900" /> <di:waypoint x="3135" y="2900" />
<di:waypoint x="3172" y="2900" /> <di:waypoint x="3172" y="2900" />
@ -1488,10 +1493,6 @@ processes.byId(contextScopeId, contextProcessId).createComment('current_job_id :
<di:waypoint x="460" y="1170" /> <di:waypoint x="460" y="1170" />
<di:waypoint x="512" y="1170" /> <di:waypoint x="512" y="1170" />
</bpmndi:BPMNEdge> </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_11fywti_di" bpmnElement="Flow_11fywti">
<di:waypoint x="5290" y="2900" />
<di:waypoint x="5322" y="2900" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="Activity_0bhz4p5_di" bpmnElement="Activity_1lo3ui2"> <bpmndi:BPMNShape id="Activity_0bhz4p5_di" bpmnElement="Activity_1lo3ui2">
<dc:Bounds x="1540" y="2860" width="100" height="80" /> <dc:Bounds x="1540" y="2860" width="100" height="80" />
</bpmndi:BPMNShape> </bpmndi:BPMNShape>
@ -1555,18 +1556,6 @@ processes.byId(contextScopeId, contextProcessId).createComment('current_job_id :
<bpmndi:BPMNShape id="Event_0ermhxm_di" bpmnElement="Event_0ermhxm"> <bpmndi:BPMNShape id="Event_0ermhxm_di" bpmnElement="Event_0ermhxm">
<dc:Bounds x="1282" y="2522" width="36" height="36" /> <dc:Bounds x="1282" y="2522" width="36" height="36" />
</bpmndi:BPMNShape> </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_1kf2vmb" bpmnElement="Activity_0q5gizt" bioc:stroke="#8e24aa" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#8e24aa">
<dc:Bounds x="5190" y="2860" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0srogfc_di" bpmnElement="Event_0srogfc" bioc:stroke="rgb(142, 36, 170)" bioc:fill="rgb(225, 190, 231)">
<dc:Bounds x="5322" y="2882" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="5300" y="2936" width="81" height="40" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0s3gf3u_di" bpmnElement="Event_0flb2m7">
<dc:Bounds x="5386" y="2882" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_17cc1q7_di" bpmnElement="Activity_17cc1q7" isExpanded="true"> <bpmndi:BPMNShape id="Activity_17cc1q7_di" bpmnElement="Activity_17cc1q7" isExpanded="true">
<dc:Bounds x="1120" y="2230" width="350" height="200" /> <dc:Bounds x="1120" y="2230" width="350" height="200" />
</bpmndi:BPMNShape> </bpmndi:BPMNShape>
@ -1608,6 +1597,10 @@ processes.byId(contextScopeId, contextProcessId).createComment('current_job_id :
<bpmndi:BPMNShape id="Activity_1t8u7l0_di" bpmnElement="Activity_1t8u7l0" isExpanded="true"> <bpmndi:BPMNShape id="Activity_1t8u7l0_di" bpmnElement="Activity_1t8u7l0" isExpanded="true">
<dc:Bounds x="1590" y="3340" width="3832" height="940" /> <dc:Bounds x="1590" y="3340" width="3832" height="940" />
</bpmndi:BPMNShape> </bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_05lm53t_di" bpmnElement="Flow_05lm53t">
<di:waypoint x="4640" y="3890" />
<di:waypoint x="4672" y="3890" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1wmjqng_di" bpmnElement="Flow_1wmjqng"> <bpmndi:BPMNEdge id="Flow_1wmjqng_di" bpmnElement="Flow_1wmjqng">
<di:waypoint x="4708" y="3890" /> <di:waypoint x="4708" y="3890" />
<di:waypoint x="4732" y="3890" /> <di:waypoint x="4732" y="3890" />
@ -1815,10 +1808,6 @@ processes.byId(contextScopeId, contextProcessId).createComment('current_job_id :
<di:waypoint x="3570" y="3480" /> <di:waypoint x="3570" y="3480" />
<di:waypoint x="3630" y="3480" /> <di:waypoint x="3630" y="3480" />
</bpmndi:BPMNEdge> </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_05lm53t_di" bpmnElement="Flow_05lm53t">
<di:waypoint x="4640" y="3890" />
<di:waypoint x="4672" y="3890" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="Event_1xmnacj_di" bpmnElement="Event_1xmnacj"> <bpmndi:BPMNShape id="Event_1xmnacj_di" bpmnElement="Event_1xmnacj">
<dc:Bounds x="2462" y="3872" width="36" height="36" /> <dc:Bounds x="2462" y="3872" width="36" height="36" />
</bpmndi:BPMNShape> </bpmndi:BPMNShape>
@ -1858,6 +1847,12 @@ processes.byId(contextScopeId, contextProcessId).createComment('current_job_id :
<bpmndi:BPMNShape id="Activity_0p94lww_di" bpmnElement="Activity_0p94lww" bioc:stroke="#fb8c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#fb8c00"> <bpmndi:BPMNShape id="Activity_0p94lww_di" bpmnElement="Activity_0p94lww" bioc:stroke="#fb8c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#fb8c00">
<dc:Bounds x="3150" y="3590" width="100" height="80" /> <dc:Bounds x="3150" y="3590" width="100" height="80" />
</bpmndi:BPMNShape> </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0hgkn8g_di" bpmnElement="Event_0hgkn8g" bioc:stroke="#fb8c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#fb8c00">
<dc:Bounds x="4732" y="3872" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="4778" y="3883" width="63" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_19yp0ta_di" bpmnElement="Gateway_19yp0ta" isMarkerVisible="true"> <bpmndi:BPMNShape id="Gateway_19yp0ta_di" bpmnElement="Gateway_19yp0ta" isMarkerVisible="true">
<dc:Bounds x="4455" y="3865" width="50" height="50" /> <dc:Bounds x="4455" y="3865" width="50" height="50" />
</bpmndi:BPMNShape> </bpmndi:BPMNShape>
@ -1939,20 +1934,14 @@ processes.byId(contextScopeId, contextProcessId).createComment('current_job_id :
<bpmndi:BPMNShape id="Gateway_02sf9h9_di" bpmnElement="Gateway_02sf9h9" isMarkerVisible="true"> <bpmndi:BPMNShape id="Gateway_02sf9h9_di" bpmnElement="Gateway_02sf9h9" isMarkerVisible="true">
<dc:Bounds x="3175" y="4125" width="50" height="50" /> <dc:Bounds x="3175" y="4125" width="50" height="50" />
</bpmndi:BPMNShape> </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_0awnvel" bpmnElement="Activity_1ajtp80" bioc:stroke="#fb8c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#fb8c00">
<dc:Bounds x="4540" y="3850" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0mr6ye0_di" bpmnElement="Event_0mr6ye0" bioc:stroke="#43a047" bioc:fill="#c8e6c9" color:background-color="#c8e6c9" color:border-color="#43a047"> <bpmndi:BPMNShape id="Event_0mr6ye0_di" bpmnElement="Event_0mr6ye0" bioc:stroke="#43a047" bioc:fill="#c8e6c9" color:background-color="#c8e6c9" color:border-color="#43a047">
<dc:Bounds x="4672" y="3872" width="36" height="36" /> <dc:Bounds x="4672" y="3872" width="36" height="36" />
<bpmndi:BPMNLabel> <bpmndi:BPMNLabel>
<dc:Bounds x="4649" y="3926" width="83" height="40" /> <dc:Bounds x="4649" y="3926" width="83" height="40" />
</bpmndi:BPMNLabel> </bpmndi:BPMNLabel>
</bpmndi:BPMNShape> </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0hgkn8g_di" bpmnElement="Event_0hgkn8g" bioc:stroke="#fb8c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#fb8c00"> <bpmndi:BPMNShape id="BPMNShape_0awnvel" bpmnElement="Activity_1ajtp80" bioc:stroke="#fb8c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#fb8c00">
<dc:Bounds x="4732" y="3872" width="36" height="36" /> <dc:Bounds x="4540" y="3850" width="100" height="80" />
<bpmndi:BPMNLabel>
<dc:Bounds x="4778" y="3883" width="63" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape> </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0si6lsk_di" bpmnElement="Event_0si6lsk"> <bpmndi:BPMNShape id="Event_0si6lsk_di" bpmnElement="Event_0si6lsk">
<dc:Bounds x="5562" y="3412" width="36" height="36" /> <dc:Bounds x="5562" y="3412" width="36" height="36" />
@ -2139,6 +2128,18 @@ processes.byId(contextScopeId, contextProcessId).createComment('current_job_id :
<dc:Bounds x="3148" y="2832" width="83" height="40" /> <dc:Bounds x="3148" y="2832" width="83" height="40" />
</bpmndi:BPMNLabel> </bpmndi:BPMNLabel>
</bpmndi:BPMNShape> </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_1kf2vmb" bpmnElement="Activity_0q5gizt" bioc:stroke="#8e24aa" bioc:fill="#e1bee7" color:background-color="#e1bee7" color:border-color="#8e24aa">
<dc:Bounds x="5190" y="2860" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0srogfc_di" bpmnElement="Event_0srogfc" bioc:stroke="rgb(142, 36, 170)" bioc:fill="rgb(225, 190, 231)">
<dc:Bounds x="5322" y="2882" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="5300" y="2936" width="81" height="40" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0s3gf3u_di" bpmnElement="Event_0flb2m7">
<dc:Bounds x="5386" y="2882" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_007p32d_di" bpmnElement="Event_007p32d" bioc:stroke="#fb8c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#fb8c00"> <bpmndi:BPMNShape id="Event_007p32d_di" bpmnElement="Event_007p32d" bioc:stroke="#fb8c00" bioc:fill="#ffe0b2" color:background-color="#ffe0b2" color:border-color="#fb8c00">
<dc:Bounds x="2142" y="1812" width="36" height="36" /> <dc:Bounds x="2142" y="1812" width="36" height="36" />
<bpmndi:BPMNLabel> <bpmndi:BPMNLabel>

@ -13,12 +13,12 @@ def env = [
smardigo_management_action: smardigoManagementAction, smardigo_management_action: smardigoManagementAction,
stage: cluster.stage, stage: cluster.stage,
tenant_id: tenant.key, tenant_id: tenant.key,
connect_client_admin_username: connect_admin_username, connect_client_admin_username: binding.hasVariable('connect_admin_username') ? connect_admin_username : '',
connect_client_admin_password: connect_admin_password, connect_client_admin_password: binding.hasVariable('connect_admin_password') ? connect_admin_password : '',
connect_realm_admin_username: keycloak_admin_username, connect_realm_admin_username: binding.hasVariable('keycloak_admin_username') ? keycloak_admin_username : '',
connect_realm_admin_password: keycloak_admin_password, connect_realm_admin_password: binding.hasVariable('keycloak_admin_password') ? keycloak_admin_password : '',
wordpress_admin_username: wordpress_admin_username, wordpress_admin_username: binding.hasVariable('wordpress_admin_username') ? wordpress_admin_username : '',
wordpress_admin_password: wordpress_admin_password wordpress_admin_password: binding.hasVariable('wordpress_admin_password') ? wordpress_admin_password : ''
] ]
if (binding.hasVariable('extraVariables')) { if (binding.hasVariable('extraVariables')) {
env << extraVariables env << extraVariables

@ -13,12 +13,12 @@ def env = [
smardigo_management_action: smardigoManagementAction, smardigo_management_action: smardigoManagementAction,
stage: cluster.stage, stage: cluster.stage,
tenant_id: tenant.key, tenant_id: tenant.key,
connect_client_admin_username: connect_admin_username, connect_client_admin_username: binding.hasVariable('connect_admin_username') ? connect_admin_username : '',
connect_client_admin_password: connect_admin_password, connect_client_admin_password: binding.hasVariable('connect_admin_password') ? connect_admin_password : '',
connect_realm_admin_username: keycloak_admin_username, connect_realm_admin_username: binding.hasVariable('keycloak_admin_username') ? keycloak_admin_username : '',
connect_realm_admin_password: keycloak_admin_password, connect_realm_admin_password: binding.hasVariable('keycloak_admin_password') ? keycloak_admin_password : '',
wordpress_admin_username: wordpress_admin_username, wordpress_admin_username: binding.hasVariable('wordpress_admin_username') ? wordpress_admin_username : '',
wordpress_admin_password: wordpress_admin_password wordpress_admin_password: binding.hasVariable('wordpress_admin_password') ? wordpress_admin_password : ''
] ]
if (binding.hasVariable('extraVariables')) { if (binding.hasVariable('extraVariables')) {
env << extraVariables env << extraVariables

Loading…
Cancel
Save