<?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" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:modeler="http://camunda.org/schema/modeler/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="@bpmnkit/core" exporterVersion="0.0.23" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.9.0">
  <bpmn:process id="content-review" name="Editorial Content Review" isExecutable="true">
    <bpmn:extensionElements>
      <zeebe:versionTag value="1.0.0"/>
    </bpmn:extensionElements>
    <bpmn:startEvent id="draft-submitted" name="Draft submitted">
      <bpmn:outgoing>Flow_draft-submitted_automated-checks</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:serviceTask id="automated-checks" name="Run automated checks">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="content-lint"/>
        <zeebe:ioMapping>
          <zeebe:output source="=issues" target="lintIssues"/>
          <zeebe:output source="=readingTime" target="readingTime"/>
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_draft-submitted_automated-checks</bpmn:incoming>
      <bpmn:outgoing>Flow_automated-checks_editorial-review</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:userTask id="editorial-review" name="Editorial review">
      <bpmn:extensionElements>
        <zeebe:userTask/>
        <zeebe:formDefinition formId="editorial-review"/>
        <zeebe:assignmentDefinition candidateGroups="editors"/>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_automated-checks_editorial-review</bpmn:incoming>
      <bpmn:outgoing>Flow_editorial-review_verdict</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:exclusiveGateway id="verdict" name="Verdict?" default="Flow_verdict_archive-draft">
      <bpmn:incoming>Flow_editorial-review_verdict</bpmn:incoming>
      <bpmn:outgoing>Flow_verdict_publish</bpmn:outgoing>
      <bpmn:outgoing>Flow_verdict_return-to-author</bpmn:outgoing>
      <bpmn:outgoing>Flow_verdict_archive-draft</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:serviceTask id="publish" name="Publish to CMS">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="cms-publish"/>
        <zeebe:ioMapping>
          <zeebe:output source="=url" target="publishedUrl"/>
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_verdict_publish</bpmn:incoming>
      <bpmn:outgoing>Flow_publish_published</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:endEvent id="published" name="Published">
      <bpmn:incoming>Flow_publish_published</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:serviceTask id="return-to-author" name="Return to author">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="author-notify"/>
        <zeebe:ioMapping>
          <zeebe:input source="=editorComment" target="message"/>
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_verdict_return-to-author</bpmn:incoming>
      <bpmn:outgoing>Flow_return-to-author_returned</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:endEvent id="returned" name="Returned for revision">
      <bpmn:incoming>Flow_return-to-author_returned</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:serviceTask id="archive-draft" name="Archive draft">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="cms-archive"/>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_verdict_archive-draft</bpmn:incoming>
      <bpmn:outgoing>Flow_archive-draft_rejected</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:endEvent id="rejected" name="Rejected">
      <bpmn:incoming>Flow_archive-draft_rejected</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_draft-submitted_automated-checks" sourceRef="draft-submitted" targetRef="automated-checks"/>
    <bpmn:sequenceFlow id="Flow_automated-checks_editorial-review" sourceRef="automated-checks" targetRef="editorial-review"/>
    <bpmn:sequenceFlow id="Flow_editorial-review_verdict" sourceRef="editorial-review" targetRef="verdict"/>
    <bpmn:sequenceFlow id="Flow_verdict_publish" sourceRef="verdict" targetRef="publish" name="publish">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=decision = "publish"</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="Flow_publish_published" sourceRef="publish" targetRef="published"/>
    <bpmn:sequenceFlow id="Flow_verdict_return-to-author" sourceRef="verdict" targetRef="return-to-author" name="revise">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=decision = "revise"</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="Flow_return-to-author_returned" sourceRef="return-to-author" targetRef="returned"/>
    <bpmn:sequenceFlow id="Flow_verdict_archive-draft" sourceRef="verdict" targetRef="archive-draft" name="reject"/>
    <bpmn:sequenceFlow id="Flow_archive-draft_rejected" sourceRef="archive-draft" targetRef="rejected"/>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="content-review_di">
    <bpmndi:BPMNPlane id="content-review_di_plane" bpmnElement="content-review">
      <bpmndi:BPMNShape id="draft-submitted_di" bpmnElement="draft-submitted">
        <dc:Bounds x="55" y="202" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="20" y="242" width="105" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="automated-checks_di" bpmnElement="automated-checks">
        <dc:Bounds x="191" y="180" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="editorial-review_di" bpmnElement="editorial-review">
        <dc:Bounds x="391" y="180" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="verdict_di" bpmnElement="verdict">
        <dc:Bounds x="591" y="195" width="50" height="50"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="588" y="249" width="56" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="publish_di" bpmnElement="publish">
        <dc:Bounds x="741" y="340" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="published_di" bpmnElement="published">
        <dc:Bounds x="941" y="362" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="927" y="402" width="63" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="return-to-author_di" bpmnElement="return-to-author">
        <dc:Bounds x="741" y="20" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="returned_di" bpmnElement="returned">
        <dc:Bounds x="941" y="42" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="885" y="82" width="147" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="archive-draft_di" bpmnElement="archive-draft">
        <dc:Bounds x="741" y="180" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="rejected_di" bpmnElement="rejected">
        <dc:Bounds x="941" y="202" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="931" y="242" width="56" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_draft-submitted_automated-checks_di" bpmnElement="Flow_draft-submitted_automated-checks">
        <di:waypoint x="91" y="220"/>
        <di:waypoint x="191" y="220"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_automated-checks_editorial-review_di" bpmnElement="Flow_automated-checks_editorial-review">
        <di:waypoint x="291" y="220"/>
        <di:waypoint x="391" y="220"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_editorial-review_verdict_di" bpmnElement="Flow_editorial-review_verdict">
        <di:waypoint x="491" y="220"/>
        <di:waypoint x="591" y="220"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_verdict_publish_di" bpmnElement="Flow_verdict_publish">
        <di:waypoint x="616" y="245"/>
        <di:waypoint x="616" y="380"/>
        <di:waypoint x="741" y="380"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="592" y="306" width="49" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_publish_published_di" bpmnElement="Flow_publish_published">
        <di:waypoint x="841" y="380"/>
        <di:waypoint x="941" y="380"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_verdict_return-to-author_di" bpmnElement="Flow_verdict_return-to-author">
        <di:waypoint x="616" y="195"/>
        <di:waypoint x="616" y="60"/>
        <di:waypoint x="741" y="60"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="592" y="121" width="42" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_return-to-author_returned_di" bpmnElement="Flow_return-to-author_returned">
        <di:waypoint x="841" y="60"/>
        <di:waypoint x="941" y="60"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_verdict_archive-draft_di" bpmnElement="Flow_verdict_archive-draft">
        <di:waypoint x="641" y="220"/>
        <di:waypoint x="741" y="220"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="670" y="196" width="42" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_archive-draft_rejected_di" bpmnElement="Flow_archive-draft_rejected">
        <di:waypoint x="841" y="220"/>
        <di:waypoint x="941" y="220"/>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

