Controlling the Visibility of the Track Regulatory Submission Action
This topic explains how to manage the visibility of the Track Regulatory Submission action using the API developed to support this functionality.
TrackRegulatorySubmissionValidator API supports the AbstractRegSubmission2Processor API to control the visibility of the action Track Regulatory Submission for revisable regulatory submission. If simple reg sub is provided then the API returns an error.
Solution Elements
The next table describes the solution elements.
Element
|
Type
|
Description
|
AbstractRegSubmission2Processor
|
API
|
Used to manage the visibility of the Track Regulatory Submission action.
|
TrackRegulatorySubmissionValidator
|
API
|
Used to process the AbstractRegSubmission2Processor API.
|
Default Behavior
By default, the Track Regulatory Submission action is visible if the regulatory submission is in the SUBMITTING stage and when the regulatory submission type has a defined Tracking Layout attribute panel.
@Override
public boolean performTrackRegSubActionValidation(RegulatorySubmission regSub2) throws WTException {
if (!SubmissionStage.SUBMITTED.equals(regSub2.getSubmissionStage())) {
return false;
}
TypeIdentifier type = TypeIdentifierHelper.getType(regSub2);
LayoutDefinitionReadView layout = TypeDefinitionServiceHelper.service.getLayoutDefinition(type,
ScreenDefinitionName.TRACKING_LAYOUT.toString(), null);
Collection<ScreenDefinitionReadView> layoutScreens = layout.getAllScreens();
// if the screen layout is empty (default is returned) and the layout is not the tracking one
if (layoutScreens.isEmpty()
|| !layoutScreens.iterator().next().getName().equals(ScreenDefinitionName.TRACKING_LAYOUT.toString())) {
// the layout has a default layout at the start so the layoutScreens will never be empty, that's why second
// condition needs to be checked
return false;
}
return true;
}