Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
Issue #340
  • Loading branch information
rsoika committed Jun 19, 2024
1 parent 15c17d5 commit ce88f9c
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.eclipse.glsp.server.features.validation.MarkersReason;
import org.eclipse.glsp.server.features.validation.ModelValidator;
import org.openbpmn.bpmn.elements.core.BPMNElementNode;
import org.openbpmn.bpmn.exceptions.BPMNModelException;
import org.openbpmn.bpmn.validation.BPMNValidationHandler;
import org.openbpmn.bpmn.validation.BPMNValidationMarker;
import org.openbpmn.extensions.BPMNElementExtension;
Expand Down Expand Up @@ -78,7 +79,12 @@ public class BPMNGLSPValidator implements ModelValidator {
@Override
public List<Marker> validate(final List<GModelElement> elements, final String reason) {
long l = System.currentTimeMillis();
beforeValidate(elements, reason);
try {
beforeValidate(elements, reason);
} catch (BPMNModelException e) {
logger.warning("Failed to validate model: " + e.getMessage());
e.printStackTrace();
}
List<Marker> markers = doValidate(elements, reason);
afterValidate(elements, reason);
return markers;
Expand All @@ -93,8 +99,10 @@ public List<Marker> validate(final List<GModelElement> elements, final String re
* validation mode (LIVE|BATCH).
*
* Finally it converts the Meta Model Error markers into GLSP marker objects.
*
* @throws BPMNModelException
*/
public void beforeValidate(final List<GModelElement> elements, final String reason) {
public void beforeValidate(final List<GModelElement> elements, final String reason) throws BPMNModelException {

if (MarkersReason.LIVE.equals(reason)) {
// simple case we only call the validate method from the meta model.
Expand Down

0 comments on commit ce88f9c

Please sign in to comment.