class EventPropertyWriter extends PropertyWriter {

    public void addMessage(MessageRef messageRef) {

        // since events only have one parameter, look for the only one
        if (messageRef.getStructure().isEmpty() && this.getItemDefinitions().size() == 1) {
            messageRef.setStructure(this.getItemDefinitions().get(0).getStructureRef());
        }

        MessageEventDefinition messageEventDefinition =
                bpmn2.createMessageEventDefinition();
        addEventDefinition(messageEventDefinition);

        String name = messageRef.getValue();
        if (name == null || name.isEmpty()) {
            return;
        }

        ItemDefinition itemDefinition = bpmn2.createItemDefinition();
        itemDefinition.setId(Ids.messageItem(name));
        itemDefinition.setStructureRef(messageRef.getStructure());

        Message message = bpmn2.createMessage();
        message.setName(name);
        message.setItemRef(itemDefinition);
        messageEventDefinition.setMessageRef(message);
        CustomAttribute.msgref.of(messageEventDefinition).set(name);

        addItemDefinition(itemDefinition);
        addRootElement(message);
    }

    public  EventPropertyWriter(Event event, VariableScope variableScope);

}