Sunday, June 23, 2013

How to Retrieve Payload From SOA Dehydration Store Using Java

Oracle has provided SOA facade and management api to retrieve the composite/instance details from the soa-infra database. List of composite instances can be retrieved based on any filter condition like between 2 dates, by instance id, by state etc. The API documentation is available at -

http://docs.oracle.com/cd/E21764_01/apirefs.1111/e10659/oracle/soa/management/facade/package-summary.html

And the detailed documentation is here -

http://docs.oracle.com/cd/E28280_01/admin.1111/e10226/soaadmin_apimanage.htm

I am listing here a code excerpt to retrieve the list of bpel instances between a give date. The actual code was to retrieve the payload that instantiated the bpel for each bpel instance in list.

First set the filter condition -

locator = LocatorFactory.createLocator(props);
CompositeInstanceFilter filter = new CompositeInstanceFilter();
filter.setMinCreationDate(minCreationDate);
filter.setMaxCreationDate(maxCreationDate);

then get the list of instances -

 List<CompositeInstance> compositeInstance =

                locator.getCompositeInstances(filter);



List<ComponentInstance> childComponentInstances;


get child component instances list by iterating through the list.

for (CompositeInstance compositeInstance1 : compositeInstance) {
                childComponentInstances =                        compositeInstance1.getChildComponentInstances(cInstanceFilter);
                                
System.out.println("Child list size -> " +                                   childComponentInstances.size()+" | name -"+compositeInstance1.getCompositeDN().getCompositeName());


iterate through childComponentInstances list to retrieve the details. AuditTrail can also be retrieved for a particular instance here in this loop.

for (ComponentInstance componentInstance1 :
                         childComponentInstances) {
System.out.println("++++++++++++++++ " +
                               componentInstance1.getComponentName() +
                                           "| Version - " + componentInstance1.getCompositeDN().getRevision() +
" | Instance ID - " +                                        componentInstance1.getCompositeInstanceId() +
" | " +                                        componentInstance1.getCreationDate());
}

}


For complete code please mail me.

1 comment:

  1. Hi Ashish, would you be able to send the full code to nisheeth.techtips@gmail.com, I needed to retrieve the pay load in SOA 12C. I wold be grateful to you. Best Regards,
    NIsheeth

    ReplyDelete

Demystifying OIC, OCI and Oracle SOA CS

What is OIC (Oracle integration cloud), OCI (Oracle cloud infrastructure), and SOA cloud service and how they are different? - This has bee...