<?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_8"
                  targetNamespace="http://forven.com.br/bpmn">

  <bpmn:collaboration id="Collaboration_8">
    <bpmn:participant id="Participant_8" name="Ordem de Produção" processRef="Process_8" />
  </bpmn:collaboration>

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

    <bpmn:laneSet id="LaneSet_8">
      <bpmn:lane id="Lane_Origem" name="De onde vem a necessidade">
        <bpmn:flowNodeRef>StartEvent_Reposicao</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_ReposicaoEstoque</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>StartEvent_Venda</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_VendaFaturamento</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>StartEvent_Compras</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_InsumoCompras</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="Lane_Producao" name="Sistema (Ordem de Produção)">
        <bpmn:flowNodeRef>Gateway_JoinNecessidade</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_EmiteOP</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_StatusAguardando</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_SeparaInsumos</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_StatusSeparado</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_ApontaProducao</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_StatusFinalizada</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Gateway_ForkEntrega</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="Lane_Entrega" name="O que a OP entrega">
        <bpmn:flowNodeRef>Task_ImprimeEtiquetas</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>EndEvent_Etiquetas</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_ProdutoAcabadoEstoque</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="Lane_Uso" name="Quem usa o resultado">
        <bpmn:flowNodeRef>Gateway_ForkUso</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_FaturamentoItemFabricado</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Task_ControladoriaCusto</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>EndEvent_Faturamento</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>EndEvent_Controladoria</bpmn:flowNodeRef>
      </bpmn:lane>
    </bpmn:laneSet>

    <bpmn:startEvent id="StartEvent_Reposicao" name="Início">
      <bpmn:outgoing>Flow_S1</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:task id="Task_ReposicaoEstoque" name="Reposição de estoque&#10;item abaixo do mínimo">
      <bpmn:incoming>Flow_S1</bpmn:incoming>
      <bpmn:outgoing>Flow_1</bpmn:outgoing>
    </bpmn:task>

    <bpmn:startEvent id="StartEvent_Venda" name="Início">
      <bpmn:outgoing>Flow_S2</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:task id="Task_VendaFaturamento" name="Venda no Faturamento&#10;item ainda não existe fisicamente">
      <bpmn:incoming>Flow_S2</bpmn:incoming>
      <bpmn:outgoing>Flow_2</bpmn:outgoing>
    </bpmn:task>

    <bpmn:startEvent id="StartEvent_Compras" name="Início">
      <bpmn:outgoing>Flow_S3</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:task id="Task_InsumoCompras" name="Insumo recebido em Compras&#10;OP automática a partir da NF-e">
      <bpmn:incoming>Flow_S3</bpmn:incoming>
      <bpmn:outgoing>Flow_3</bpmn:outgoing>
    </bpmn:task>

    <bpmn:parallelGateway id="Gateway_JoinNecessidade">
      <bpmn:incoming>Flow_1</bpmn:incoming>
      <bpmn:incoming>Flow_2</bpmn:incoming>
      <bpmn:incoming>Flow_3</bpmn:incoming>
      <bpmn:outgoing>Flow_4</bpmn:outgoing>
    </bpmn:parallelGateway>

    <bpmn:task id="Task_EmiteOP" name="Emite a Ordem de Produção&#10;Produto Acabado ou&#10;Produto em Processo">
      <bpmn:incoming>Flow_4</bpmn:incoming>
      <bpmn:outgoing>Flow_5</bpmn:outgoing>
    </bpmn:task>

    <bpmn:task id="Task_StatusAguardando" name="Status: Aguardando">
      <bpmn:incoming>Flow_5</bpmn:incoming>
      <bpmn:outgoing>Flow_6</bpmn:outgoing>
    </bpmn:task>

    <bpmn:task id="Task_SeparaInsumos" name="Separa os Insumos&#10;matéria-prima sai do&#10;estoque disponível">
      <bpmn:incoming>Flow_6</bpmn:incoming>
      <bpmn:outgoing>Flow_7</bpmn:outgoing>
    </bpmn:task>

    <bpmn:task id="Task_StatusSeparado" name="Status: Separado">
      <bpmn:incoming>Flow_7</bpmn:incoming>
      <bpmn:outgoing>Flow_8</bpmn:outgoing>
    </bpmn:task>

    <bpmn:task id="Task_ApontaProducao" name="Aponta a produção por turno&#10;operador, quantidade,&#10;perdas, paradas">
      <bpmn:incoming>Flow_8</bpmn:incoming>
      <bpmn:outgoing>Flow_9</bpmn:outgoing>
    </bpmn:task>

    <bpmn:task id="Task_StatusFinalizada" name="Status: Finalizada">
      <bpmn:incoming>Flow_9</bpmn:incoming>
      <bpmn:outgoing>Flow_10</bpmn:outgoing>
    </bpmn:task>

    <bpmn:parallelGateway id="Gateway_ForkEntrega">
      <bpmn:incoming>Flow_10</bpmn:incoming>
      <bpmn:outgoing>Flow_11</bpmn:outgoing>
      <bpmn:outgoing>Flow_12</bpmn:outgoing>
    </bpmn:parallelGateway>

    <bpmn:task id="Task_ImprimeEtiquetas" name="Imprime Etiquetas">
      <bpmn:incoming>Flow_11</bpmn:incoming>
      <bpmn:outgoing>Flow_13</bpmn:outgoing>
    </bpmn:task>

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

    <bpmn:task id="Task_ProdutoAcabadoEstoque" name="Produto acabado entra no&#10;estoque&#10;lote com origem OP">
      <bpmn:incoming>Flow_12</bpmn:incoming>
      <bpmn:outgoing>Flow_14</bpmn:outgoing>
    </bpmn:task>

    <bpmn:parallelGateway id="Gateway_ForkUso">
      <bpmn:incoming>Flow_14</bpmn:incoming>
      <bpmn:outgoing>Flow_15</bpmn:outgoing>
      <bpmn:outgoing>Flow_16</bpmn:outgoing>
    </bpmn:parallelGateway>

    <bpmn:task id="Task_FaturamentoItemFabricado" name="Faturamento&#10;item sai de 'Fabricado' e&#10;pode ser vendido">
      <bpmn:incoming>Flow_15</bpmn:incoming>
      <bpmn:outgoing>Flow_17</bpmn:outgoing>
    </bpmn:task>

    <bpmn:task id="Task_ControladoriaCusto" name="Controladoria&#10;custo real da OP entra na&#10;Rentabilidade">
      <bpmn:incoming>Flow_16</bpmn:incoming>
      <bpmn:outgoing>Flow_18</bpmn:outgoing>
    </bpmn:task>

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

    <bpmn:endEvent id="EndEvent_Controladoria" name="Fim">
      <bpmn:incoming>Flow_18</bpmn:incoming>
    </bpmn:endEvent>

    <bpmn:sequenceFlow id="Flow_S1" sourceRef="StartEvent_Reposicao" targetRef="Task_ReposicaoEstoque" />
    <bpmn:sequenceFlow id="Flow_S2" sourceRef="StartEvent_Venda" targetRef="Task_VendaFaturamento" />
    <bpmn:sequenceFlow id="Flow_S3" sourceRef="StartEvent_Compras" targetRef="Task_InsumoCompras" />
    <bpmn:sequenceFlow id="Flow_1" sourceRef="Task_ReposicaoEstoque" targetRef="Gateway_JoinNecessidade" />
    <bpmn:sequenceFlow id="Flow_2" sourceRef="Task_VendaFaturamento" targetRef="Gateway_JoinNecessidade" />
    <bpmn:sequenceFlow id="Flow_3" sourceRef="Task_InsumoCompras" targetRef="Gateway_JoinNecessidade" />
    <bpmn:sequenceFlow id="Flow_4" sourceRef="Gateway_JoinNecessidade" targetRef="Task_EmiteOP" />
    <bpmn:sequenceFlow id="Flow_5" sourceRef="Task_EmiteOP" targetRef="Task_StatusAguardando" />
    <bpmn:sequenceFlow id="Flow_6" sourceRef="Task_StatusAguardando" targetRef="Task_SeparaInsumos" />
    <bpmn:sequenceFlow id="Flow_7" sourceRef="Task_SeparaInsumos" targetRef="Task_StatusSeparado" />
    <bpmn:sequenceFlow id="Flow_8" sourceRef="Task_StatusSeparado" targetRef="Task_ApontaProducao" />
    <bpmn:sequenceFlow id="Flow_9" sourceRef="Task_ApontaProducao" targetRef="Task_StatusFinalizada" />
    <bpmn:sequenceFlow id="Flow_10" sourceRef="Task_StatusFinalizada" targetRef="Gateway_ForkEntrega" />
    <bpmn:sequenceFlow id="Flow_11" sourceRef="Gateway_ForkEntrega" targetRef="Task_ImprimeEtiquetas" />
    <bpmn:sequenceFlow id="Flow_12" sourceRef="Gateway_ForkEntrega" targetRef="Task_ProdutoAcabadoEstoque" />
    <bpmn:sequenceFlow id="Flow_13" sourceRef="Task_ImprimeEtiquetas" targetRef="EndEvent_Etiquetas" />
    <bpmn:sequenceFlow id="Flow_14" sourceRef="Task_ProdutoAcabadoEstoque" targetRef="Gateway_ForkUso" />
    <bpmn:sequenceFlow id="Flow_15" sourceRef="Gateway_ForkUso" targetRef="Task_FaturamentoItemFabricado" />
    <bpmn:sequenceFlow id="Flow_16" sourceRef="Gateway_ForkUso" targetRef="Task_ControladoriaCusto" />
    <bpmn:sequenceFlow id="Flow_17" sourceRef="Task_FaturamentoItemFabricado" targetRef="EndEvent_Faturamento" />
    <bpmn:sequenceFlow id="Flow_18" sourceRef="Task_ControladoriaCusto" targetRef="EndEvent_Controladoria" />

  </bpmn:process>

  <bpmndi:BPMNDiagram id="BPMNDiagram_8">
    <bpmndi:BPMNPlane id="BPMNPlane_8" bpmnElement="Collaboration_8">

      <bpmndi:BPMNShape id="Participant_8_di" bpmnElement="Participant_8" isHorizontal="true">
        <dc:Bounds x="0" y="0" width="1000" height="1760" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Lane_Origem_di" bpmnElement="Lane_Origem" isHorizontal="true">
        <dc:Bounds x="40" y="0" width="920" height="220" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_Producao_di" bpmnElement="Lane_Producao" isHorizontal="true">
        <dc:Bounds x="40" y="220" width="920" height="880" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_Entrega_di" bpmnElement="Lane_Entrega" isHorizontal="true">
        <dc:Bounds x="40" y="1100" width="920" height="300" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_Uso_di" bpmnElement="Lane_Uso" isHorizontal="true">
        <dc:Bounds x="40" y="1400" width="920" height="340" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="StartEvent_Reposicao_di" bpmnElement="StartEvent_Reposicao">
        <dc:Bounds x="162" y="20" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Task_ReposicaoEstoque_di" bpmnElement="Task_ReposicaoEstoque">
        <dc:Bounds x="70" y="90" width="220" height="70" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="StartEvent_Venda_di" bpmnElement="StartEvent_Venda">
        <dc:Bounds x="442" y="20" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Task_VendaFaturamento_di" bpmnElement="Task_VendaFaturamento">
        <dc:Bounds x="350" y="90" width="220" height="70" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="StartEvent_Compras_di" bpmnElement="StartEvent_Compras">
        <dc:Bounds x="722" y="20" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Task_InsumoCompras_di" bpmnElement="Task_InsumoCompras">
        <dc:Bounds x="630" y="90" width="220" height="70" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Gateway_JoinNecessidade_di" bpmnElement="Gateway_JoinNecessidade" isMarkerVisible="true">
        <dc:Bounds x="435" y="260" width="50" height="50" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Task_EmiteOP_di" bpmnElement="Task_EmiteOP">
        <dc:Bounds x="350" y="360" width="220" height="90" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Task_StatusAguardando_di" bpmnElement="Task_StatusAguardando">
        <dc:Bounds x="350" y="480" width="220" height="70" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Task_SeparaInsumos_di" bpmnElement="Task_SeparaInsumos">
        <dc:Bounds x="350" y="580" width="220" height="90" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Task_StatusSeparado_di" bpmnElement="Task_StatusSeparado">
        <dc:Bounds x="350" y="700" width="220" height="70" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Task_ApontaProducao_di" bpmnElement="Task_ApontaProducao">
        <dc:Bounds x="350" y="800" width="220" height="90" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Task_StatusFinalizada_di" bpmnElement="Task_StatusFinalizada">
        <dc:Bounds x="350" y="920" width="220" height="70" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Gateway_ForkEntrega_di" bpmnElement="Gateway_ForkEntrega" isMarkerVisible="true">
        <dc:Bounds x="435" y="1020" width="50" height="50" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Task_ImprimeEtiquetas_di" bpmnElement="Task_ImprimeEtiquetas">
        <dc:Bounds x="70" y="1140" width="220" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="EndEvent_Etiquetas_di" bpmnElement="EndEvent_Etiquetas">
        <dc:Bounds x="162" y="1240" width="36" height="36" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Task_ProdutoAcabadoEstoque_di" bpmnElement="Task_ProdutoAcabadoEstoque">
        <dc:Bounds x="350" y="1140" width="220" height="90" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Gateway_ForkUso_di" bpmnElement="Gateway_ForkUso" isMarkerVisible="true">
        <dc:Bounds x="435" y="1440" width="50" height="50" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Task_FaturamentoItemFabricado_di" bpmnElement="Task_FaturamentoItemFabricado">
        <dc:Bounds x="150" y="1540" width="220" height="90" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="Task_ControladoriaCusto_di" bpmnElement="Task_ControladoriaCusto">
        <dc:Bounds x="570" y="1540" width="220" height="90" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="EndEvent_Faturamento_di" bpmnElement="EndEvent_Faturamento">
        <dc:Bounds x="242" y="1660" width="36" height="36" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNShape id="EndEvent_Controladoria_di" bpmnElement="EndEvent_Controladoria">
        <dc:Bounds x="662" y="1660" width="36" height="36" />
      </bpmndi:BPMNShape>

      <bpmndi:BPMNEdge id="Flow_S1_di" bpmnElement="Flow_S1">
        <di:waypoint x="180" y="56" />
        <di:waypoint x="180" y="90" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_S2_di" bpmnElement="Flow_S2">
        <di:waypoint x="460" y="56" />
        <di:waypoint x="460" y="90" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_S3_di" bpmnElement="Flow_S3">
        <di:waypoint x="740" y="56" />
        <di:waypoint x="740" y="90" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1_di" bpmnElement="Flow_1">
        <di:waypoint x="180" y="160" />
        <di:waypoint x="180" y="285" />
        <di:waypoint x="435" y="285" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_2_di" bpmnElement="Flow_2">
        <di:waypoint x="460" y="160" />
        <di:waypoint x="460" y="260" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_3_di" bpmnElement="Flow_3">
        <di:waypoint x="740" y="160" />
        <di:waypoint x="740" y="285" />
        <di:waypoint x="485" y="285" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_4_di" bpmnElement="Flow_4">
        <di:waypoint x="460" y="310" />
        <di:waypoint x="460" y="360" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_5_di" bpmnElement="Flow_5">
        <di:waypoint x="460" y="450" />
        <di:waypoint x="460" y="480" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_6_di" bpmnElement="Flow_6">
        <di:waypoint x="460" y="550" />
        <di:waypoint x="460" y="580" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_7_di" bpmnElement="Flow_7">
        <di:waypoint x="460" y="670" />
        <di:waypoint x="460" y="700" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_8_di" bpmnElement="Flow_8">
        <di:waypoint x="460" y="770" />
        <di:waypoint x="460" y="800" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_9_di" bpmnElement="Flow_9">
        <di:waypoint x="460" y="890" />
        <di:waypoint x="460" y="920" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_10_di" bpmnElement="Flow_10">
        <di:waypoint x="460" y="990" />
        <di:waypoint x="460" y="1020" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_11_di" bpmnElement="Flow_11">
        <di:waypoint x="435" y="1045" />
        <di:waypoint x="180" y="1045" />
        <di:waypoint x="180" y="1140" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_12_di" bpmnElement="Flow_12">
        <di:waypoint x="460" y="1070" />
        <di:waypoint x="460" y="1140" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_13_di" bpmnElement="Flow_13">
        <di:waypoint x="180" y="1210" />
        <di:waypoint x="180" y="1240" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_14_di" bpmnElement="Flow_14">
        <di:waypoint x="460" y="1230" />
        <di:waypoint x="460" y="1440" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_15_di" bpmnElement="Flow_15">
        <di:waypoint x="435" y="1465" />
        <di:waypoint x="260" y="1465" />
        <di:waypoint x="260" y="1540" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_16_di" bpmnElement="Flow_16">
        <di:waypoint x="485" y="1465" />
        <di:waypoint x="680" y="1465" />
        <di:waypoint x="680" y="1540" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_17_di" bpmnElement="Flow_17">
        <di:waypoint x="260" y="1630" />
        <di:waypoint x="260" y="1660" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_18_di" bpmnElement="Flow_18">
        <di:waypoint x="680" y="1630" />
        <di:waypoint x="680" y="1660" />
      </bpmndi:BPMNEdge>

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

</bpmn:definitions>
