Skip Headers
Oracle® Enterprise Service Bus Developer's Guide
10g (10.1.3.4.0)

Part Number E12638-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

C Resubmission APIs

This appendix describes the resubmission APIs that allow you to execute all the actions that can be performed in the ESB control, on the ESB DT server. This appendix covers the following sections:

Note:

Get the List of Instances

This API returns a list of instances matching the given filter.

Action

GetInstances

XSD

Sample

The following code snippet returns all the instances created in the last 24 hours:

String filter="<instanceFilter timeZone=\"GMT+05:30\">"+ "<startTime>86400000</startTime>"+"</errorIinstanceFilter>";
 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);

Get the List of Instances That Raised an Error

This API returns a list of errors matching the given filter.

Action

GetFailedInstances

XSD

Sample

The following code snippet returns all the instances created in the last 24 hours that raised retryable and nonretryable errors:

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);

Get All the Errors That Occurred in a Given Flow

This API returns all the errors that occurred in a given flow ID. If the error is retryable, then the corresponding error element contains the list of routing rules that are executed upon resubmission, and the payload that the user can modify before resubmission.

Action

GetErrorInstance

XSD

Sample

The following code snippet returns all the instances that raised errors for the given instance 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);

Get the XML to Draw the Instance Diagram

This API returns the XML data containing the flow details. This XML data is used to draw the instance diagram on the console.

Action

GetTrackingDetails

XSD

Sample

The following code snippet returns the XML data required to draw the instance diagram for the given flow ID.

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);

Resubmit a List of Instances by IDs

This API resubmits multiple instances that failed in multiple systems and flows. The input for this action is a list of IDs. In this case, FlowId and SystemId form a unique instanceId. During the process of resubmitting the instances, the console back end retrieves the actual payloads for these IDs from the instance store.

Action

ResubmitInstancesByIds

XSD

Sample

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);

Resubmit an Instance by ID

This API resubmits a single instance that failed in the given system that was a part of the given flow. The input for this action is an ID. In this case, FlowId and SystemId form a unique instanceId. During the process of resubmitting the instance, the console back end retrieves the actual payload for the given ID from the instance store.

Action

ResubmitInstanceById

Sample

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);

Resubmit an Instance with Modified or Unmodified Payload

This API resubmits a single instance that failed in the given system as part of the given flow. The input for this action is an XML document containing the modified/unmodified payload.

The actions mentioned in the Get the List of Instances and Get the List of Instances That Raised an Error sections can also be used to obtain the list of instances with payload that raised errors. In a loop, the user needs to call this action to submit each error instance.

Action

ResubmitInstance

XSD

Sample

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);

Get the Current Status of Instance Tracking

This API returns true if the instance tracking is enabled or false.

Action

GetTrackingConfig

XSD

Sample

The following code snippet returns current status of instance tracking:

ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);client.perform("GetTrackingConfig",null);

Enable or Disable Instance Tracking

This API enables or disables instance tracking.

Action

UpdateTrackingConfig

XSD

Sample

The following code snippet disables instance tracking:

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);

Purge the Instances Based on Time

This API purges instances based on the following criteria:

Action

UpdateTrackingConfig

XSD

Sample

The following code snippet deletes all the instances that are older than 10 minutes:

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);

Retrieve All Service Metadata

This API lists all service data as shown in the ESB Control Service Metadata view.

Action

ExploreServices

XSD

Sample

The following code lists all service metadata:

ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
String data = client.perform("UpdateTrackingConfig", null);
System.out.println("Service XML ==> "+data);

<metadata>
   <system name="DefaultSystem" guid="96DD76C0971311DABF1A87858E4395A7" qname="DefaultSystem" status="ENABLED">
      <versionInfo>
         <ID>1139232135202</ID>
         <lastModifiedTime>Thu Jun 29 08:30:55 PDT 2006</lastModifiedTime>
         <lastModifiedUser>JDev</lastModifiedUser>
      </versionInfo>
      <service name="GetMovies_SOAP" guid="4ACA9F5083F911DBBFB6F366CB962EB8" qname="DefaultSystem.GetMovies_SOAP" 
status="ENABLED" serviceType="ExternalService" typeDescription="External Service" isWSDLEditable="false">
         <versionInfo>
            <ID>1190913146234</ID>
            <lastModifiedTime>Thu Sep 27 10:12:26 PDT 2007</lastModifiedTime>
            <lastModifiedUser>oc4jadmin</lastModifiedUser>
         </versionInfo>
         <parent guid="96DD76C0971311DABF1A87858E4395A7" qname="DefaultSystem" type="system"/>
         <operations>
            <operationInfo guid="4ADFFC1083F911DBBFB6F366CB962EB8" qname="DefaultSystem.GetMovies_SOAP.GetTheatersAndMovies"
wsdlOperation="GetTheatersAndMovies" mepDisplayName="Request Response" mep="RequestResponse"/>
            <operationInfo guid="4ADFFC1183F911DBBFB6F366CB962EB8" qname="DefaultSystem.GetMovies_SOAP.GetUpcomingMovies"
wsdlOperation="GetUpcomingMovies" mepDisplayName="Request Response" mep="RequestResponse"/>
         </operations>
         <endpointProperties>
            <property name="RetryInterval" value="0"/>
            <property name="RetryCount" value="0"/>
         </endpointProperties>
      </service>

Update Service Status

This API sets the service status to ENABLED or DISABLED.

Action

UpdateServiceStatus

XSD

Sample

The following code updates the Service Status:

HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("service", guid);
requestProps.put("status", status);
ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
client.perform("UpdateServiceStatus",requestProps);