<?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_0xa9h1i" targetNamespace="auto" exporter="Camunda Modeler" exporterVersion="5.10.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.15.0">
  <bpmn:process id="modifyPhases" name="LBL_MODIFIER_TACHE_STATUT_PHASE_STATUT" isExecutable="true">
    <bpmn:extensionElements>
      <camunda:properties>
        <camunda:property name="forTask" value="true" />
        <camunda:property name="codeVar1-objectDefinedType" value="PHASE" />
        <camunda:property name="codeVar1-attributeListCode" value="ETAT" />
      </camunda:properties>
    </bpmn:extensionElements>
    <bpmn:startEvent id="StartEvent_1" name="LBL_DEBUT">
      <bpmn:outgoing>Flow_0p80rw2</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:serviceTask id="Activity_0z0sq6d" name="LBL_MODIFIER_PHASE_STATUT">
      <bpmn:extensionElements>
        <camunda:connector>
          <camunda:inputOutput>
            <camunda:inputParameter name="headers">
              <camunda:map>
                <camunda:entry key="Accept">application/json</camunda:entry>
                <camunda:entry key="Content-type">application/json</camunda:entry>
                <camunda:entry key="X-PM-API-ID">#{execution.getVariable('userCamundaId')}</camunda:entry>
              </camunda:map>
            </camunda:inputParameter>
            <camunda:inputParameter name="method">POST</camunda:inputParameter>
            <camunda:inputParameter name="url">http://localhost:#{execution.getVariable('port')}/monitorupgrade/phases/task/#{execution.getVariable('objectId')}/status/#{execution.getVariable('codeVar1')}</camunda:inputParameter>
            <camunda:outputParameter name="errorLabel">
              <camunda:script scriptFormat="JavaScript">var statusCode = connector.getVariable('statusCode');
if (statusCode &gt;= 400) {
 var response = JSON.parse(connector.getVariable('response'));
 if (response.message) {
   response.message;
 } else if (response.error) {
   response.error;
 } else if (response[0] &amp;&amp; response[0].beanWsErreur &amp;&amp; response[0].beanWsErreur.message) {
   response[0].beanWsErreur.message;
 }
}
</camunda:script>
            </camunda:outputParameter>
            <camunda:outputParameter name="warningsLabel">
              <camunda:script scriptFormat="JavaScript">var headers = connector.getVariable('headers');
if (headers.get('X-Context-Warning')) {
  headers.get('X-Context-Warning');
}
</camunda:script>
            </camunda:outputParameter>
            <camunda:outputParameter name="infosLabel">
              <camunda:script scriptFormat="JavaScript">var headers = connector.getVariable('headers');
if (headers.get('X-Context-Info')) {
  headers.get('X-Context-Info');
}
</camunda:script>
            </camunda:outputParameter>
          </camunda:inputOutput>
          <camunda:connectorId>http-connector</camunda:connectorId>
        </camunda:connector>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_0p80rw2</bpmn:incoming>
      <bpmn:outgoing>Flow_0737tqt</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:endEvent id="Event_1uf4bec" name="LBL_FIN">
      <bpmn:incoming>Flow_0737tqt</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_0p80rw2" sourceRef="StartEvent_1" targetRef="Activity_0z0sq6d" />
    <bpmn:sequenceFlow id="Flow_0737tqt" sourceRef="Activity_0z0sq6d" targetRef="Event_1uf4bec" />
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="modifyTasks">
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="172" y="99" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="160" y="142" width="63" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_0arcaba_di" bpmnElement="Activity_0z0sq6d">
        <dc:Bounds x="290" y="77" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1uf4bec_di" bpmnElement="Event_1uf4bec">
        <dc:Bounds x="472" y="99" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="482" y="142" width="16" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_0p80rw2_di" bpmnElement="Flow_0p80rw2">
        <di:waypoint x="208" y="117" />
        <di:waypoint x="290" y="117" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0737tqt_di" bpmnElement="Flow_0737tqt">
        <di:waypoint x="390" y="117" />
        <di:waypoint x="472" y="117" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
