<?xml version="1.0" encoding="UTF-8"?> 
<process xmlns="http://drools.org/drools-5.0/process"
         xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
         xs:schemaLocation="http://drools.org/drools-5.0/process drools-processes-5.0.xsd"
         type="RuleFlow" name="Number Guess" id="Number Guess" package-name="org.drools.examples.numberguess" >

  <header>
    <imports>
      <import name="org.drools.examples.numberguess.NumberGuessExample.Game" />
      <import name="org.drools.examples.numberguess.NumberGuessExample.GameRules" />
      <import name="org.drools.examples.numberguess.NumberGuessExample.Guess" />
      <import name="org.drools.examples.numberguess.NumberGuessExample.RandomNumber" />
    </imports>
  </header>

  <nodes>
    <end id="4" name="End" x="373" y="336" width="80" height="40" />
    <split id="8" name="More Guesses?" x="629" y="261" width="93" height="40" type="2" >
      <constraints>
        <constraint toNodeId="3" toType="DROOLS_DEFAULT" name="No more Guesses" priority="1" type="rule" dialect="mvel" >GameRules( allowed : allowedGuesses  )
Game( guessCount &gt;= allowed )</constraint>
        <constraint toNodeId="6" toType="DROOLS_DEFAULT" name="More guesses" priority="1" type="rule" dialect="mvel" >GameRules( allowed : allowedGuesses  )
Game( guessCount &lt; allowed )</constraint>
      </constraints>
    </split>
    <ruleSet id="11" name="Guess incorrect" x="79" y="455" width="80" height="40" ruleFlowGroup="Guess incorrect" />
    <ruleSet id="3" name="No more Guesses" x="499" y="260" width="109" height="40" ruleFlowGroup="No more Guesses" />
    <ruleSet id="7" name="Guess" x="76" y="198" width="80" height="40" ruleFlowGroup="Guess" />
    <actionNode id="12" name="Too high" x="3" y="325" width="80" height="40" >
        <action type="expression" dialect="mvel" >System.out.println( "Your guess was too high" );</action>
    </actionNode>
    <actionNode id="2" name="Guess correct" x="219" y="260" width="102" height="40" >
        <action type="expression" dialect="mvel" >System.out.println( "You guessed correctly" );</action>
    </actionNode>
    <actionNode id="13" name="Too low" x="154" y="324" width="80" height="40" >
        <action type="expression" dialect="mvel" >System.out.println( "Your guess was too low" );</action>
    </actionNode>
    <join id="9" name="Incorrect guess" x="67" y="387" width="103" height="40" type="2" />
    <join id="6" name="More guesses Join" x="57" y="135" width="119" height="40" type="2" />
    <start id="1" name="Start" x="76" y="60" width="80" height="40" />
    <join id="10" name="No more guesses Join" x="350" y="261" width="128" height="40" type="2" />
    <split id="5" name="Guess correct?" x="59" y="261" width="115" height="40" type="2" >
      <constraints>
        <constraint toNodeId="12" toType="DROOLS_DEFAULT" name="too high" priority="1" type="rule" dialect="mvel" >RandomNumber( randomValue : value )
Guess( value &gt; randomValue )</constraint>
        <constraint toNodeId="2" toType="DROOLS_DEFAULT" name="correct" priority="1" type="rule" dialect="mvel" >RandomNumber( randomValue : value )
Guess( value == randomValue )</constraint>
        <constraint toNodeId="13" toType="DROOLS_DEFAULT" name="too low" priority="1" type="rule" dialect="mvel" >RandomNumber( randomValue : value )
Guess( value &lt; randomValue )</constraint>
      </constraints>
    </split>
  </nodes>

  <connections>
    <connection from="10" to="4" />
    <connection from="11" to="8" bendpoints="[675,474]" />
    <connection from="9" to="11" />
    <connection from="8" to="3" />
    <connection from="6" to="7" />
    <connection from="5" to="12" />
    <connection from="5" to="2" />
    <connection from="5" to="13" />
    <connection from="12" to="9" />
    <connection from="13" to="9" />
    <connection from="1" to="6" />
    <connection from="8" to="6" bendpoints="[675,154]" />
    <connection from="3" to="10" />
    <connection from="2" to="10" />
    <connection from="7" to="5" />
  </connections>

</process>
