<?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:di="http://www.omg.org/spec/DD/20100524/DI"
                  id="Definitions_9"
                  targetNamespace="http://forven.com.br/bpmn">

  <bpmn:collaboration id="Collaboration_9">
    <bpmn:participant id="Participant_9" name="Cenário de Custo" processRef="Process_9" />
  </bpmn:collaboration>

  <bpmn:process id="Process_9" isExecutable="false">

    <bpmn:laneSet id="LaneSet_9">
      <bpmn:lane id="Lane_MontandoCenario" name="Montando o Cenário de Custo">
        <bpmn:flowNodeRef>StartEvent_1</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_CriaCenario</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_LancaCustoPrimario</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_FinalizarInsumos</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_LancaCustosProdutoAcabado</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_FinalizarGeraPrecos</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="Lane_Resultado" name="Resultado">
        <bpmn:flowNodeRef>Task_CenarioFinalizado</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_UsadoComoFiltro</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="Lane_Comparacao" name="Comparado com os dados reais">
        <bpmn:flowNodeRef>Gateway_Fork</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_Estoque</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_PCP</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_Faturamento</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>EndEvent_Estoque</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>EndEvent_PCP</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>EndEvent_Faturamento</bpmn:flowNodeRef>
      </bpmn:lane>
    </bpmn:laneSet>

    <bpmn:startEvent id="StartEvent_1" name="Início">
      <bpmn:outgoing>Flow_S1</bpmn:outgoing>
    </bpmn:startEvent>

    <bpmn:task id="Task_CriaCenario" name="Cria o cenário&#10;empresas + pesos gerais:&#10;PIS, COFINS, IPI, CSLL...">
      <bpmn:incoming>Flow_S1</bpmn:incoming>
      <bpmn:outgoing>Flow_1</bpmn:outgoing>
    </bpmn:task>

    <bpmn:task id="Task_LancaCustoPrimario" name="Lança o custo primário&#10;de cada insumo">
      <bpmn:incoming>Flow_1</bpmn:incoming>
      <bpmn:outgoing>Flow_2</bpmn:outgoing>
    </bpmn:task>

    <bpmn:task id="Task_FinalizarInsumos" name="Finalizar Insumos">
      <bpmn:incoming>Flow_2</bpmn:incoming>
      <bpmn:outgoing>Flow_3</bpmn:outgoing>
    </bpmn:task>

    <bpmn:task id="Task_LancaCustosProdutoAcabado" name="Lança os custos do produto&#10;acabado&#10;Primário vem herdado dos&#10;insumos">
      <bpmn:incoming>Flow_3</bpmn:incoming>
      <bpmn:outgoing>Flow_4</bpmn:outgoing>
    </bpmn:task>

    <bpmn:task id="Task_FinalizarGeraPrecos" name="Finalizar / Gera Preços">
      <bpmn:incoming>Flow_4</bpmn:incoming>
      <bpmn:outgoing>Flow_5</bpmn:outgoing>
    </bpmn:task>

    <bpmn:task id="Task_CenarioFinalizado" name="Cenário finalizado">
      <bpmn:incoming>Flow_5</bpmn:incoming>
      <bpmn:outgoing>Flow_6</bpmn:outgoing>
    </bpmn:task>

    <bpmn:task id="Task_UsadoComoFiltro" name="Usado como filtro no&#10;Relatório de Rentabilidade">
      <bpmn:incoming>Flow_6</bpmn:incoming>
      <bpmn:outgoing>Flow_7</bpmn:outgoing>
    </bpmn:task>

    <bpmn:parallelGateway id="Gateway_Fork">
      <bpmn:incoming>Flow_7</bpmn:incoming>
      <bpmn:outgoing>Flow_8</bpmn:outgoing>
      <bpmn:outgoing>Flow_9</bpmn:outgoing>
      <bpmn:outgoing>Flow_10</bpmn:outgoing>
    </bpmn:parallelGateway>

    <bpmn:task id="Task_Estoque" name="Estoque&#10;rastreamento de insumos e&#10;produtos">
      <bpmn:incoming>Flow_8</bpmn:incoming>
      <bpmn:outgoing>Flow_11</bpmn:outgoing>
    </bpmn:task>

    <bpmn:task id="Task_PCP" name="PCP&#10;custo real por Ordem de&#10;Produção">
      <bpmn:incoming>Flow_9</bpmn:incoming>
      <bpmn:outgoing>Flow_12</bpmn:outgoing>
    </bpmn:task>

    <bpmn:task id="Task_Faturamento" name="Faturamento&#10;vendas e notas fiscais">
      <bpmn:incoming>Flow_10</bpmn:incoming>
      <bpmn:outgoing>Flow_13</bpmn:outgoing>
    </bpmn:task>

    <bpmn:endEvent id="EndEvent_Estoque" name="Fim">
      <bpmn:incoming>Flow_11</bpmn:incoming>
    </bpmn:endEvent>

    <bpmn:endEvent id="EndEvent_PCP" name="Fim">
      <bpmn:incoming>Flow_12</bpmn:incoming>
    </bpmn:endEvent>

    <bpmn:endEvent id="EndEvent_Faturamento" name="Fim">
      <bpmn:incoming>Flow_13</bpmn:incoming>
    </bpmn:endEvent>

    <bpmn:sequenceFlow id="Flow_S1" sourceRef="StartEvent_1" targetRef="Task_CriaCenario" />
    <bpmn:sequenceFlow id="Flow_1" sourceRef="Task_CriaCenario" targetRef="Task_LancaCustoPrimario" />
    <bpmn:sequenceFlow id="Flow_2" sourceRef="Task_LancaCustoPrimario" targetRef="Task_FinalizarInsumos" />
    <bpmn:sequenceFlow id="Flow_3" sourceRef="Task_FinalizarInsumos" targetRef="Task_LancaCustosProdutoAcabado" />
    <bpmn:sequenceFlow id="Flow_4" sourceRef="Task_LancaCustosProdutoAcabado" targetRef="Task_FinalizarGeraPrecos" />
    <bpmn:sequenceFlow id="Flow_5" sourceRef="Task_FinalizarGeraPrecos" targetRef="Task_CenarioFinalizado" />
    <bpmn:sequenceFlow id="Flow_6" sourceRef="Task_CenarioFinalizado" targetRef="Task_UsadoComoFiltro" />
    <bpmn:sequenceFlow id="Flow_7" sourceRef="Task_UsadoComoFiltro" targetRef="Gateway_Fork" />
    <bpmn:sequenceFlow id="Flow_8" sourceRef="Gateway_Fork" targetRef="Task_Estoque" />
    <bpmn:sequenceFlow id="Flow_9" sourceRef="Gateway_Fork" targetRef="Task_PCP" />
    <bpmn:sequenceFlow id="Flow_10" sourceRef="Gateway_Fork" targetRef="Task_Faturamento" />
    <bpmn:sequenceFlow id="Flow_11" sourceRef="Task_Estoque" targetRef="EndEvent_Estoque" />
    <bpmn:sequenceFlow id="Flow_12" sourceRef="Task_PCP" targetRef="EndEvent_PCP" />
    <bpmn:sequenceFlow id="Flow_13" sourceRef="Task_Faturamento" targetRef="EndEvent_Faturamento" />

  </bpmn:process>

  <bpmndi:BPMNDiagram id="BPMNDiagram_9">
    <bpmndi:BPMNPlane id="BPMNPlane_9" bpmnElement="Collaboration_9">

      <bpmndi:BPMNShape id="Participant_9_di" bpmnElement="Participant_9" isHorizontal="true">
        <dc:Bounds x="0" y="0" width="880" height="1550" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Lane_MontandoCenario_di" bpmnElement="Lane_MontandoCenario" isHorizontal="true">
        <dc:Bounds x="40" y="0" width="800" height="900" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_Resultado_di" bpmnElement="Lane_Resultado" isHorizontal="true">
        <dc:Bounds x="40" y="900" width="800" height="300" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_Comparacao_di" bpmnElement="Lane_Comparacao" isHorizontal="true">
        <dc:Bounds x="40" y="1200" width="800" height="350" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">
        <dc:Bounds x="382" y="20" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Task_CriaCenario_di" bpmnElement="Task_CriaCenario">
        <dc:Bounds x="270" y="70" width="260" height="110" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Task_LancaCustoPrimario_di" bpmnElement="Task_LancaCustoPrimario">
        <dc:Bounds x="290" y="230" width="220" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Task_FinalizarInsumos_di" bpmnElement="Task_FinalizarInsumos">
        <dc:Bounds x="305" y="360" width="190" height="60" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Task_LancaCustosProdutoAcabado_di" bpmnElement="Task_LancaCustosProdutoAcabado">
        <dc:Bounds x="270" y="480" width="260" height="110" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Task_FinalizarGeraPrecos_di" bpmnElement="Task_FinalizarGeraPrecos">
        <dc:Bounds x="290" y="650" width="220" height="60" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Task_CenarioFinalizado_di" bpmnElement="Task_CenarioFinalizado">
        <dc:Bounds x="305" y="940" width="190" height="60" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Task_UsadoComoFiltro_di" bpmnElement="Task_UsadoComoFiltro">
        <dc:Bounds x="280" y="1060" width="240" height="80" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Gateway_Fork_di" bpmnElement="Gateway_Fork" isMarkerVisible="true">
        <dc:Bounds x="375" y="1230" width="50" height="50" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Task_Estoque_di" bpmnElement="Task_Estoque">
        <dc:Bounds x="70" y="1330" width="220" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Task_PCP_di" bpmnElement="Task_PCP">
        <dc:Bounds x="290" y="1330" width="220" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Task_Faturamento_di" bpmnElement="Task_Faturamento">
        <dc:Bounds x="570" y="1330" width="220" height="70" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="EndEvent_Estoque_di" bpmnElement="EndEvent_Estoque">
        <dc:Bounds x="162" y="1440" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="EndEvent_PCP_di" bpmnElement="EndEvent_PCP">
        <dc:Bounds x="382" y="1440" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="EndEvent_Faturamento_di" bpmnElement="EndEvent_Faturamento">
        <dc:Bounds x="662" y="1430" width="36" height="36" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNEdge id="Flow_S1_di" bpmnElement="Flow_S1">
        <di:waypoint x="400" y="56" />
        <di:waypoint x="400" y="70" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1_di" bpmnElement="Flow_1">
        <di:waypoint x="400" y="180" />
        <di:waypoint x="400" y="230" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_2_di" bpmnElement="Flow_2">
        <di:waypoint x="400" y="310" />
        <di:waypoint x="400" y="360" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_3_di" bpmnElement="Flow_3">
        <di:waypoint x="400" y="420" />
        <di:waypoint x="400" y="480" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_4_di" bpmnElement="Flow_4">
        <di:waypoint x="400" y="590" />
        <di:waypoint x="400" y="650" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_5_di" bpmnElement="Flow_5">
        <di:waypoint x="400" y="710" />
        <di:waypoint x="400" y="940" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_6_di" bpmnElement="Flow_6">
        <di:waypoint x="400" y="1000" />
        <di:waypoint x="400" y="1060" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_7_di" bpmnElement="Flow_7">
        <di:waypoint x="400" y="1140" />
        <di:waypoint x="400" y="1230" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_8_di" bpmnElement="Flow_8">
        <di:waypoint x="375" y="1255" />
        <di:waypoint x="180" y="1255" />
        <di:waypoint x="180" y="1330" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_9_di" bpmnElement="Flow_9">
        <di:waypoint x="400" y="1280" />
        <di:waypoint x="400" y="1330" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_10_di" bpmnElement="Flow_10">
        <di:waypoint x="425" y="1255" />
        <di:waypoint x="680" y="1255" />
        <di:waypoint x="680" y="1330" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_11_di" bpmnElement="Flow_11">
        <di:waypoint x="180" y="1410" />
        <di:waypoint x="180" y="1440" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_12_di" bpmnElement="Flow_12">
        <di:waypoint x="400" y="1410" />
        <di:waypoint x="400" y="1440" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_13_di" bpmnElement="Flow_13">
        <di:waypoint x="680" y="1400" />
        <di:waypoint x="680" y="1430" />
      </bpmndi:BPMNEdge>

    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>

</bpmn:definitions>
