<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
            jxb:version="2.1">



<xsd:element name="scenario-list" type="ScenarioList"/>

<xsd:complexType name="ScenarioList">
  <xsd:sequence>
  	<xsd:element name="scenarios" minOccurs="1" maxOccurs="unbounded" type="AppScenario"/>
  </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="AppScenario">
  <xsd:sequence>
    <xsd:element name="url" type="xsd:string"/>
    <xsd:element name="serviceName" type="xsd:string"/>
    <xsd:element name="username" type="xsd:string" minOccurs="0"/>
    <xsd:element name="password" type="xsd:string" minOccurs="0"/>
    <xsd:element name="actions" type="AppAction"
                 minOccurs="1" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="AppAction">
  <xsd:sequence>
  <xsd:element name="procInvocation" type="ProcInvocation"/>
  </xsd:sequence>
</xsd:complexType>
  <xsd:complexType name="PersistentAppAction">
    <xsd:complexContent>
      <xsd:extension base="AppAction">
        <xsd:sequence>
          <xsd:element name="functions" type="ProcInvocation" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
<xsd:complexType name="ProcInvocation">
  <xsd:sequence>
  <xsd:element name="procName" type="xsd:string"/>
  <xsd:element name="parameter" type="Parameter" minOccurs="0" maxOccurs="unbounded"/>
  <xsd:element name="returnType" type="OEParameter" minOccurs="0"/>  
  </xsd:sequence>
</xsd:complexType>


<xsd:complexType name="Parameter">
  <xsd:sequence>
  	<xsd:element name="index" type="xsd:int"/>  
    <xsd:element name="direction">
    	<xsd:simpleType>
   			<xsd:restriction base="xsd:string">
    			<xsd:enumeration value="IN"/>
    			<xsd:enumeration value="OUT"/>
    			<xsd:enumeration value="IN-OUT"/>
  			</xsd:restriction> 	
  		</xsd:simpleType>
  	</xsd:element>
  <xsd:element name="type" type="OEParameter"/>
  <xsd:element name="value" type="xsd:string" minOccurs="0"/>   
  </xsd:sequence>  
</xsd:complexType>

<xsd:complexType name="OEParameter" abstract="true">
</xsd:complexType>
<xsd:complexType name="SimpleParameter">
    <xsd:complexContent>
      <xsd:extension base="OEParameter">
		<xsd:sequence>
			<xsd:element name="value">
			    <xsd:simpleType>
  				<xsd:restriction base="xsd:string">
   	 				<xsd:enumeration value="CHARACTER"/>
    				<xsd:enumeration value="INTEGER"/>
    				<xsd:enumeration value="LOGICAL"/>
					<xsd:enumeration value="DATE"/>    
					<xsd:enumeration value="DATETIME"/>
					<xsd:enumeration value="LONGCHAR"/>
					<xsd:enumeration value="DECIMAL"/>
  				</xsd:restriction>		
  				</xsd:simpleType>
			</xsd:element>
		</xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>  		
</xsd:complexType>
<xsd:complexType name="TableParameter">
    <xsd:complexContent>
      <xsd:extension base="OEParameter">
		<xsd:sequence>
			<xsd:element name="meta" type="TableMetaData" maxOccurs="unbounded"/>
		</xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>  		
</xsd:complexType>


<xsd:complexType name="TableMetaData">
  <xsd:sequence>
  <xsd:element name="type" type="OEParameter"/>
  </xsd:sequence>  
  <xsd:attribute name="index" type="xsd:int"/>
  <xsd:attribute name="name" type="xsd:string"/>  
</xsd:complexType>

</xsd:schema>