use of io.imunity.furms.api.validation.exceptions.PolicyDocumentIsInconsistentException in project furms by unity-idm.
the class PolicyDocumentFormView method savePolicyDocument.
private void savePolicyDocument(boolean withRevision) {
PolicyDocumentFormModel policyDocumentFormModel = binder.getBean();
PolicyDocument policyDocument = PolicyDocumentFormModelMapper.map(policyDocumentFormModel);
try {
if (policyDocument.id == null)
policyDocumentService.create(policyDocument);
else if (withRevision)
policyDocumentService.updateWithRevision(policyDocument);
else
policyDocumentService.update(policyDocument);
UI.getCurrent().navigate(PolicyDocumentsView.class);
} catch (DuplicatedNameValidationError e) {
showErrorNotification(getTranslation("name.duplicated.error.message"));
} catch (PolicyDocumentIsInconsistentException e) {
showErrorNotification(getTranslation("policy.document.terminal-state.message"));
} catch (Exception e) {
showErrorNotification(getTranslation("base.error.message"));
throw e;
}
}
Aggregations