class EventPropertyWriter extends PropertyWriter {

    public void addError(ErrorRef errorRef) {
        Error error = bpmn2.createError();
        ErrorEventDefinition errorEventDefinition =
                bpmn2.createErrorEventDefinition();
        addEventDefinition(errorEventDefinition);

        String errorCode = errorRef.getValue();
        String errorId;
        if (StringUtils.nonEmpty(errorCode)) {
            error.setErrorCode(errorCode);
            CustomAttribute.errorName.of(errorEventDefinition).set(errorCode);
            errorId = errorCode;
        } else {
            errorId = UUID.uuid();
        }

        error.setId(errorId);
        errorEventDefinition.setErrorRef(error);

        addRootElement(error);
    }

    public  EventPropertyWriter(Event event, VariableScope variableScope);

}