cancel
Showing results for 
Search instead for 
Did you mean: 

Add Parser Error in ParseListener

ingo_ri
Champ in-the-making
Champ in-the-making
Hi,

I would like to back up our BPMN-extension in the ParseListener. When we parse a userTask in our ParseListener I want to add an error to inform the deployer about a missing element or attribute.

How can I do this?

Kind Regards,

Ingo
2 REPLIES 2

meyerd
Champ on-the-rise
Champ on-the-rise
Hi Ingo,

seems like for the moment, your options are limited to throwing an exception.

ingo_ri
Champ in-the-making
Champ in-the-making
Hi Daniel,

even an Exception won't stop the deployment. This is a snippet from BpmnParse:


  public BpmnParse execute() {
    super.execute(); // schema validation

    try {
      parseRootElement();

    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, "Uknown exception", e);
    } finally {
      if (hasWarnings()) {
        logWarnings();
      }
      if (hasErrors()) {
        throwActivitiExceptionForErrors();
      }
    }

    return this;
  }

Which refactoring is needed to add an error in the listener?