Developing a Clean Transmission Content Processor
This topic explains how to extend the out-of-the-box regulatory submission processor classes and override the clean transmission content method with the agency-specific processing method.
Solution
Create a custom class that extends an out-of-the-box regulatory submission processor.
Create an xconf entry to register your custom class.
Solution Elements
The next table describes the various solution elements.
Element
Type
Description
cleanTransmissionContent(RegulatorySubmission regulatorySubmission)
API
Cleans the appropriate content on the regulatory submission object during preparation for submission.
getRegulatoryContentCategoriesToClean(RegulatorySubmission regulatorySubmission)
API
Provides the list of regulatory content categories that need to be removed.
Default Behavior
During preparation of a submission or resubmission, any existing acknowledgement message and regulatory content that requires recapture in the process is deleted. The getRegulatoryContentCategoriesToClean method provides the regulatory content categories that need to be removed. The regulatory content categories include the regulatory submission payload, acknowledgement 1, acknowledgement 2, and acknowledgement 3. Any regulatory content category that does not currently exist on the regulatory submission is considered as removed for the submission.
The default implementation is intended primarily for demonstrational and instructional purposes. However, it does represent a typical best practice that may be suitable for many Regulatory Submission types. Implementors can create a submission-specific processor that matches the provided documentation, according to their requirements.
Creating Custom Classes
To customize the clean-up processing, create a Java class (your processor) that extends the SimpleRegulatorySubmissionProcessor or the appropriate revisable subtype processor, and then override the cleanTransmissionContent method. The revisable subtype processor can include AERSubmissionProcessor, ERSubmissionProcessor, RPSSubmissionProcessor, or UDISubmissionProcessor.
The following example shows an overridden cleanTransmissionContent method:
@Override
public RegulatorySubmission cleanTransmissionContent(RegulatorySubmission regulatorySubmission) throws Exception {
RegulatoryContentCategory[] regulatoryContentToDeleteBeforeTransmit = getRegulatoryContentCategoriesToClean(
regulatorySubmission);
for (RegulatoryContentCategory regulatoryContentCategory : regulatoryContentToDeleteBeforeTransmit) {
try {
regulatorySubmission = RegulatoryContentHelper.getService()
.deleteRegulatoryContent(regulatorySubmission, regulatoryContentCategory);
} catch (WTException e) {
if (!e.getExceptionIdentifier().contains(regmstrResource.NO_CONTENT_FOR_CATEGORY)) {
throw e;
}
}
}
regulatorySubmission = RegulatorySubmissionHelper.service
.deleteAcknowledgementMessages(regulatorySubmission);
return regulatorySubmission;
}
Related Topic
Est-ce que cela a été utile ?