<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="deployment-descriptor" type="deploymentDescriptorImpl"/>

  <xs:element name="namedObjectModel" type="namedObjectModel"/>

  <xs:element name="objectModel" type="objectModel"/>

  <xs:complexType name="deploymentDescriptorImpl">
    <xs:sequence>
      <xs:element name="persistence-unit" type="xs:string" minOccurs="0"/>
      <xs:element name="audit-persistence-unit" type="xs:string" minOccurs="0"/>
      <xs:element name="audit-mode" type="auditMode" minOccurs="0"/>
      <xs:element name="persistence-mode" type="persistenceMode" minOccurs="0"/>
      <xs:element name="runtime-strategy" type="runtimeStrategy" minOccurs="0"/>
      <xs:element name="marshalling-strategies" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="marshalling-strategy" type="objectModel" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="event-listeners" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="event-listener" type="objectModel" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="task-event-listeners" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="task-event-listener" type="objectModel" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="globals" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="global" type="namedObjectModel" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="work-item-handlers" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="work-item-handler" type="namedObjectModel" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="environment-entries" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="environment-entry" type="namedObjectModel" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="configurations" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="configuration" type="namedObjectModel" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="required-roles" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="required-role" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="remoteable-classes" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="remoteable-class" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="limit-serialization-classes" type="xs:boolean" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="objectModel">
    <xs:sequence>
      <xs:element name="resolver" type="xs:string" minOccurs="0"/>
      <xs:element name="identifier" type="xs:string" minOccurs="0"/>
      <xs:element name="parameters" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="parameter" type="xs:anyType" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="namedObjectModel">
    <xs:complexContent>
      <xs:extension base="objectModel">
        <xs:sequence>
          <xs:element name="name" type="xs:string" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:simpleType name="auditMode">
    <xs:restriction base="xs:string">
      <xs:enumeration value="NONE"/>
      <xs:enumeration value="JPA"/>
      <xs:enumeration value="JMS"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="persistenceMode">
    <xs:restriction base="xs:string">
      <xs:enumeration value="NONE"/>
      <xs:enumeration value="JPA"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="runtimeStrategy">
    <xs:restriction base="xs:string">
      <xs:enumeration value="SINGLETON"/>
      <xs:enumeration value="PER_REQUEST"/>
      <xs:enumeration value="PER_PROCESS_INSTANCE"/>
      <xs:enumeration value="PER_CASE"/>
    </xs:restriction>
  </xs:simpleType>
</xs:schema>

