Skip to main content



      Home
Home » Modeling » MDT (Model Development Tools) » [BPMN2] EventDefinitionsRef(using the eventDefinitionsRef in a bpmn2 model)
[BPMN2] EventDefinitionsRef [message #635544] Wed, 27 October 2010 06:05 Go to next message
Eclipse UserFriend
Hi all,

I'm trying to use the eventDefinitionsRef element in a bpmn2 model. This, because I need to have an EventDefinitions element that is reusable throughout a process model (the intended use for eventDefinitionsRef).

Creating a simple model with the BPMN2-ecore model (generated from a resource with the Bpmn2ResourceFactoryImpl) gives following XML file:

<bpmn:definitions ...>
  <bpmn:signalEventDefinition id="SignalDefinitionId" signalRef="signal"/>
  <bpmn:process id="newProcessId">
    <bpmn:startEvent id="newStartEventId1">
      <bpmn:eventDefinitionRef>SignalDefinitionId</bpmn:eventDefinitionRef>
    </bpmn:startEvent>
    <bpmn:startEvent id="newStartEventId2">
      <bpmn:eventDefinitionRef>SignalDefinitionId</bpmn:eventDefinitionRef>
    </bpmn:startEvent>
  </bpmn:process>
  <bpmn:signal id="signal"/>
</bpmn:definitions>


Notice two start events refering to the same EventDefinitions object. However, when trying to load this model again in EMF with the Bpmn2ResourceFactoryImpl, I get following error:

 org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'tEventDefinition' is not found or is abstract.


Always referring to the eventDefinitionRef element.
So saving with an EventDefinitionRef element works, but loading doesn't...

Does anyone know what is going wrong here?

Thanks,
Pieter
Re: [BPMN2] EventDefinitionsRef [SOLVED] [message #635594 is a reply to message #635544] Wed, 27 October 2010 09:19 Go to previous messageGo to next message
Eclipse UserFriend
Adding xsi:type="bpmn:tSignalEventDefinition" to the eventDefinitionsRef does the trick.

<bpmn:startEvent id="newStartEventId1">
<bpmn:eventDefinitionRef xsi:type="bpmn:tSignalEventDefinition">SignalDefinitionId
</bpmn:eventDefinitionRef>
</bpmn:startEvent>


To have this automatically when serializing a model, comment out
 //result.getDefaultSaveOptions().put(XMLResource.OPTION_SAVE_TYPE_INFORMATION,
 //        new OnlyContainmentTypeInfo());

in Bpmn2ResourceFactory

[Updated on: Wed, 27 October 2010 09:20] by Moderator

Re: [BPMN2] EventDefinitionsRef [SOLVED] [message #635614 is a reply to message #635594] Wed, 27 October 2010 10:06 Go to previous messageGo to next message
Eclipse UserFriend
Hello Pieter,

we have seen this error before (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=316591#c17), but it should have been fixed and work correctly in the current version from our repository. I'm not able to reproduce it with the current state of the BPMN2 implementation.

Which version of the BPMN2 plugins (i.e. from which date) do you use?

The solution that you've posted (removing OnlyContainmentTypeInfo) leads to problems in other areas, namely references stored in attributes (please see https://bugs.eclipse.org/bugs/show_bug.cgi?id=316591#c21 for further information).

Thanks,
Henning
Re: [BPMN2] EventDefinitionsRef [SOLVED] [message #635809 is a reply to message #635614] Thu, 28 October 2010 04:19 Go to previous message
Eclipse UserFriend
Thank you! It works now.

I was using old code from July 2010, but did an update from the Git repository earlier this week. For some weird reason, this update was unsuccessful.

I did a clean fetch, and everything is good.
Previous Topic:[Announce] Provisioning of Sphinx completed/initial contribution submitted
Next Topic:[EMF: Answered] How can I create references instead of copies of existing model objects?
Goto Forum:
  


Current Time: Tue Jun 24 21:29:26 EDT 2025

Powered by FUDForum. Page generated in 0.05745 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top