../E10229-13.mobi />

11 Batching EDI Messages

This chapter describes how to use the Oracle B2B interface to batch, schedule, and send outbound EDI X12 and EDI EDIFACT messages for outbound messages (Inbound messages to Oracle B2B are automatically debatched.)

The chapter contains the following topics:

See the following for more information about EDI:

11.1 Setting Up a Batch

Batching is often used to group messages by document type; for example, you may want to send out a batch of purchase orders or a batch of invoices, to one or more trading partners. You can also batch multiple document types, sent to one or more trading partners.

When batching more than 1000 documents, where the payload size is greater than 30 KB, specific settings are required. See "Settings for Batching a Large Number of Documents" in Oracle Fusion Middleware Performance Guide.

Figure 11-1 shows where you set up a batch transmission of EDI messages.

Figure 11-1 Scheduling a Batch

Description of Figure 11-1 follows
Description of "Figure 11-1 Scheduling a Batch"

To set up a batch, do the following:

Task 1   Search for Agreements to Batch
  1. Click the Administration link.

  2. Click the Schedule Batch tab under the Batch tab.

  3. Use the search parameters described in Table 11-1 to identify which agreements you want to batch.

    Use the document search parameters as follows: Select a document protocol name first to populate the list of document protocol versions; next select a document protocol version to populate the list of document types; and then select a document type to populate the list of document definitions.

    Table 11-1 Search Parameters for Creating a Batch

    Parameter Description

    Match All or Any

    If you select All, then fields with values are matched using an and condition. If you select Any, then fields with values are matched using an or condition.

    Responding Partner

    Select Starts With, Contains, Equals, or Ends With, and type the appropriate portion of the name of the responding trading partner.

    Agreement

    Select Starts With, Contains, Equals, or Ends With, and type the appropriate portion of the name of the agreement.

    Document Protocol Name

    Select EDI_EDIFACT or EDI_X12.

    Document Protocol Version

    Select a document protocol version that you previously created.

    Document Type

    Select a document type that you previously created.

    Document Definition

    Select a document definition that you previously created.


  4. Click Search.

    Active, deployed agreements (outbound) that meet your search criteria are displayed.

  5. Go to Task 2, "Create the Batch".

Task 2   Create the Batch
  1. Enter a unique name for the batch.

  2. Select the agreements you want to batch.

  3. Click Create Batch.

  4. Go to Task 3, "Schedule the Batch".

Task 3   Schedule the Batch
  1. Click Launch Scheduler.

  2. Select the Non-Repeating Event tab or the Repeating Event tab.

  3. For a nonrepeating event, do one of the following:

    • Enter the date in the format shown in the Scheduler dialog and click OK.

    • Or, click the Calendar button, specify a date and time, and click OK.

    For a repeating event (see Figure 11-2), enter details on the interval to trigger the event by specifying the minutes, hour, month, year, and date details. Then click OK.

    Figure 11-2 Scheduling the Batch

    Description of Figure 11-2 follows
    Description of "Figure 11-2 Scheduling the Batch"

You can see the batches you create on the Manage Batch tab.

Note:

If any one of the documents in a batch has the validation flag set to "on", the whole batch is validated.

11.1.1 Creating a Batch Based on Max Count and Max Size

This feature allows you to batch outbound EDI messages based on "Allowed Number Of Transactions" (Max Count) in batched messages or the "Allowed Size" (Max Size) of batched messages.

To batch messages based on Max Count and Max Size, do the following:

  1. Task 1, "Search for Agreements to Batch" in Setting Up a Batch.

  2. Create the batch:

    1. Enter a unique name for the batch in the Batch Name field.

    2. Select the agreements you want to batch based on "Search for Agreements to Batch".

    3. In the case of creating Batch based on "Number Of Transactions" or "Maximum Size", Schedule Range is optional. However, you can click Launch Scheduler to schedule an event (Non-Repeating or Repeating) as specified in Task 3, "Schedule the Batch".

    4. Enter a value for the size of outbound payload in KBs in the Max Size (KB) field if you want batching to occur based on size of the outbound EDI messages.

    5. Enter a value in the Max Count field if you want batching to occur based on the number of transaction of outbound EDI messages.

    6. Click Create Batch.

11.1.2 Understanding Batching Based on Batch Setup

The following are the different cases of batching based on batch setup:

  • Case 1: When creating the batch, only Max Count is specified: Batching occurs in based on the specified number of transactions.

    For example, if you specify Max Count as 4, when you enqueue four outbound EDI messages, a batched message is created having four transactions. In case you enqueue less than four messages, the messages will not get batched.

  • Case 2: When creating the batch, only Max Size (KB) is specified: Batching occurs based on the size of the messages to be batched including the size of last message.

    For example, if you specify Max Size as 4 KB, when you enqueue four outbound EDI messages of 1 KB each, a batched message of 4KB size is created. In case you enqueue messages such that the size criteria is not met, then messages will not get batched.

  • Case 3: When creating the batch, both Max Count and Max Size are specified: Batching occurs based on whichever criteria is met first.

  • Case 4: When creating the batch, you also schedule an event for the batch (using Launch Scheduler) along with Max Count and Max Size, messages are batched in the sequence of Case1, Case 2, and Case 3. However when the Timer Event occurs, it batches all the messages available for batching at that point in time (irrespective of the values provided for Max Count and Max Size.)

Note:

Batching messages based on Max Count and Max Size works following the assumptions:

  • Enqueued Outbound EDI Payload (XML) has only one transaction.

  • The size of enqueued Outbound EDI Payload (XML) is considered for the batching criteria.

11.2 Managing Batched Messages

Figure 11-3 shows where you can search for batches that you previously created, view details of a batch, and disable, update, or delete a batch.

Figure 11-3 Managing Batched EDI Messages

Description of Figure 11-3 follows
Description of "Figure 11-3 Managing Batched EDI Messages"

For the Update batch action, only the documents definitions selected can be updated. Ensure that you reselect all the documents that are to be part of the batch and not just the new ones.

In some cases, B2B may not pick up the batched messages when you update the batching schedule. If you see that batched messages are not being picked up, delete the batch and create a new batch schedule with the same name as the previous batch. The same name must be used so that B2B picks up the previous messages in WAIT_BATCH status.

11.3 Support for Sequencing Inbound Batched Messages

Oracle B2B provides support for sequencing of inbound batched messages.

When Oracle B2B receives a batched message:

  1. Oracle B2B makes only one entry in the Sequence Manager table, and the state of the message in the Sequence Manager table is set to PROCESSING.

  2. While de-batching, the messages are inserted into the Business Message table as well as the B2B_PENDING_MESSAGE table with the Sequence Number of the messages stored in an attribute column (Attribute4) of the B2B_PENDING_MESSAGE table.

  3. after the last message of a batch is processed by Oracle B2B, it changes the state of the Sequenced Message to PROCESSED, and indicates the message as a batch message by marking the messageID as BATCH_MESSAGE.

  4. After dispatching a message from a batch, Oracle B2B changes the state of the Business Message to MSG_COMPLETE and deletes the corresponding entry in the B2B_PENDING_MESSAGE table. If the Oracle B2B stops working in the middle of batch processing, on recovery, Oracle B2B sends only the messages that are present in the B2B_PENDING_MESSAGE table.

Note:

The limitation of this approach is that the batch delivery does not resume until the complete batch is processed by Oracle B2B.

Note:

Batching with sequencing is supported at the inbound side only.