In createDocument method of org.nuxeo.ecm.core.api.AbstractSession class, the validation service is called before the event aboutToCreate is sent
@Override public DocumentModel createDocument(DocumentModel docModel) { ... // document validation if (getValidationService().isActivated(DocumentValidationService.CTX_CREATEDOC, options)) { (line 678) DocumentValidationReport report = getValidationService().validate(docModel, true); if (report.hasError()) { throw new DocumentValidationException(report); } } ... (line 692) notifyEvent(DocumentEventTypes.ABOUT_TO_CREATE, docModel, options, null, null, false, true); // no lifecycle ... // yet
It should be called after to make the validation pass on every modified fields and just before the creation.
Because such a change cannot be backported as if, a flag must be used to change the order.