ヘッダーをスキップ
Oracle Enterprise Service Bus 開発者ガイド
10g (10.1.3.4.0)
B50869-02
  目次
目次
索引
索引

戻る
戻る
 
次へ
次へ
 

B Oracle Enterprise Service Bus API

この付録では、Oracle ESB Controlで使用できるクラスおよびインタフェースについて説明します。項目は次のとおりです。

ConsoleClientFactoryクラス

ConsoleClientオブジェクトを提供します。

package oracle.tip.esb.client;
import oracle.tip.esb.client.impl.ConsoleClientImpl;
public class ConsoleClientFactory
  {
     public static ConsoleClient getConsoleClient(String host, int port, String
     userName, String password) throws ClientException
      {
        return new ConsoleClientImpl(host,port,userName,password);
      }
  }

ConsoleClientインタフェース

Oracle ESB Controlと相互作用してメタデータおよびインスタンス・データに対するアクションを実行するためのインタフェースを提供します。

package oracle.tip.esb.client;
import java.util.Map;
public interface ConsoleClient
{
public String perform(String action, Map<String,String> requestParameters) throws ClientException;
}

perform関数

ConsoleClientインタフェースのperform関数では、コンソール・サーブレットが起動され、指定のアクションが実行されます。perform関数では、アクションにより生成されたデータが戻されます。actionパラメータで指定したアクションによりデータが生成されない場合、perform関数でClientException例外がスローされます。actionパラメータには、次のいずれかの値を指定できます。

  • GetInstances

  • GetFailedInstances

  • GetErrorInstance

  • GetTrackingDetails

  • ResubmitInstancesByIds

  • ResubmitInstancesById

  • ResubmitInstance

  • GetTrackingConfig

  • UpdateTrackingConfig

Perform関数の使用方法

perform関数を使用すると、次のタスクを実行できます。

インスタンス・リストの取得

全インスタンスのリストを取得するには、actionパラメータの値としてGetInstancesを指定します。perform関数では、指定したフィルタと一致するインスタンスのリストが戻されます。エラーが発生すると、コール元に例外が戻されます。

入力XSD要素

入力XMLは、XSDファイルのinstanceFilter要素に対応する必要があります。「XMLスキーマ・ファイル」を参照してください。

出力XSD

出力XMLは、XSDファイルのinstances要素に対応します。「XMLスキーマ・ファイル」を参照してください。

次の例では、過去1日に作成された全インスタンスが戻されます。

String filter = "<instanceFilter timeZone=\"GMT+05:30\">" +
        "   <startTime>86400000</startTime>" +
        "</instanceFilter>";

HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("filter", URLEncoder.encode(filter,"UTF-8"));

ConsoleClient client = ConsoleClientFactory.
        getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
String data = client.perform("GetInstances", requestProps);
System.out.println("Instances ==> "+data);

エラーが発生したインスタンスのリストの取得

エラーが発生したインスタンスのリストを取得するには、actionパラメータの値としてGetFailedInstancesを指定します。perform関数では、指定したフィルタと一致する、エラーが発生したインスタンスのリストが戻されます。エラーが発生すると、コール元に例外が戻されます。

入力XSD要素

入力XMLは、XSDファイルのfailedInstanceFilter要素に対応する必要があります。「XMLスキーマ・ファイル」を参照してください。

出力XSD

出力XMLは、XSDファイルのfailedInstances要素に対応します。「XMLスキーマ・ファイル」を参照してください。

次の例では、過去1日に作成され、エラーが発生した(再試行可能および再試行不可の)インスタンスがすべて戻されます。

String filter = "<failedInstanceFilter timeZone=\"GMT+05:30\">" +
        "   <startTime>86400000</startTime>" +
        "</failedIinstanceFilter>";

HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("filter", URLEncoder.encode(filter,"UTF-8"));

ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);

String data = client.perform("GetFailedInstances", requestProps);

System.out.println("Failed Instances ==> "+data);

フローIDで発生した全エラーの取得

フローIDで発生した全エラーのリストを取得するには、actionパラメータの値としてGetErrorInstanceを指定します。perform関数では、指定したフローIDで発生したエラーがすべて戻されます。エラーが再試行可能な場合は、対応するエラー要素に、再発行時に実行されるルーティング・ルールと再発行前にユーザーが変更できるペイロードのリストが含まれています。エラーが発生すると、コール元に例外が戻されます。

出力XSD

出力XMLは、XSDファイルのerrorInstances要素に対応します。「XMLスキーマ・ファイル」を参照してください。

次の例では、指定したインスタンスIDについてエラーが発生した全インスタンスが戻されます。

HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("instanceID",URLEncoder.encode("102@1164094022","UTF-8"));

ConsoleClient client = ConsoleClientFactory.        getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);

String data = client.perform("GetErrorInstance", requestProps);

System.out.println("Error Instances ==> "+data);

フローIDのインスタンス・ダイアグラムを描画するXMLの取得

フロー詳細を含むXMLを取得するには、actionパラメータの値としてGetTrackingDetailsを指定します。perform関数では、フロー詳細を含むXMLが戻されます。このXMLを使用して、コンソールにインスタンス・ダイアグラムを描画できます。エラーが発生すると、コール元に例外が戻されます。

出力XSD

出力XMLは、XSDファイルのrelationship要素に対応します。「XMLスキーマ・ファイル」を参照してください。

次の例では、指定したフローIDのインスタンス・ダイアグラムを描画する上で必要なXMLが戻されます。

HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("flowId", URLEncoder.encode("102@1164094022","UTF-8"));

ConsoleClient client = ConsoleClientFactory.        getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);

String data = client.perform("GetTrackingDetails", requestProps);
System.out.println("Instance Diagram XML ==> "+data);

ID別インスタンス・リストの再発行

複数のシステムおよびフローで失敗した複数のインスタンスを再発行するには、actionパラメータの値としてResubmitInstancesByIdsを指定します。このアクションに対する入力はIDリストです。FlowIdおよびSystemIdを使用して一意のインスタンスIDが作成されます。再発行時に、コンソール・バックエンドでは、これらのIDが表す実際のペイロードがインスタンス・ストアから取得されます。

入力XSD要素

入力XMLは、XSDファイルのresubmitInstanceIds要素に対応する必要があります。「XMLスキーマ・ファイル」を参照してください。

出力XSD

出力XMLは、XSDファイルのresubmissionFailureReport要素に対応します。「XMLスキーマ・ファイル」を参照してください。

HashMap<String,String> requestProps = new HashMap<String,String>();
String ids = "<resubmitInstanceIds>" +
             "<resubmitInstanceId flowId=\"102@1164094022\"          systemId=\"96DD76C0971311DABF1A87858E4395A7\"/>" +
         "<resubmitInstanceId flowId=\"101@1164094022\" systemId=\"96DD76C0971311DABF1A87858E4395A7\"/>" +
        "</resubmitInstanceIds"; requestProps.put("resubmitIds", URLEncoder.encode(ids,"UTF-8"));

ConsoleClient client = ConsoleClientFactory.           getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);

String data = client.perform("ResubmitInstancesByIds",requestProps);

System.out.println("Resubmit Instances By Ids Status ==> "+data);

ID別インスタンスの再発行

単一システムで失敗した複数のインスタンスを再発行するには、actionパラメータの値としてResubmitInstanceByIdを指定します。このアクションに対する入力はIDです。FlowIdおよびSystemIdを使用して一意のインスタンスIDが作成されます。再発行時に、コンソール・バックエンドでは、指定のIDが表す実際のペイロードがインスタンス・ストアから取得されます。

 HashMap<String,String> requestProps = new HashMap<String,String>();
 requestProps.put("flowId", flowId);
 requestProps.put("systemId", systemId);
 ConsoleClient client = ConsoleClientFactory.
                 getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
 client.perform("ResubmitInstanceById",requestProps);

変更済/未変更ペイロードのあるインスタンスの再発行

単一のシステムおよびフローで失敗した単一のインスタンスを再発行するには、actionパラメータの値としてResubmitInstanceを指定します。このアクションに対する入力は、変更済または未変更のペイロードを含むXML文書です。「インスタンス・リストの取得」および「エラーが発生したインスタンスのリストの取得」で前述したアクションを使用して、エラーが発生したインスタンスとペイロードのリストを取得できます。各エラー・インスタンスを発行するには、これらのアクションをループ内でコールする必要があります。

入力XSD要素

入力XMLは、XSDファイルのmessageInstance要素に対応する必要があります。「XMLスキーマ・ファイル」を参照してください。

次の例に、messageInstance要素に基づくサンプルXMLファイルを示します。

 String resubInstance = "<messageInstance  flowId="eJy_IuGNrBcA2cdYouGUGw.."
 operationGUID="776C7C10EF1D11DBBFB64F031236B6A9">
   <instanceLink subFlowId="96DD76C0971311DABF1A87858E4395A7~1" />
   <inPayload>
      <![CDATA[<PurchaseOrder xmlns="http://www.globalcompany.com/ns/sales">
                  <CustID>Fonda Automobiles</CustID>
                  <ID>4P-91S3</ID>
                  <ShipTo>
                    <Name>
                      <First>Prashant</First>
                        <Last>Nema</Last>
                    </Name>
                    <Address>
                      <Street>123, Sultod Ave</Street>
                      <City>Vasetras</City>
                      <State>Sweden</State>
                      <Zip>SW-30845</Zip>
                      <Country>Sweden</Country>
                    </Address>
                   </ShipTo>
                   <BillTo>
                     <Name>
                       <First>Matti</First>
                       <Last>Korkalop</Last>
                      </Name>
                      <Address>
                        <Street>A5G, TagenStrasse</Street>
                        <City>Ausburg</City>
                        <State>Bravaria</State>
                        <Zip>DE-15982</Zip>
                        <Country>Germany</Country>
                      </Address>
                    </BillTo>
                    <UserContact>
                       <PhoneNumber>01-41-294-2938</PhoneNumber>
                       <EmailAddress>mattik@automart.de</EmailAddress>
                    </UserContact>
                    <OrderItems>
                       <Item>
                         <ProductName>Front Glass Panel</ProductName>
                         <itemType>Automobile</itemType>
                         <partnum>F39-FR3</partnum>
                         <price>400.00</price>
                         <Quantity>1</Quantity>
                       </Item>
                       <Item>
                         <ProductName>Al Wheel Hub</ProductName>
                         <itemType>Assembly</itemType>
                         <partnum>45-JRP4</partnum>
                         <price>900.00</price>
                         <Quantity>3</Quantity>
                       </Item>
                   </OrderItems>
                   <OrderDate>2003-11-12</OrderDate>
                   <OrderPrice>5100.00</OrderPrice>
                   <OrderStatus>unknown</OrderStatus>
             </PurchaseOrder>
                ]]>
    </inPayload>
</messageInstance>";

HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("resub", URLEncoder.encode(resubInstance,"UTF-8"));
ConsoleClient client = ConsoleClientFactory.                    getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);

client.perform("ResubmitInstance",requestProps);

インスタンスの現行のトラッキング・ステータスの取得

インスタンス・トラッキングが有効化されているかどうかを確認するには、actionパラメータの値としてGetTrackingConfigを指定します。perform関数では、インスタンス・トラッキングが有効化されている場合はtrue、それ以外の場合はfalseが戻されます。

出力XSD

出力XMLは、XSDファイルのinstanceManage要素に対応します。「XMLスキーマ・ファイル」を参照してください。

次の例では、インスタンスの現行のトラッキング・ステータスが戻されます。

ConsoleClient client = ConsoleClientFactory.                  getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);

client.perform("GetTrackingConfig",null);

インスタンス・トラッキングの有効化/無効化

インスタンス・トラッキングを有効化または無効化するには、actionパラメータの値としてUpdateTrackingConfigを指定します。

入力XSD要素

入力XMLは、XSDファイルのinstanceManage要素に対応する必要があります。「XMLスキーマ・ファイル」を参照してください。

次の例では、インスタンス・トラッキングが無効化されます。

String config = "<instanceManage enable=\"false\" />"
HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("root", config);
ConsoleClient client = ConsoleClientFactory.                  getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
client.perform("UpdateTrackingConfig", requestProps);

時間に基づくインスタンスのパージ

時間に基づいてインスタンスをパージするには、actionパラメータの値としてUpdateTrackingConfigを指定します。インスタンスのパージ基準として、allまたはOlder than <TIME>を使用できます。

入力XSD要素

入力XMLは、XSDファイルのpurgeInstance要素に対応する必要があります。「XMLスキーマ・ファイル」を参照してください。

次の例では、経過時間が10分を超えているインスタンスがすべて削除されます。

String purge = "<purgeInstance userPurgeTimePeriod=\"600000\"/>";
 HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("root", purge);
ConsoleClient client = ConsoleClientFactory.                  getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
client.perform("UpdateTrackingConfig", requestProps);

XMLスキーマ・ファイル

次の例に、インスタンス・トラッキングに使用するXMLスキーマ・ファイルの定義を示します。

<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema elementFormDefault="qualified"
 targetNamespace="http://www.oracle.com/esb"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:esb="http://www.oracle.com/esb" xmlns="http://www.oracle.com/esb">
<!-- Elements for relationship diagram -->

  <xsd:element name="relationship">
    <xsd:annotation>
      <xsd:documentation>
        Provides the data required to render the relationship diagram
        on the console
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="service">
            <xsd:complexContent>
              <xsd:extension base="RelationshipService">
                <xsd:sequence>
                  <xsd:element name="linkedServices" minOccurs="0">
                    <xsd:complexType>
                      <xsd:sequence>
                        <xsd:element name="service"
                                     type="RelationshipService"
                                     maxOccurs="unbounded"/>
                      </xsd:sequence>
                    </xsd:complexType>
                  </xsd:element>
                </xsd:sequence>
              </xsd:extension>
            </xsd:complexContent>
          </xsd:element>
          <xsd:element name="serviceLinks" minOccurs="0">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="serviceLink" maxOccurs="unbounded">
                  <xsd:complexType>
                    <xsd:sequence>
                      <xsd:element name="operationLink"
                                   maxOccurs="unbounded">
                        <xsd:complexType>
                          <xsd:sequence>
                            <xsd:element ref="property"
                                         maxOccurs="unbounded">
                              <xsd:annotation>
                                <xsd:documentation>
                                  Will have one of the following
                                  properties
                                    executionType - Immediate |
                                                    Deferred
                                    subscriptionType - Local | Remote
                                    phase - The phase value
                                    filter - Subscription filter
                                             expression
                                    mep - One-Way | RequestResponse |
                                          RequestResponseFault |
                                          SolicitResponse |
                                          Notification
                                    transformFile - ESB URL to XSL file
                                    replyTransformFile - ESB URL to XSL
                                                         file
                                    faultTransformFile - ESB URL to XSL
                                                         file

                                    replyHandler - Guid of the service,
                                                    which the response
                                                    is routed to
                                    replyHandlerOperation -
                                        Name of the operation,
                                        which the response is routed to
                                    faultHandler -
                                        Guid of the service, which the
                                        fault is routed to
                                    faultHandlerOperation -
                                        Name of the operation, which
                                        the fault is routed to

                                    Following properties are used ONLY
                                    for Instance Diagram

                                    status - Completed | Faulted |
                                             Error | In-Flight |
                                             Filtered | NotElgible |
                                             Committed | RolledBack
                                    errorType - Transform |
                                                Reply_Transform |
                                                Fault_Transform
                                    routedOutputTo - Source | Ignored |
                                                     Handler
                                </xsd:documentation>
                              </xsd:annotation>
                            </xsd:element>
                            <xsd:element name="replyHandlerLink"
                                         type="HandlerLink"
                                         minOccurs="0"/>
                            <xsd:element name="faultHandlerLink"
                                         type="HandlerLink"
                                         minOccurs="0"/>
                          </xsd:sequence>

                          <xsd:attributeGroup ref="RelationshipLink"/>
                        </xsd:complexType>
                      </xsd:element>
                    </xsd:sequence>
                    <xsd:attributeGroup ref="RelationshipLink"/>
                  </xsd:complexType>
                </xsd:element>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:complexType name="HandlerLink">
    <xsd:sequence>
      <!-- Contains the following properties
      status - Completed | Error | In-Flight
      transformFile - XSL file
      -->
      <xsd:element ref="property" maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string" use="required"/>
    <xsd:attribute name="serviceGUID" type="xsd:string"
                   use="required"/>
    <xsd:attribute name="operation" type="xsd:string" use="required"/>
  </xsd:element>

  <xsd:complexType name="RelationshipService">
    <xsd:sequence>
      <xsd:element ref="property" maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>
            Contains the following properties:
              id - unique id
              system - Name of the system that this service belongs to
              status - ENABLED | DISABLED for Relationship diagram
                       Completed | Faulted | Error | In-Flight |
                       Committed | RolledBack for instance diagram
              depth - To be used to place the service icons at
                      appropriate places on the console

            BPEL process specific properties
              processDomain - Domain name
              processName - The name of the bpel process
              processVersion - version
              host - The host name where bpel service runs
              port - bpel service port
              instanceId - Bpel instance id

            Overlay properties
              latency - Average execution time in milliseconds taken
                        for the service to process messages
              throughput - Average number of messages processed by the
                           service in a minute
              instanceCount -  Total number of messages processed by
                               the service
              failureCount -  Total number of messages that the service
                              could not process sucessfully

              Above-mentioned overlay properties are ONLY for
              relationship diagram

              changeType - Modified | Deleted
              executionTime - Time taken in millieseconds to process a
                              message.
              lastActivityTime - Time when the last activity recorded
                                for service during a message processing

              Above-mentioned overlay properties are ONLY for instance
              diagram

            The overlay properties depend on the instance tracking
            data.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <!-- Only for instance diagram -->
     <xsd:element name="trackableFields" type="TrackableFieldValueList"
                  minOccurs="0"/>
    </xsd:sequence>
    <!-- contains guid, qname and name attribute -->
    <xsd:attributeGroup ref="IdentifierInfo"/>
    <xsd:attributeGroup ref="ServiceTypeInfo"/>
    <xsd:attribute name="version" type="xsd:long"/>
  </xsd:complexType>
  <xsd:attributeGroup id="RelationshipLink">
    <xsd:attribute name="source" type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>
           Represents the name of the source that invokes the
           target. If the source service is Inbound Adapter Service,
           this attribute will not be present in the xml
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute name="target" type="xsd:string" use="required">
      <xsd:annotation>
        <xsd:documentation>
           Represents the name of the target that gets invoked
          by the source
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:attributeGroup>
       <xsd:element name="property">
    <xsd:annotation>
      <xsd:documentation>
        Represents a name-value pair
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:restriction base="xsd:any">
          <xsd:attribute name="name" type="xsd:string" use="required"/>
          <xsd:attribute name="value" type="xsd:string"
                         use="required"/>
        </xsd:restriction>
      </xsd:simpleContent>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="instanceStatusMessage" type="xsd:string"
               minOccurs="0">
    <xsd:annotation>
      <xsd:documentation>
        Holds a message providing more information about an activity
        based on the status.
        If the status is error, this element will have the error
        message.
        If the status is faulted, this element will have the fault
        message generated by the target serice.
      </xsd:documentation>
    </xsd:annotation>
  </xsd:element>


<!-- Elements and types for Instances-->

  <xsd:element name="instances">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="instance" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attribute name="instanceCount" type="xsd:string"/>
      <xsd:attribute name="availableMore" type="xsd:boolean"/>
      <xsd:attribute name="generatedTime" type="xsd:dateTime"/>
      <xsd:attribute name="generatedTimeString" type="xsd:string"/>
    </xsd:complexType>
   </xsd:element>
  <xsd:element name="instance">
    <xsd:complexType>
      <xsd:attribute name="flowId" type="xsd:string" use="required"/>
        <!-- Service GUID for Inbound adapter service
             SOAP
             Java -->
      <xsd:attribute name="initiatedBy" type="MessageSource"
                     use="required"/>
      <xsd:attribute name="initiatedAt" type="xsd:dateTime"
                     use="required"/>
      <xsd:attribute name="initiatedAtString" type="xsd:string"
                     use="required"/>
      <xsd:attribute name="status" type="InstanceStatus"/>
      <xsd:attribute name="type" type="xsd:string"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:simpleType name="MessageSource">
    <xsd:restriction base="xsd:TOKEN">
      <xsd:enumeration value="Service"/>
      <xsd:enumeration value="SOAP"/>
      <xsd:enumeration value="Java"/>
      <xsd:enumeration value="Unknown"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="InstanceStatus">
    <xsd:restriction base="xsd:TOKEN">
      <!-- <xsd:enumeration value="Completed"/> -->
      <xsd:enumeration value="Error"/>
      <xsd:enumeration value="Faulted"/>
      <!-- <xsd:enumeration value="In-Flight"/> -->
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:element name="instanceFilter">
    <xsd:complexType>
      <xsd:sequence>
        <!-- Flow id to uniquely identify a flow
        If flow id is present in the filter, rest of the filters will
        be ignored.
        -->
        <xsd:element name="flowId" type="xsd:string" minOccurs="0"/>
        <!-- Activity in last 'n' seconds | minutes | hours | days.
        The value should be converted to milliseconds
        -->
        <xsd:element name="startTime" type="xsd:long" minOccurs="0"/>
        <xsd:element name="serviceGUID" type="xsd:string"
                     minOccurs="0"/>
        <xsd:element name="status" type="InstanceStatus"
                     minOccurs="0"/>
        <xsd:element name="trackableFields"
                     type="TrackableFieldValueList"
          minOccurs="0"/>
      </xsd:sequence>
      <xsd:attribute name="timeZone" type="xsd:TOKEN" use="required"/>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="failedInstanceFilter">
    <xsd:complexType>
      <xsd:complexContent>
         <xsd:extension base="instanceFilter"/>
           <xsd:sequence>
             <xsd:element name="errorMessageContains" type="xsd:string"
                          minOccurs="0"/>
           </xsd:sequence>

           <!-- The starting number of the instance page -->
     <xsd:attribute name="pageStartsFrom" type="xsd:integer"
                          default="1"/>

         <!-- The size of the instance page.
          If omitted,  only 100 (that is default for instance
                search) instances would be retured with
               "availableMore" attribute set to true in
         "FailedInstances" output element -->
        <xsd:attribute name="pageSize" type="xsd:integer"/>

       <!-- Error message, Stacktrace and payload would be included
                only if this flag is set to true -->
           <xsd:attribute name="includeMoreDetails"
                          type="xsd:boolean"/>

        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
  </xsd:element>
  <xsd:complexType name="TrackableFieldValueList">
    <xsd:sequence>
      <xsd:element name="trackableField" maxOccurs="unbouunded">
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension base="xsd:string">
              <xsd:attribute name="name" type="xsd:string"
                             use="required"/>
              <xsd:attribute name="operator" type="xsd:string"/>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="operator">
        <xsd:simpleType>
          <xsd:restriction base="xsd:TOKEN">
            <xsd:enumeration value="AND"/>
            <xsd:enumeration value="OR"/>
          </xsd:restriction>
        </xsd:simpleType>
    </xsd:attribute>
  </xsd:complexType>

  <xsd:complexType name="MessageInstanceType">
    <xsd:sequence>
      <xsd:element name="instanceLink" type="InstanceLinkType"
                   minOccurs="1" maxOccurs="unbounded"/>
      <!-- Request payload -->
      <xsd:element name="inPayload" type="xsd:string"/>
    </xsd:sequence>
    <xsd:attribute name="flowId" type="xsd:string" use="required"/>
    <xsd:attribute name="batchId" type="xsd:string"/>
    <!-- QName of the service -->
    <xsd:attribute name="serviceQName" type="xsd:string"/>
    <xsd:attribute name="operationGUID" type="xsd:string"/>
    <!-- name of the operation -->
    <xsd:attribute name="operationQName" type="xsd:string"/>
  </xsd:complexType>

  <xsd:complexType name="InstanceLinkType">
    <xsd:sequence>
      <xsd:element name="filterExpression" type="xsd:string"
                   minOccurs="0"/>
      <xsd:element name="xslFileURL" type="xsd:string"  minOccurs="0"/>
    </xsd:sequence>
    <xsd:attribute name="guid" type="xsd:string"/>
    <xsd:attribute name="subFlowId" type="xsd:string" use="required"/>
    <!-- QName of the target service -->
    <xsd:attribute name="serviceQName" type="xsd:string"
                   use="required"/>
    <!-- QName of the target operation -->
    <xsd:attribute name="operationQName" type="xsd:string"
                   use="required"/>
  </xsd:complexType>

  <xsd:element name="messageInstance" type="MessageInstanceType"/>

  <xsd:element name="messageInstances"
    <xsd:complexType>
       <xsd:sequence>
           <xsd:element ref="messageInstance" maxOccurs="unbounded"/>
       </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="errorInstances"
    <xsd:complexType>
       <xsd:sequence>
           <xsd:element ref="errorInstance" maxOccurs="unbounded"/>
       </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="errorInstance">
    <xsd:complexType>
      <xsd:complexContent>
        <xsd:extension base="MessageInstanceType">
          <xsd:sequence>
            <xsd:element name="failedInstanceLink"
                         type="FailedInstanceLinkType" minOccurs="1"
                         maxOccurs="unbounded"/>
            <!-- This will be present only if the retryable attribute
                 value is true -->
            <xsd:element ref="messageInstance"/>
          </xsd:sequence>
          <xsd:attribute name="retryable" type="xsd:boolean"
                         use="required"/>
          <xsd:attribute name="serviceType" type="xsd:string"
                         use="required"/>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
  </xsd:element>

  <xsd:complexType name="FailedInstanceLinkType">
    <xsd:complexContent>
      <xsd:extension base="InstanceLinkType">
        <xsd:sequence>
            <xsd:element name="failureTime" type="xsd:dateTime"/>
            <xsd:element name="failureTimeString" type="xsd:string"/>
            <xsd:element name="errorMessage" type="xsd:string"/>
            <xsd:element name="exception" type="xsd:string"
                         minOccurs="0"/>
            <xsd:element name="outPayload" type="xsd:string"
                         minOccurs="0"/>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>


  <xsd:element name="failedInstances">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="failedInstance" maxOccurs="unbounded"/>
      </xsd:sequence>
      <!-- Indicates more instances are available matching the given
           filter -->
      <xsd:attribute name="availableMore" type="xsd:boolean"/>
    </xsd:complexType>
  </xsd:element>

  <!-- Describes the details of an errored instance -->
  <xsd:element name="failedInstance">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="failureTime" type="xsd:dateTime"/>
        <xsd:element name="errorMessage" type="xsd:string"/>
        <xsd:element name="exception" type="xsd:string" minOccurs="0"/>
        <xsd:element name="inPayload" type="xsd:string"/>
      </xsd:sequence>
      <xsd:attribute name="flowId" type="xsd:string" use="required"/>

      <!-- Id of the system in which the deferred subscription failed
       -->
      <xsd:attribute name="systemId" type="xsd:string"/>

      <!-- Qname of the failed service -->
      <xsd:attribute name="serviceQName" type="xsd:string"/>

      <!-- Name of the failed operation -->
      <xsd:attribute name="operationName" type="xsd:string"/>

      <!-- Indicates If the instance is retryable -->
      <xsd:attribute name="retryable" type="xsd:boolean"
                     use="required"/>

    </xsd:complexType>
  </xsd:element>


  <!-- Contains the list of Ids to be used to resubmit the failed instances -->
  <xsd:element name="resubmitInstanceIds">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="resubmitInstanceId"
                     type='ResubmitInstanceId' maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attribute name="onError" default="SkipAndContinue">
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <!-- Indicates that the resubmission should continue, even
              if the resubmission failed for an id. At the end,
              the API would return the details on the failed ids -->
            <xsd:enumeration value="SkipAndContinue"/>
            <!-- Indicates that the resubmission should terminate with
                 an exception -->
            <xsd:enumeration value="Abort"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute>
      <!-- Applicable only if onError is SkipAndContinue -->
      <xsd:attribute name="abortThreshold" type="xsd:integer"/>
      <!-- Delay to be applied between resubmits to avoid message
           flooding -->
      <xsd:attribute name="delay" type="xsd:long"/>
    </xsd:complexType>
  </xsd:element>

  <xsd:complexType name="ResubmitInstanceId">
    <!-- The id of the flow for which the errored instance should be
         resubmitted -->
    <xsd:attribute name="flowId" type="xsd:string" use="required"/>
    <!-- The id of the system in which the errored instance should be
         processed -->
    <xsd:attribute name="systemId" type="xsd:string" use="required"/>
  </xsd:complexType>

  <xsd:element name="resubmissionFailureReport">
    <xsd:complexType>
      <xsd:complexContent>
        <xsd:extension base="ResubmitInstanceId">
          <xsd:sequence>
            <xsd:element name="reason" type="xsd:string"/>
            <xsd:element name="exception" type="xsd:string"
                         minOccurs="0"/>
          </xsd:sequence>
          <xsd:attribute name="aborted" type="xsd:boolean"/>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="instanceManage">
    <xsd:complexType>
        <!-- True if instance tracking is enabled. or false -->
        <xsd:attribute name="enable" type="xsd:boolean"
                       use="required"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="purgeInstance">
    <xsd:complexType>
        <!-- long value indicating the date. The instances, which are
             older than the given date would be deleted.
          If userPurgeTimePeriod=0, all the instances would be deleted
        -->
        <xsd:attribute name="userPurgeTimePeriod" type="xsd:long" use="required"/>
    </xsd:complexType>
  </xsd:element>

</xsd:schema>