Developing a Regulatory Submission Complete Processor
This topic explains how to extend the out-of-the-box regulatory submission processor classes and override the postComplete 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 following table describes the solution element:
Element
|
Type
|
Description
|
postComplete(RegulatorySubmission regulatorySubmission
|
API
|
Processes the regulatory submission after successful completion of the submission process.
|
Default Behavior
The default implementation sets the submission stage attribute to Active. If a predecessor version exists, the submission stage on this version is set to Historical.
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 acknowledgement processing, create a Java class (your processor) that extends the SimpleRegulatorySubmissionProcessor or the appropriate revisable subtype processor, and then override the postComplete method. The revisable subtype processor can include AERSubmissionProcessor, ERSubmissionProcessor, RPSSubmissionProcessor, or UDISubmissionProcessor.
The following example shows an overriden postComplete method:
@Override
public RegulatorySubmission postComplete(RegulatorySubmission regulatorySubmission) throws Exception {
if (!VersionControlHelper.isLatestIteration(regulatorySubmission)) {
Object[] errorMessageObjects = new Object[1];
errorMessageObjects[0] = regulatorySubmission.getDisplayIdentifier();
throw new WTException(vcResource.class.getName(), vcResource.OBJECT_IS_NOT_LATEST, errorMessageObjects);
}
regulatorySubmission = RegulatorySubmissionHelper.setSubmissionStage(regulatorySubmission, getCompleteStage());
RegulatorySubmission previousIteration = (RegulatorySubmission) VersionControlHelper.getPredecessor(regulatorySubmission).getObject();
if (previousIteration != null) {
previousIteration = RegulatorySubmissionHelper.setSubmissionStage(previousIteration, getHistoryStage());
}
return regulatorySubmission;
}