<?xml version="1.0" encoding="UTF-8"?>
<scxml initial="Initialize" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camitk="http://camitk.imag.fr/3/asm" xsi:schemaLocation="http://camitk.imag.fr/3/smallScxml/../resources/smallScxml.xsd" xmlns="http://camitk.imag.fr/3/smallScxml">
 <state id="Initialize">
  <onentry>
   <camitk:onState>
       <camitk:description><![CDATA[This pipeline will only check the "Hard-Coded Action Pipeline" action. This specific action ir running a hard-coded pipeline that resize an image and apply an Otsu filter on the result.<br/>This pipeline therefore just do:<br/> <ul><li>Open</li><li></li><li>Hard-Coded Action Pipeline</li><li>Save As</li></ul>]]></camitk:description>
   </camitk:onState>
  </onentry>
  <transition target="Open Input Image" event="Next"/>
 </state>
 <state id="Open Input Image">
  <onentry>
   <camitk:onState>
    <camitk:description>Open data (component) from a file</camitk:description>
    <camitk:action>
     <camitk:name>Open File</camitk:name>
     <camitk:parameters>
      <camitk:parameter name="File Name" value="input-1.mha" type="QString"/>
     </camitk:parameters>
     <camitk:outputs>
      <camitk:component name="input-1.mha" type="ImageComponent"/>
     </camitk:outputs>
    </camitk:action>
   </camitk:onState>
  </onentry>
  <transition target="Initialize" event="Back"/>
  <transition target="Apply Hard-Coded Pipeline" event="Next"/>
 </state>
 <state id="Apply Hard-Coded Pipeline">
  <onentry>
   <camitk:onState>
    <camitk:description>&lt;p> Demonstrate how to call one or more actions from another action (that is, implement a hard-coded action pipeline without modifying anything of the called actions).&lt;/p></camitk:description>
    <camitk:action>
     <camitk:name>Hard-Coded Action Pipeline</camitk:name>
     <camitk:parameters>
      <camitk:parameter name="Resample Factor" value="0.5" type="double"/>
     </camitk:parameters>
     <camitk:inputs>
      <camitk:component name="input-1.mha" type="ImageComponent"/>
     </camitk:inputs>
     <camitk:outputs>
         <camitk:component name="output-1.mha" type="ImageComponent"/>
     </camitk:outputs>
    </camitk:action>
   </camitk:onState>
  </onentry>
  <transition target="Open Input Image" event="Back">
   <onTransition>
    <camitk:close>
     <camitk:component name="input-1.mha" type="ImageComponent"/>
    </camitk:close>
   </onTransition>
  </transition>
  <transition target="Save Pipeline Result as output-1.mha" event="Next"/>
 </state>
 <state id="Save Pipeline Result as output-1.mha">
  <onentry>
   <camitk:onState>
    <camitk:description>Save the currently selected data under a different filename or format</camitk:description>
    <camitk:action>
     <camitk:name>Save</camitk:name>
     <camitk:parameters/>
     <camitk:inputs>
      <camitk:component name="output-1.mha" type="ImageComponent"/>
     </camitk:inputs>
    </camitk:action>
   </camitk:onState>
  </onentry>
  <transition target="Apply Hard-Coded Pipeline" event="Back">
   <onTransition>
    <camitk:close>
     <camitk:component name="output-1.mha" type="ImageComponent"/>
    </camitk:close>
   </onTransition>
  </transition>
  <transition target="Close input-1.mha" event="Next"/>
 </state>
 <state id="Close input-1.mha">
  <onentry>
   <camitk:onState>
    <camitk:description>Close the currently selected components</camitk:description>
    <camitk:action>
     <camitk:name>Close</camitk:name>
     <camitk:parameters/>
     <camitk:inputs>
      <camitk:component name="input-1.mha" type="ImageComponent"/>
     </camitk:inputs>
    </camitk:action>
   </camitk:onState>
  </onentry>
  <transition target="Save Pipeline Result as output-1.mha" event="Back"/>
  <transition target="Close output-1.mha" event="Next"/>
 </state>
 <state id="Close output-1.mha">
  <onentry>
   <camitk:onState>
    <camitk:description>Close the currently selected components</camitk:description>
    <camitk:action>
     <camitk:name>Close</camitk:name>
     <camitk:parameters/>
     <camitk:inputs>
      <camitk:component name="output-1.mha" type="ImageComponent"/>
     </camitk:inputs>
    </camitk:action>
   </camitk:onState>
  </onentry>
  <transition target="Close input-1.mha" event="Back"/>
  <transition target="Bye" event="Next"/>
 </state>

 <state id="Bye" final="true">
  <onentry>
   <camitk:onState>
    <camitk:description><![CDATA[Thanks you for using the CamiTK Action State Machine !]]></camitk:description>
   </camitk:onState>
  </onentry>
  <transition target="Initialize" event="Back to the beginning">
   <onTransition>
    <camitk:close/>
   </onTransition>
  </transition>
 </state>
</scxml>
