<?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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:nano="https://nanobpm.io/schema/shapes/1.0" id="Definitions_nano_workforce" targetNamespace="http://nanobpm.io/nano-workforce">
  <bpmn:message id="Message_readinessReady" name="readiness-ready">
    <bpmn:extensionElements>
      <zeebe:subscription correlationKey="=prKey" />
      <zeebe:properties>
        <zeebe:property name="io.nanobpm.dataEnvelope.in" value="ReadinessReady" />
      </zeebe:properties>
    </bpmn:extensionElements>
  </bpmn:message>
  <bpmn:process id="convergence-loop" name="PR Review Convergence" isExecutable="true">
    <bpmn:extensionElements>
      <nano:shapes>
        <nano:shape id="PrReviewRoundIn" name="PR review round — input">
          <nano:extend name="prUrl" type="string" />
          <nano:extend name="repo" type="string" />
          <nano:extend name="prNumber" type="integer" />
          <nano:extend name="round" type="integer" />
          <nano:extend name="answer" type="string" optional="true" />
        </nano:shape>
        <nano:shape id="PrReviewRoundOut" name="PR review round — result">
          <nano:extend name="status" type="string" />
          <nano:extend name="summary" type="string" />
          <nano:extend name="question" type="string" optional="true" />
        </nano:shape>
        <nano:shape id="PrPersistRoundIn" name="Record round — input">
          <nano:extend name="prKey" type="string" />
          <nano:extend name="round" type="integer" />
          <nano:extend name="status" type="string" optional="true" />
          <nano:extend name="summary" type="string" optional="true" />
          <nano:extend name="repo" type="string" optional="true" />
          <nano:extend name="prNumber" type="integer" optional="true" />
          <nano:extend name="prUrl" type="string" optional="true" />
          <nano:extend name="abandonUrl" type="string" optional="true" />
        </nano:shape>
        <nano:shape id="PrProgressCheckIn" name="Check progress — input">
          <nano:extend name="prKey" type="string" />
          <nano:extend name="status" type="string" optional="true" />
          <nano:extend name="repo" type="string" optional="true" />
          <nano:extend name="prNumber" type="integer" optional="true" />
          <nano:extend name="round" type="integer" optional="true" />
          <nano:extend name="huskRetries" type="integer" optional="true" />
          <nano:extend name="roundEntryHead" type="string" optional="true" />
        </nano:shape>
        <nano:shape id="PrCaptureHeadIn" name="Capture round-entry head — input">
          <nano:extend name="prKey" type="string" />
          <nano:extend name="repo" type="string" optional="true" />
          <nano:extend name="prNumber" type="integer" optional="true" />
        </nano:shape>
        <nano:shape id="PrCaptureHeadOut" name="Capture round-entry head — result">
          <nano:extend name="roundEntryHead" type="string" optional="true" />
        </nano:shape>
        <nano:shape id="PrProgressCheckOut" name="Check progress — result">
          <nano:extend name="progressed" type="boolean" />
          <nano:extend name="huskRetries" type="integer" />
          <nano:extend name="huskRetry" type="boolean" optional="true" />
          <nano:extend name="noProgressReason" type="string" optional="true" />
          <nano:extend name="noProgressQuestion" type="string" optional="true" />
        </nano:shape>
        <nano:shape id="PrConvergeGateIn" name="Converge gate — input">
          <nano:extend name="prKey" type="string" />
          <nano:extend name="repo" type="string" optional="true" />
          <nano:extend name="prNumber" type="integer" optional="true" />
        </nano:shape>
        <nano:shape id="PrConvergeGateOut" name="Converge gate — result">
          <nano:extend name="convergeBlocked" type="boolean" />
          <nano:extend name="convergeBlockReason" type="string" optional="true" />
          <nano:extend name="convergeAckOnly" type="boolean" optional="true" />
          <nano:extend name="reviewStale" type="boolean" optional="true" />
        </nano:shape>
        <nano:shape id="EscalationIn" name="Record escalation — input">
          <nano:extend name="prKey" type="string" />
          <nano:extend name="round" type="integer" />
          <nano:extend name="status" type="string" optional="true" />
          <nano:extend name="summary" type="string" optional="true" />
          <nano:extend name="question" type="string" optional="true" />
          <nano:extend name="recordRound" type="boolean" optional="true" />
          <nano:extend name="repo" type="string" optional="true" />
          <nano:extend name="prNumber" type="integer" optional="true" />
          <nano:extend name="prUrl" type="string" optional="true" />
          <nano:extend name="abandonUrl" type="string" optional="true" />
        </nano:shape>
        <nano:shape id="EscalationOut" name="Record escalation — result">
          <nano:extend name="escalationId" type="integer" optional="true" />
          <nano:extend name="escalated" type="boolean" optional="true" />
          <nano:extend name="question" type="string" optional="true" />
        </nano:shape>
        <nano:shape id="PrAnswerEscalationIn" name="Answer escalation — input">
          <nano:extend name="prKey" type="string" />
          <nano:extend name="answer" type="string" optional="true" />
          <nano:extend name="answerContext" type="string" optional="true" />
          <nano:extend name="completedUserTaskKey" type="string" optional="true" />
          <nano:extend name="completedCompletionId" type="integer" optional="true" />
          <nano:extend name="escalationId" type="integer" optional="true" />
        </nano:shape>
        <nano:shape id="PrFinalizeIn" name="Mark converged — input">
          <nano:extend name="prKey" type="string" />
          <nano:extend name="repo" type="string" />
          <nano:extend name="prNumber" type="integer" />
          <nano:extend name="prUrl" type="string" />
          <nano:extend name="round" type="integer" />
          <nano:extend name="summary" type="string" optional="true" />
          <nano:extend name="convergeOnly" type="boolean" optional="true" />
          <nano:extend name="abandonUrl" type="string" optional="true" />
        </nano:shape>
        <nano:shape id="PrScopeClassifyIn" name="Scope classifier — input">
          <nano:extend name="prUrl" type="string" />
          <nano:extend name="repo" type="string" />
          <nano:extend name="prNumber" type="integer" />
          <nano:extend name="scopeAnswer" type="string" optional="true" />
        </nano:shape>
        <nano:shape id="PrScopeClassifyOut" name="Scope classifier — verdict">
          <nano:extend name="scopeBlocked" type="boolean" />
          <nano:extend name="scopeBlockReason" type="string" />
        </nano:shape>
      </nano:shapes>
    </bpmn:extensionElements>
    <bpmn:startEvent id="Start" name="PR submitted">
      <bpmn:outgoing>f_start</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:serviceTask id="review-round" name="Review round (agent)">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="senior:pr-review" />
        <zeebe:agentDefinition agentType="external" />
        <zeebe:linkedResources>
          <zeebe:linkedResource resourceId="prompts/review-round.md" bindingType="latest" resourceType="GenericScript" linkName="prompt" />
        </zeebe:linkedResources>
        <zeebe:properties>
          <zeebe:property name="io.nanobpm.dataEnvelope.in" value="PrReviewRoundIn" />
          <zeebe:property name="io.nanobpm.dataEnvelope.out" value="PrReviewRoundOut" />
        </zeebe:properties>
        <zeebe:ioMapping>
          <zeebe:input source="=(if (abandonBrief = null) then &#34;&#34; else abandonBrief)" target="appendPrompt" />
          <zeebe:output source="=null" target="answer" />
          <zeebe:output source="=false" target="scopePending" />
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>f_capture</bpmn:incoming>
      <bpmn:outgoing>f_toStatus</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:serviceTask id="capture-head" name="Capture round-entry head">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="pr.capture-head" />
        <zeebe:properties>
          <zeebe:property name="io.nanobpm.dataEnvelope.in" value="PrCaptureHeadIn" />
          <zeebe:property name="io.nanobpm.dataEnvelope.out" value="PrCaptureHeadOut" />
        </zeebe:properties>
      </bpmn:extensionElements>
      <bpmn:incoming>f_start</bpmn:incoming>
      <bpmn:incoming>f_reviewLoop</bpmn:incoming>
      <bpmn:incoming>f_answerLoop</bpmn:incoming>
      <bpmn:incoming>f_huskRetry</bpmn:incoming>
      <bpmn:incoming>f_ackRetry</bpmn:incoming>
      <bpmn:outgoing>f_capture</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:exclusiveGateway id="gw-status" name="status?" default="f_addressed">
      <bpmn:incoming>f_toStatus</bpmn:incoming>
      <bpmn:outgoing>f_converged</bpmn:outgoing>
      <bpmn:outgoing>f_addressed</bpmn:outgoing>
      <bpmn:outgoing>f_waiting</bpmn:outgoing>
      <bpmn:outgoing>f_escalate</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:exclusiveGateway id="gw-guard" name="rounds left?" default="f_guardOk">
      <bpmn:incoming>f_progressOk</bpmn:incoming>
      <bpmn:outgoing>f_guardMax</bpmn:outgoing>
      <bpmn:outgoing>f_guardOk</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:serviceTask id="persist-round" name="Record round">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="pr.persist-round" />
        <zeebe:properties>
          <zeebe:property name="io.nanobpm.dataEnvelope.in" value="PrPersistRoundIn" />
        </zeebe:properties>
      </bpmn:extensionElements>
      <bpmn:incoming>f_addressed</bpmn:incoming>
      <bpmn:incoming>f_waiting</bpmn:incoming>
      <bpmn:incoming>f_escReenter</bpmn:incoming>
      <bpmn:incoming>f_convergeStale</bpmn:incoming>
      <bpmn:outgoing>f_roundWait</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:serviceTask id="check-progress" name="Check progress">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="pr.progress-check" />
        <zeebe:properties>
          <zeebe:property name="io.nanobpm.dataEnvelope.in" value="PrProgressCheckIn" />
          <zeebe:property name="io.nanobpm.dataEnvelope.out" value="PrProgressCheckOut" />
        </zeebe:properties>
      </bpmn:extensionElements>
      <bpmn:incoming>f_roundWait</bpmn:incoming>
      <bpmn:outgoing>f_checkGate</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:exclusiveGateway id="gw-progress" name="progress made?" default="f_progressOk">
      <bpmn:incoming>f_checkGate</bpmn:incoming>
      <bpmn:outgoing>f_noProgress</bpmn:outgoing>
      <bpmn:outgoing>f_progressOk</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:exclusiveGateway id="gw-husk" name="husk — auto-retry?" default="f_huskEscalate">
      <bpmn:incoming>f_noProgress</bpmn:incoming>
      <bpmn:outgoing>f_huskRetry</bpmn:outgoing>
      <bpmn:outgoing>f_huskEscalate</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:serviceTask id="persist-escalation-noprogress" name="Escalate: no progress">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="pr.persist-escalation" />
        <zeebe:properties>
          <zeebe:property name="io.nanobpm.dataEnvelope.in" value="EscalationIn" />
          <zeebe:property name="io.nanobpm.dataEnvelope.out" value="EscalationOut" />
        </zeebe:properties>
        <zeebe:ioMapping>
          <zeebe:input source="=&#34;blocked&#34;" target="status" />
          <zeebe:input source="=false" target="recordRound" />
          <zeebe:input source="=if (noProgressQuestion != null and trim(noProgressQuestion) != &#34;&#34;) then noProgressQuestion else &#34;Round &#34; + string(round) + &#34; reported the review comments were addressed, but the PR head did not advance (no commit was pushed), so another review round would loop on identical code. A human must decide how to proceed (reply to resume the loop).&#34;" target="question" />
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>f_huskEscalate</bpmn:incoming>
      <bpmn:outgoing>f_noprogressGate</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:eventBasedGateway id="gw-review-wait" name="review ready or timeout?">
      <bpmn:incoming>f_guardOk</bpmn:incoming>
      <bpmn:outgoing>f_toReviewWait</bpmn:outgoing>
      <bpmn:outgoing>f_toReviewTimeout</bpmn:outgoing>
    </bpmn:eventBasedGateway>
    <bpmn:intermediateCatchEvent id="wait-review" name="Wait: review ready">
      <bpmn:extensionElements>
        <zeebe:ioMapping>
          <zeebe:output source="=round + 1" target="round" />
          <zeebe:output source="=false" target="reviewStale" />
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>f_toReviewWait</bpmn:incoming>
      <bpmn:outgoing>f_reviewLoop</bpmn:outgoing>
      <bpmn:messageEventDefinition id="med_readinessReady" messageRef="Message_readinessReady" />
    </bpmn:intermediateCatchEvent>
    <bpmn:intermediateCatchEvent id="wait-review-timeout" name="Wait: review timeout">
      <bpmn:incoming>f_toReviewTimeout</bpmn:incoming>
      <bpmn:outgoing>f_reviewStalled</bpmn:outgoing>
      <bpmn:timerEventDefinition id="ted_reviewTimeout">
        <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">=reviewWaitTimeout</bpmn:timeDuration>
      </bpmn:timerEventDefinition>
    </bpmn:intermediateCatchEvent>
    <bpmn:serviceTask id="persist-review-stalled" name="Escalate: review stalled">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="pr.persist-escalation" />
        <zeebe:properties>
          <zeebe:property name="io.nanobpm.dataEnvelope.in" value="EscalationIn" />
          <zeebe:property name="io.nanobpm.dataEnvelope.out" value="EscalationOut" />
        </zeebe:properties>
        <zeebe:ioMapping>
          <zeebe:input source="=&#34;blocked&#34;" target="status" />
          <zeebe:input source="=false" target="recordRound" />
          <zeebe:input source="=&#34;No review arrived within the review-wait timeout (&#34; + reviewWaitTimeout + &#34;). A human must decide how to proceed (reply to resume the loop).&#34;" target="question" />
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>f_reviewStalled</bpmn:incoming>
      <bpmn:outgoing>f_stalledGate</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:serviceTask id="persist-escalation" name="Record escalation">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="pr.persist-escalation" />
        <zeebe:properties>
          <zeebe:property name="io.nanobpm.dataEnvelope.in" value="EscalationIn" />
          <zeebe:property name="io.nanobpm.dataEnvelope.out" value="EscalationOut" />
        </zeebe:properties>
      </bpmn:extensionElements>
      <bpmn:incoming>f_escalate</bpmn:incoming>
      <bpmn:outgoing>f_escGate</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:exclusiveGateway id="gw-escalated" name="escalation opened?" default="f_escReenter">
      <bpmn:incoming>f_escGate</bpmn:incoming>
      <bpmn:incoming>f_noprogressGate</bpmn:incoming>
      <bpmn:incoming>f_stalledGate</bpmn:incoming>
      <bpmn:incoming>f_blockedGate</bpmn:incoming>
      <bpmn:incoming>f_scopeEscGate</bpmn:incoming>
      <bpmn:incoming>f_maxGate</bpmn:incoming>
      <bpmn:outgoing>f_escWait</bpmn:outgoing>
      <bpmn:outgoing>f_escReenter</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:serviceTask id="persist-escalation-maxrounds" name="Escalate: max rounds">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="pr.persist-escalation" />
        <zeebe:properties>
          <zeebe:property name="io.nanobpm.dataEnvelope.in" value="EscalationIn" />
          <zeebe:property name="io.nanobpm.dataEnvelope.out" value="EscalationOut" />
        </zeebe:properties>
        <zeebe:ioMapping>
          <zeebe:input source="=&#34;blocked&#34;" target="status" />
          <zeebe:input source="=false" target="recordRound" />
          <zeebe:input source="=&#34;Not converged after &#34; + string(maxRounds) + &#34; rounds. A human must decide how to proceed.&#34;" target="question" />
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>f_guardMax</bpmn:incoming>
      <bpmn:outgoing>f_maxGate</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:userTask id="wait-answer" name="Answer escalation">
      <bpmn:extensionElements>
        <zeebe:formDefinition formId="pr-escalation" />
        <zeebe:userTask />
        <zeebe:ioMapping>
          <zeebe:input source="=question" target="question" />
          <zeebe:input source="=prKey" target="prKey" />
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>f_escWait</bpmn:incoming>
      <bpmn:outgoing>f_answerRecord</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:serviceTask id="record-answer" name="Record answer">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="pr.answer-escalation" />
        <zeebe:properties>
          <zeebe:property name="io.nanobpm.dataEnvelope.in" value="PrAnswerEscalationIn" />
        </zeebe:properties>
        <zeebe:ioMapping>
          <zeebe:input source="=prKey" target="prKey" />
          <zeebe:input source="=answer" target="answer" />
          <zeebe:input source="=&#34;convergence&#34;" target="answerContext" />
          <zeebe:input source="=completedUserTaskKey" target="completedUserTaskKey" />
          <zeebe:input source="=completedCompletionId" target="completedCompletionId" />
          <zeebe:output source="=(if scopePending = true then answer else scopeAnswer)" target="scopeAnswer" />
          <zeebe:output source="=0" target="huskRetries" />
          <zeebe:output source="=false" target="reviewStale" />
          <zeebe:output source="=null" target="completedUserTaskKey" />
          <zeebe:output source="=null" target="completedCompletionId" />
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>f_answerRecord</bpmn:incoming>
      <bpmn:outgoing>f_answerLoop</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:serviceTask id="persist-converged" name="Mark converged">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="pr.finalize" />
        <zeebe:properties>
          <zeebe:property name="io.nanobpm.dataEnvelope.in" value="PrFinalizeIn" />
        </zeebe:properties>
      </bpmn:extensionElements>
      <bpmn:incoming>f_scopeOk</bpmn:incoming>
      <bpmn:outgoing>f_finalize</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:serviceTask id="check-converge" name="Check review comments">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="pr.converge-gate" />
        <zeebe:properties>
          <zeebe:property name="io.nanobpm.dataEnvelope.in" value="PrConvergeGateIn" />
          <zeebe:property name="io.nanobpm.dataEnvelope.out" value="PrConvergeGateOut" />
        </zeebe:properties>
        <zeebe:ioMapping>
          <zeebe:output source="=if convergeBlocked = true and convergeAckOnly = true then ackRetryRound + 1 else ackRetryRound" target="ackRetryRound" />
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>f_converged</bpmn:incoming>
      <bpmn:outgoing>f_toConvergeGate</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:exclusiveGateway id="gw-converge-gate" name="comments addressed?" default="f_convergeOk">
      <bpmn:incoming>f_toConvergeGate</bpmn:incoming>
      <bpmn:outgoing>f_convergeBlocked</bpmn:outgoing>
      <bpmn:outgoing>f_convergeStale</bpmn:outgoing>
      <bpmn:outgoing>f_convergeOk</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:exclusiveGateway id="gw-ack-retry" name="auto-ack within budget?" default="f_ackEscalate">
      <bpmn:incoming>f_convergeBlocked</bpmn:incoming>
      <bpmn:outgoing>f_ackRetry</bpmn:outgoing>
      <bpmn:outgoing>f_ackEscalate</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:serviceTask id="persist-escalation-blockedcomments" name="Escalate: unaddressed comments">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="pr.persist-escalation" />
        <zeebe:properties>
          <zeebe:property name="io.nanobpm.dataEnvelope.in" value="EscalationIn" />
          <zeebe:property name="io.nanobpm.dataEnvelope.out" value="EscalationOut" />
        </zeebe:properties>
        <zeebe:ioMapping>
          <zeebe:input source="=&#34;blocked&#34;" target="status" />
          <zeebe:input source="=false" target="recordRound" />
          <zeebe:input source="=convergeBlockReason" target="question" />
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>f_ackEscalate</bpmn:incoming>
      <bpmn:outgoing>f_blockedGate</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:serviceTask id="classify-scope" name="Scope classifier (agent)">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="senior:scope-classify" />
        <zeebe:agentDefinition agentType="external" />
        <zeebe:linkedResources>
          <zeebe:linkedResource resourceId="prompts/scope-classify.md" bindingType="latest" resourceType="GenericScript" linkName="prompt" />
        </zeebe:linkedResources>
        <zeebe:properties>
          <zeebe:property name="io.nanobpm.dataEnvelope.in" value="PrScopeClassifyIn" />
          <zeebe:property name="io.nanobpm.dataEnvelope.out" value="PrScopeClassifyOut" />
        </zeebe:properties>
        <zeebe:ioMapping>
          <zeebe:output source="=null" target="scopeAnswer" />
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>f_convergeOk</bpmn:incoming>
      <bpmn:outgoing>f_toScopeGate</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:exclusiveGateway id="gw-scope-gate" name="scope delivered?" default="f_scopeOk">
      <bpmn:incoming>f_toScopeGate</bpmn:incoming>
      <bpmn:outgoing>f_scopeBlocked</bpmn:outgoing>
      <bpmn:outgoing>f_scopeOk</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:serviceTask id="persist-escalation-scope" name="Escalate: scope integrity">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="pr.persist-escalation" />
        <zeebe:properties>
          <zeebe:property name="io.nanobpm.dataEnvelope.in" value="EscalationIn" />
          <zeebe:property name="io.nanobpm.dataEnvelope.out" value="EscalationOut" />
        </zeebe:properties>
        <zeebe:ioMapping>
          <zeebe:input source="=&#34;blocked&#34;" target="status" />
          <zeebe:input source="=false" target="recordRound" />
          <zeebe:input source="=scopeBlockReason" target="question" />
          <zeebe:output source="=true" target="scopePending" />
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>f_scopeBlocked</bpmn:incoming>
      <bpmn:outgoing>f_scopeEscGate</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:endEvent id="End" name="Converged">
      <bpmn:incoming>f_finalize</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="f_start" sourceRef="Start" targetRef="capture-head" />
    <bpmn:sequenceFlow id="f_capture" sourceRef="capture-head" targetRef="review-round" />
    <bpmn:sequenceFlow id="f_toStatus" sourceRef="review-round" targetRef="gw-status" />
    <bpmn:sequenceFlow id="f_converged" name="converged" sourceRef="gw-status" targetRef="check-converge">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=status = "converged"</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="f_toConvergeGate" sourceRef="check-converge" targetRef="gw-converge-gate" />
    <bpmn:sequenceFlow id="f_convergeBlocked" name="unaddressed comments" sourceRef="gw-converge-gate" targetRef="gw-ack-retry">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=convergeBlocked = true</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="f_ackRetry" name="ack-only within budget" sourceRef="gw-ack-retry" targetRef="capture-head">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=convergeAckOnly = true and ackRetryRound &lt;= ackRetryMax</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="f_ackEscalate" name="threads / budget exhausted" sourceRef="gw-ack-retry" targetRef="persist-escalation-blockedcomments" />
    <bpmn:sequenceFlow id="f_convergeStale" name="review stale" sourceRef="gw-converge-gate" targetRef="persist-round">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=reviewStale = true</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="f_convergeOk" name="addressed / default" sourceRef="gw-converge-gate" targetRef="classify-scope" />
    <bpmn:sequenceFlow id="f_toScopeGate" sourceRef="classify-scope" targetRef="gw-scope-gate" />
    <bpmn:sequenceFlow id="f_scopeBlocked" name="scope under-delivered" sourceRef="gw-scope-gate" targetRef="persist-escalation-scope">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=scopeBlocked = true</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="f_scopeOk" name="scope delivered / default" sourceRef="gw-scope-gate" targetRef="persist-converged" />
    <bpmn:sequenceFlow id="f_scopeEscGate" sourceRef="persist-escalation-scope" targetRef="gw-escalated" />
    <bpmn:sequenceFlow id="f_blockedGate" sourceRef="persist-escalation-blockedcomments" targetRef="gw-escalated" />
    <bpmn:sequenceFlow id="f_addressed" name="addressed / default" sourceRef="gw-status" targetRef="persist-round" />
    <bpmn:sequenceFlow id="f_waiting" name="waiting" sourceRef="gw-status" targetRef="persist-round">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=status = "waiting"</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="f_escalate" name="needs_input / blocked" sourceRef="gw-status" targetRef="persist-escalation">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=(status = "needs_input" or status = "blocked") and question != null and trim(question) != ""</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="f_guardMax" name="max rounds" sourceRef="gw-guard" targetRef="persist-escalation-maxrounds">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=round &gt;= maxRounds and reviewStale != true</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="f_guardOk" name="continue" sourceRef="gw-guard" targetRef="gw-review-wait" />
    <bpmn:sequenceFlow id="f_roundWait" sourceRef="persist-round" targetRef="check-progress" />
    <bpmn:sequenceFlow id="f_checkGate" sourceRef="check-progress" targetRef="gw-progress" />
    <bpmn:sequenceFlow id="f_noProgress" name="no progress" sourceRef="gw-progress" targetRef="gw-husk">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=progressed = false</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="f_huskRetry" name="husk — retry same round" sourceRef="gw-husk" targetRef="capture-head">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=huskRetry = true</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="f_huskEscalate" name="escalate" sourceRef="gw-husk" targetRef="persist-escalation-noprogress" />
    <bpmn:sequenceFlow id="f_progressOk" name="progress / default" sourceRef="gw-progress" targetRef="gw-guard" />
    <bpmn:sequenceFlow id="f_noprogressGate" sourceRef="persist-escalation-noprogress" targetRef="gw-escalated" />
    <bpmn:sequenceFlow id="f_toReviewWait" sourceRef="gw-review-wait" targetRef="wait-review" />
    <bpmn:sequenceFlow id="f_toReviewTimeout" sourceRef="gw-review-wait" targetRef="wait-review-timeout" />
    <bpmn:sequenceFlow id="f_reviewLoop" sourceRef="wait-review" targetRef="capture-head" />
    <bpmn:sequenceFlow id="f_reviewStalled" sourceRef="wait-review-timeout" targetRef="persist-review-stalled" />
    <bpmn:sequenceFlow id="f_stalledGate" sourceRef="persist-review-stalled" targetRef="gw-escalated" />
    <bpmn:sequenceFlow id="f_escGate" sourceRef="persist-escalation" targetRef="gw-escalated" />
    <bpmn:sequenceFlow id="f_escWait" sourceRef="gw-escalated" targetRef="wait-answer">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=escalated = true</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="f_escReenter" name="no escalation opened" sourceRef="gw-escalated" targetRef="persist-round" />
    <bpmn:sequenceFlow id="f_maxGate" sourceRef="persist-escalation-maxrounds" targetRef="gw-escalated" />
    <bpmn:sequenceFlow id="f_answerRecord" sourceRef="wait-answer" targetRef="record-answer" />
    <bpmn:sequenceFlow id="f_answerLoop" sourceRef="record-answer" targetRef="capture-head" />
    <bpmn:sequenceFlow id="f_finalize" sourceRef="persist-converged" targetRef="End" />
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_convergence-loop">
    <bpmndi:BPMNPlane id="BPMNPlane_convergence-loop" bpmnElement="convergence-loop">
      <bpmndi:BPMNShape id="BPMNShape_Start" bpmnElement="Start">
        <dc:Bounds x="80" y="102" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="63" y="143" width="70" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_review-round" bpmnElement="review-round">
        <dc:Bounds x="416" y="80" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_capture-head" bpmnElement="capture-head">
        <dc:Bounds x="216" y="80" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_gw-status" bpmnElement="gw-status" isMarkerVisible="true">
        <dc:Bounds x="616" y="95" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="615" y="76" width="53" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_gw-guard" bpmnElement="gw-guard" isMarkerVisible="true">
        <dc:Bounds x="1716" y="575" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1699" y="556" width="85" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_persist-round" bpmnElement="persist-round">
        <dc:Bounds x="1116" y="560" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_check-progress" bpmnElement="check-progress">
        <dc:Bounds x="1316" y="560" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_gw-progress" bpmnElement="gw-progress" isMarkerVisible="true">
        <dc:Bounds x="1541" y="575" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1536" y="542" width="60" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_gw-husk" bpmnElement="gw-husk" isMarkerVisible="true">
        <dc:Bounds x="1716" y="1055" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1701" y="1022" width="81" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_persist-escalation-noprogress" bpmnElement="persist-escalation-noprogress">
        <dc:Bounds x="1866" y="1040" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_gw-review-wait" bpmnElement="gw-review-wait" isMarkerVisible="true">
        <dc:Bounds x="1891" y="575" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1872" y="542" width="88" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_wait-review" bpmnElement="wait-review">
        <dc:Bounds x="2066" y="582" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="2040" y="549" width="88" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_wait-review-timeout" bpmnElement="wait-review-timeout">
        <dc:Bounds x="2066" y="742" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="2056" y="783" width="56" height="42" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_persist-review-stalled" bpmnElement="persist-review-stalled">
        <dc:Bounds x="2202" y="720" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_persist-escalation" bpmnElement="persist-escalation">
        <dc:Bounds x="766" y="1200" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_gw-escalated" bpmnElement="gw-escalated" isMarkerVisible="true">
        <dc:Bounds x="2402" y="255" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="2390" y="222" width="74" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_persist-escalation-maxrounds" bpmnElement="persist-escalation-maxrounds">
        <dc:Bounds x="1866" y="880" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_wait-answer" bpmnElement="wait-answer">
        <dc:Bounds x="2552" y="240" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_record-answer" bpmnElement="record-answer">
        <dc:Bounds x="2752" y="240" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_persist-converged" bpmnElement="persist-converged">
        <dc:Bounds x="1516" y="80" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_check-converge" bpmnElement="check-converge">
        <dc:Bounds x="766" y="80" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_gw-converge-gate" bpmnElement="gw-converge-gate" isMarkerVisible="true">
        <dc:Bounds x="966" y="95" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="954" y="62" width="74" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_gw-ack-retry" bpmnElement="gw-ack-retry" isMarkerVisible="true">
        <dc:Bounds x="1141" y="415" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1136" y="368" width="60" height="42" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_persist-escalation-blockedcomments" bpmnElement="persist-escalation-blockedcomments">
        <dc:Bounds x="1316" y="400" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_classify-scope" bpmnElement="classify-scope">
        <dc:Bounds x="1116" y="80" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_gw-scope-gate" bpmnElement="gw-scope-gate" isMarkerVisible="true">
        <dc:Bounds x="1341" y="95" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1329" y="62" width="74" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_persist-escalation-scope" bpmnElement="persist-escalation-scope">
        <dc:Bounds x="1516" y="240" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_End" bpmnElement="End">
        <dc:Bounds x="1723" y="102" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1707" y="143" width="69" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_f_start" bpmnElement="f_start">
        <di:waypoint x="116" y="120" />
        <di:waypoint x="216" y="120" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_capture" bpmnElement="f_capture">
        <di:waypoint x="316" y="120" />
        <di:waypoint x="416" y="120" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_toStatus" bpmnElement="f_toStatus">
        <di:waypoint x="516" y="120" />
        <di:waypoint x="616" y="120" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_converged" bpmnElement="f_converged">
        <di:waypoint x="666" y="120" />
        <di:waypoint x="766" y="120" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="683" y="98" width="67" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_toConvergeGate" bpmnElement="f_toConvergeGate">
        <di:waypoint x="866" y="120" />
        <di:waypoint x="966" y="120" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_convergeOk" bpmnElement="f_convergeOk">
        <di:waypoint x="1016" y="120" />
        <di:waypoint x="1116" y="120" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1027" y="125" width="78" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_toScopeGate" bpmnElement="f_toScopeGate">
        <di:waypoint x="1216" y="120" />
        <di:waypoint x="1341" y="120" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_scopeOk" bpmnElement="f_scopeOk">
        <di:waypoint x="1391" y="120" />
        <di:waypoint x="1516" y="120" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1415" y="73" width="78" height="42" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_finalize" bpmnElement="f_finalize">
        <di:waypoint x="1616" y="120" />
        <di:waypoint x="1723" y="120" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_ackEscalate" bpmnElement="f_ackEscalate">
        <di:waypoint x="1191" y="440" />
        <di:waypoint x="1316" y="440" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1220" y="393" width="67" height="42" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_blockedGate" bpmnElement="f_blockedGate">
        <di:waypoint x="1416" y="440" />
        <di:waypoint x="2427" y="440" />
        <di:waypoint x="2427" y="305" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_guardOk" bpmnElement="f_guardOk">
        <di:waypoint x="1766" y="600" />
        <di:waypoint x="1891" y="600" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1776" y="608" width="60" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_roundWait" bpmnElement="f_roundWait">
        <di:waypoint x="1216" y="600" />
        <di:waypoint x="1316" y="600" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_checkGate" bpmnElement="f_checkGate">
        <di:waypoint x="1416" y="600" />
        <di:waypoint x="1541" y="600" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_huskEscalate" bpmnElement="f_huskEscalate">
        <di:waypoint x="1766" y="1080" />
        <di:waypoint x="1866" y="1080" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1786" y="1088" width="60" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_progressOk" bpmnElement="f_progressOk">
        <di:waypoint x="1591" y="600" />
        <di:waypoint x="1716" y="600" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1608" y="567" width="71" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_noprogressGate" bpmnElement="f_noprogressGate">
        <di:waypoint x="1966" y="1080" />
        <di:waypoint x="2427" y="1080" />
        <di:waypoint x="2427" y="305" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_toReviewWait" bpmnElement="f_toReviewWait">
        <di:waypoint x="1941" y="600" />
        <di:waypoint x="2066" y="600" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_reviewLoop" bpmnElement="f_reviewLoop">
        <di:waypoint x="2084" y="618" />
        <di:waypoint x="2084" y="660" />
        <di:waypoint x="266" y="660" />
        <di:waypoint x="266" y="160" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_escReenter" bpmnElement="f_escReenter">
        <di:waypoint x="2427" y="305" />
        <di:waypoint x="2427" y="660" />
        <di:waypoint x="1166" y="660" />
        <di:waypoint x="1166" y="640" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="2219" y="613" width="74" height="42" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_convergeBlocked" bpmnElement="f_convergeBlocked">
        <di:waypoint x="991" y="145" />
        <di:waypoint x="991" y="440" />
        <di:waypoint x="1141" y="440" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1026" y="407" width="81" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_convergeStale" bpmnElement="f_convergeStale">
        <di:waypoint x="991" y="145" />
        <di:waypoint x="991" y="600" />
        <di:waypoint x="1116" y="600" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="996" y="513" width="88" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_scopeBlocked" bpmnElement="f_scopeBlocked">
        <di:waypoint x="1366" y="145" />
        <di:waypoint x="1366" y="280" />
        <di:waypoint x="1516" y="280" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1371" y="192" width="88" height="42" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_addressed" bpmnElement="f_addressed">
        <di:waypoint x="641" y="145" />
        <di:waypoint x="641" y="600" />
        <di:waypoint x="1116" y="600" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="646" y="359" width="78" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_waiting" bpmnElement="f_waiting">
        <di:waypoint x="641" y="145" />
        <di:waypoint x="641" y="600" />
        <di:waypoint x="1116" y="600" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="580" y="366" width="56" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_escalate" bpmnElement="f_escalate">
        <di:waypoint x="641" y="145" />
        <di:waypoint x="641" y="1240" />
        <di:waypoint x="766" y="1240" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="646" y="906" width="81" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_guardMax" bpmnElement="f_guardMax">
        <di:waypoint x="1766" y="600" />
        <di:waypoint x="1846" y="600" />
        <di:waypoint x="1846" y="920" />
        <di:waypoint x="1866" y="920" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1767" y="753" width="74" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_noProgress" bpmnElement="f_noProgress">
        <di:waypoint x="1591" y="600" />
        <di:waypoint x="1696" y="600" />
        <di:waypoint x="1696" y="1080" />
        <di:waypoint x="1716" y="1080" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1701" y="833" width="78" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_toReviewTimeout" bpmnElement="f_toReviewTimeout">
        <di:waypoint x="1916" y="625" />
        <di:waypoint x="1916" y="760" />
        <di:waypoint x="2066" y="760" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_scopeEscGate" bpmnElement="f_scopeEscGate">
        <di:waypoint x="1616" y="280" />
        <di:waypoint x="2402" y="280" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_reviewStalled" bpmnElement="f_reviewStalled">
        <di:waypoint x="2102" y="760" />
        <di:waypoint x="2202" y="760" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_stalledGate" bpmnElement="f_stalledGate">
        <di:waypoint x="2302" y="760" />
        <di:waypoint x="2472" y="760" />
        <di:waypoint x="2472" y="305" />
        <di:waypoint x="2472" y="280" />
        <di:waypoint x="2452" y="280" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_escGate" bpmnElement="f_escGate">
        <di:waypoint x="866" y="1240" />
        <di:waypoint x="2472" y="1240" />
        <di:waypoint x="2472" y="305" />
        <di:waypoint x="2472" y="280" />
        <di:waypoint x="2452" y="280" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_escWait" bpmnElement="f_escWait">
        <di:waypoint x="2452" y="280" />
        <di:waypoint x="2552" y="280" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_maxGate" bpmnElement="f_maxGate">
        <di:waypoint x="1966" y="920" />
        <di:waypoint x="2472" y="920" />
        <di:waypoint x="2472" y="305" />
        <di:waypoint x="2472" y="280" />
        <di:waypoint x="2452" y="280" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_answerRecord" bpmnElement="f_answerRecord">
        <di:waypoint x="2652" y="280" />
        <di:waypoint x="2752" y="280" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_ackRetry" bpmnElement="f_ackRetry">
        <di:waypoint x="1166" y="465" />
        <di:waypoint x="1166" y="485" />
        <di:waypoint x="266" y="485" />
        <di:waypoint x="266" y="160" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="686" y="438" width="60" height="42" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_huskRetry" bpmnElement="f_huskRetry">
        <di:waypoint x="1741" y="1105" />
        <di:waypoint x="1741" y="1125" />
        <di:waypoint x="266" y="1125" />
        <di:waypoint x="266" y="160" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="963" y="1092" width="82" height="28" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_f_answerLoop" bpmnElement="f_answerLoop">
        <di:waypoint x="2802" y="320" />
        <di:waypoint x="2802" y="340" />
        <di:waypoint x="266" y="340" />
        <di:waypoint x="266" y="160" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
