<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="workflow">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="module" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="connection" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="annotation" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="other" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="id" type="xs:int"/>
      <xs:attribute name="name" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="module">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="location" minOccurs="0" maxOccurs="1"/>
        <xs:element ref="function" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="annotation" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="portSpec" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="id" type="xs:int"/>
      <xs:attribute name="cache" type="xs:int"/>
      <xs:attribute name="name" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="connection">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="port" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="id" type="xs:int"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="annotation">
    <xs:complexType>
      <xs:attribute name="key" type="xs:string"/>
      <xs:attribute name="value" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="other">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="value" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="id" type="xs:int"/>
      <xs:attribute name="key" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="location">
    <xs:complexType>
      <xs:attribute name="id" type="xs:int"/>
      <xs:attribute name="x" type="xs:float"/>
      <xs:attribute name="y" type="xs:float"/>
      <xs:attribute name="relative" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="function">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="parameter" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="id" type="xs:int"/>
      <xs:attribute name="pos" type="xs:int"/>
      <xs:attribute name="name" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="portSpec">
    <xs:complexType>
      <xs:attribute name="id" type="xs:int"/>
      <xs:attribute name="name" type="xs:string"/>
      <xs:attribute name="type" type="xs:string"/>
      <xs:attribute name="spec" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="port">
    <xs:complexType>
      <xs:attribute name="type" type="xs:string"/>
      <xs:attribute name="id" type="xs:int"/>
      <xs:attribute name="moduleId" type="xs:int"/>
      <xs:attribute name="moduleName" type="xs:string"/>
      <xs:attribute name="sig" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="parameter">
    <xs:complexType>
      <xs:attribute name="id" type="xs:int"/>
      <xs:attribute name="pos" type="xs:int"/>
      <xs:attribute name="name" type="xs:string"/>
      <xs:attribute name="type" type="xs:string"/>
      <xs:attribute name="val" type="xs:string"/>
      <xs:attribute name="alias" type="xs:string"/>
    </xs:complexType>
  </xs:element>
</xs:schema>
