code: public ErrorEventDefinitionBuilder errorEventDefinition(String id) {
      ErrorEventDefinition errorEventDefinition = createEmptyErrorEventDefinition();
      if (id != null) {
        errorEventDefinition.setId(id);
      }
  
      element.getEventDefinitions().add(errorEventDefinition);
      return new ErrorEventDefinitionBuilder(modelInstance, errorEventDefinition);
    }
docs: Creates an error event definition with an unique id
  and returns a builder for the error event definition.
  
  @return the error event definition builder object