<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initial="NEW">
  <state id="NEW">
    <transition target="CHECK_AVAILABILITY" event="String.PLACE_ORDER"/>
  </state>
  <state id="CHECK_AVAILABILITY">
    <transition target="PENDING_PAYMENT" cond="λ">
      <!-- order=0 -->
    </transition>
    <transition target="CANCELLED">
      <!-- order=1 -->
    </transition>
  </state>
  <state id="PENDING_PAYMENT">
    <transition target="PAID" event="String.PAY_ORDER"/>
  </state>
  <state id="CANCELLED">
  </state>
  <state id="PAID">
    <transition target="SHIPPED" event="String.SHIP_ORDER"/>
    <transition target="CANCELLED" event="String.CANCEL_ORDER"/>
  </state>
  <state id="SHIPPED">
    <transition target="DELIVERED" event="String.FINALIZE"/>
  </state>
  <state id="DELIVERED">
    <transition target="RETURNED" event="String.RETURN_ORDER"/>
  </state>
  <state id="RETURNED">
  </state>
</scxml>

