HDR Message Submission Unit

The HDR Message Submission Unit defines a structure that contains messages processed by OMP or messages received and processed by IMP. The Submission Unit is used to audit information that is related to the processing of an xml message by IMP or OMP. Every SubmissionUnit is uniquely identified by the Instance Identifier message attribute.

This package consists of two interfaces: SubmissionUnit and SubmissionUnitService. The SubmissionUnitService interface defines the mechanism for finding and updating a persisted submission unit. The SubmissionUnit interface provides methods for accessing and updating the attributes of the SubmissionUnit.

See the following section for more information about Message Submission Unit interfaces:

Message Submission Unit

This package includes two interfaces [SubmissionUnit, SubmissionUnitService] that can be used to audit the information related to the processing of an XML message by IMP or OMP. These interfaces are described in the following sections:

Task:

Find Submission Unit: Check and Resend (see Example 9-6)

Submission Unit Interface

The SubmissionUnit interface defines a structure t'hat contains the messages processed by IMP or OMP. It contains get methods that can be used to track both inbound and outbound message processing.

The IMPService.processMessage method creates and updates the SubmissionUnit with the message id, acknowledgement typecode, acknowledgement message text, acknowledgement date, send date, sender id, receiver id, responder id, control act id, control act author id, original message, trigger event code, name of the application that submitted the SubmissionUnit and other related attributes. The processMessage method updates SubmittedByAppName to HTBIMP.

You can use SubmissionUnitService find methods to find a SubmissionUnit for a particular submission unit identifier or control act identifier.

Submission Unit Service Interface Methods

The SubmissionUnitService interface defines the methods for finding and updating a persisted submission unit. It contains the following finder methods to find persisted SubmissionUnits:

Submission Unit Service Interface Method

Method

Description

findSubmissionUnitByControlAct(II controlActId)

Returns a SubmissionUnit object with the specified control act identifier; throws ETSException

findSubmissionUnitById(java.lang.String submissionUnitId)

returns a SubmissionUnit object with the specified submission unit id; throws ETSException

findSubmissionUnitByMessage(II messageId)

Returns a SubmissionUnit object with the specified submission unit id; throws ETSException

updateSubmissionUnit(SubmissionUnit submissionUnit)

Updates SubmissionUnit; throws ETSException

createSubmissionUnit(SubmissionUnit submissionUnit)

Persists SubmissionUnit; throws ETSException

Example 9-6 Find Submission Unit: Check and Resend

Find the submission unit and check if the message generated successfully; if failed, resend the modified payload back to the receiver:

public void resendMessage(String submissionUnitId, II receiverId, II messageId)
    throws CustomerApplicationException
  {
    try {
      // Find SubmissionUnit for particular submission unit id
      SubmissionUnit subUnit =
        mSubmissionUnitService.findSubmissionUnitById(submissionUnitId);
      String ackTypeCode = subUnit.getAckTypeCode();      // If submission unit acknowledgement type code is AE, modify original message payload and 
         send it back.
      if ("AE".equals(ackTypeCode)) {
        // Get original message
        String originalMessageText = subUnit.getOriginalMessageText();
        // Modify original message
        String payload = modifyPayload(originalMessageText);
        // Resend the message
        String subId = mOMPService.resendMessage(payload, receiverId, messageId);
      }
    } catch (ETSException ETSException) {
      throw new CustomerApplicationException(ETSException.getMessage());
    }
  }  public String modifyPayload(String originalMessageText) {
    ...
    ...
    return payload;
  }