<!--
  This file is part of CPEE.

  CPEE is free software: you can redistribute it and/or modify it under the terms
  of the GNU General Public License as published by the Free Software Foundation,
  either version 3 of the License, or (at your option) any later version.

  CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  PARTICULAR PURPOSE.  See the GNU General Public License for more details.

  You should have received a copy of the GNU General Public License along with
  CPEE (file COPYING in the main directory).  If not, see
  <http://www.gnu.org/licenses/>.
-->

<description datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://riddl.org/ns/description/1.0" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:doc="http://cpee.org/ns/documentation">

  <message name="list-of-workflow-instances">
    <parameter name="wis" mimetype="text/xml" handler="http://riddl.org/ns/handlers/relaxng">
      <doc:documentation>d</doc:documentation>
      <xi:include href="engine/instances.rng"/>
    </parameter>
  </message>

  <message name="instance-id">
    <parameter name="id" type="integer"/>
  </message>

  <message name="instance-new">
    <parameter name="info" type="string"/>
  </message>

  <message name="instance-info">
    <parameter name="info" mimetype="text/xml" handler="http://riddl.org/ns/handlers/relaxng">
      <xi:include href="engine/instance-info.rng"/>
    </parameter>
  </message>
  <message name="callbacks">
    <parameter name="info" mimetype="text/xml" handler="http://riddl.org/ns/handlers/relaxng">
      <xi:include href="engine/callbacks.rng"/>
    </parameter>
  </message>
  <message name="xsl">
    <parameter name="xsl" mimetype="application/xml"/>
  </message>

  <message name="cmdin">
    <parameter name="cmd" type="string"/>
  </message>
  <message name="cmdout">
    <parameter name="res" mimetype="text/plain"/>
  </message>

  <message name="message">
    <parameter name="type" type="integer"/>
    <parameter name="message" type="string"/>
    <optional>
      <parameter name="details" mimetype="text/xml"/>
      <parameter name="details" mimetype="text/yaml"/>
    </optional>
  </message>

  <resource>
    <doc:documentation>b</doc:documentation>
    <get in="*" out="list-of-workflow-instances">
      <doc:documentation>a</doc:documentation>
    </get>
    <post in="instance-new" out="instance-id"/>
    <resource>
      <get in="*" out="instance-info"/>
      <delete in="*"/>
      <resource relative="console">
        <get in="cmdin" out="cmdout"/>
      </resource>
      <resource relative="callbacks">
        <doc:documentation>xb</doc:documentation>
        <get in="*" out="callbacks"/>
        <resource>
          <put in="*"/>
        </resource>
      </resource>
      <resource relative="notifications">
        <doc:documentation>xr</doc:documentation>
        <resource relative="subscriptions">
          <resource>
            <resource relative="debug">
              <put in="message"/>
            </resource>
            <resource relative="error">
              <put in="message"/>
            </resource>
            <resource relative="info">
              <put in="message"/>
            </resource>
          </resource>
        </resource>
      </resource>
    </resource>
  </resource>
</description>