Mapping Oracle B2B Instance Messages to Oracle BAM Data Objects

24 Programmatically Accessing Instance Message Data 24-1 24 Programmatically Accessing Instance Message Data This chapter provides an overview of the Instance Message Java API for programmatically accessing instance message data. This chapter contains the following topics: ■ Section 24.1, Programmatically Accessing Instance Message Data ■ Section 24.2, Instance Message Java API Examples ■ Section 24.3, Troubleshooting Instance Message Java API For more information about the Instance Message API, InstanceMessageUtil class, see Oracle Fusion Middleware B2B Instance Message Java API Reference.

24.1 Programmatically Accessing Instance Message Data

Instance Message Java API is a Java API provided in Oracle B2B to retrieve runtime data that is exchanged between Trading Partners. Some Instance Message Java API use cases include: ■ Resubmitting from a back-end application ■ Checking the status for a particular order number ■ Payload introspection by a back-end application ■ Checking the remaining retries for the message ■ Checking the wire message of the payload Instance Message API queries the runtime data and provides results in the form of Instance data for various criteria. Instance Message API is a java wrapper on top of Instance Message View which encapsulates both business and wire messages. Instance Message API Query Options The Instance Message Java API enables you to retrieve the instance messages based on the following criteria: ■ Agreement name Note: When using this API, you must set additional libraries as part of the classpath in addition to b2b.jar and weblogic.jar or wlthint3client.jar. 24-2 Oracle Fusion Middleware Users Guide for Oracle B2B ■ Control number, group control number, transaction control number, Trading Partner name, and document type ■ Date range and Trading Partner ■ Date range, direction, and Trading Partner ■ Message ID ■ Message state ■ Protocol message ID ■ Trading Partner ■ Trading Partner and direction ■ Trading Partner and document type ■ Trading Partner and message state ■ Xpath expression can be evaluated on one or two XPath expressions ■ XPath value can be evaluated on one or two XPath expressions ■ Conversation ID For more information about the Instance Message API, see Oracle Fusion Middleware B2B Instance Message Java API Reference.

24.2 Instance Message Java API Examples

You can write your logic based on the out put of Vector messages = Vector imUtil.getInstanceMessagesForTPGlobalChips as shown in Example 24–1 . Another similar exposed method is getInstanceMessagesForMsgIdString messageId. All of the methods are documented in Oracle Fusion Middleware B2B Instance Message Java API Reference. Example 24–1 Retrieval based on Trading Partner Name import java.util.Vector; import oracle.tip.b2b.utility.InstanceMessageUtil; public class MyInstanceData { public static void mainString[] args throws Exception { InstanceMessageUtil imUtil = new InstanceMessageUtil; Vector messages = Vector imUtil.getInstanceMessagesForTPGlobalChips; System.out.printlnmessages.size; } }

24.3 Troubleshooting Instance Message Java API

See the following topics for troubleshooting information: ■ Section 24.3.1, Handling a Large Number of Messages ■ Section 24.3.2, Handing Large Payloads