Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MDT (Model Development Tools) » [BPMN2] What determines the id type of Definitions?
[BPMN2] What determines the id type of Definitions? [message #718895] Thu, 25 August 2011 15:11 Go to next message
tsurdilo  is currently offline tsurdilo Friend
Messages: 41
Registered: February 2011
Member
Hi all, I am generating BPMN2 using eclipse.bpmn2 API. Looking at the generated definitions element, for example:

<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ... id="f667d0cc-fe19-49eb-90eb-2efe17812663" ..../>

the id attribute is not of type NCName, which is what it should be as per BPMN20 xsd.
Looking at the BPMN20.ecore in eclipse.bpmn2 model Definitions extends BaseElement and BaseElement defines attribute "id" of EType EString[java.lang.String].
When I change this type to NCName however, my generated BPMN2 picks up this change for all elements _except_ the definition element where the id is still of type EString.

Could someone please let me know where in the model I can specifically change the type of the id attribute of the definitions element??

I also tried changing the Diagram element in DI.ecore and set the id type to NCName, however that did not do anything either. Please let me know if there is some magic going on here or am I missing something obvious.

Thank you!!

[Updated on: Thu, 25 August 2011 15:13]

Report message to a moderator

Re: [BPMN2] What determines the id type of Definitions? [message #720090 is a reply to message #718895] Mon, 29 August 2011 21:18 Go to previous messageGo to next message
tsurdilo  is currently offline tsurdilo Friend
Messages: 41
Registered: February 2011
Member
If I change the type of the id attribute of BaseElement from EString to NCName, this is an example output I get:

<bpmn2:definitions ... id="87B71DAE-7756-41DC-9094-3C02B29C595C">
...
   <bpmn2:process ... id="_EB49660E-9F68-4B44-85F7-143F50D54961">
      <bpmn2:startEvent id="_0743078E-C560-43C8-A3D8-F7937E09B955" name="">
      ...
      </bpmn2:startEvent>
      <bpmn2:endEvent id="_97B71DAE-7756-41DC-9094-3C02B29C594B" name="">
      ...
      </bpmn2:endEvent>
   </bpmn2:process>
...
</bpmn2:definitions>


All elements that extend BaseElement, except definitions root element start with "_". This makes me think the "_" is used to make sure the id does not start with a number (which NCName should not), but not sure why it cannot be applied to the root element?

Any inputs welcome Smile

Thanks.
Re: [BPMN2] What determines the id type of Definitions? [message #723380 is a reply to message #718895] Thu, 08 September 2011 12:41 Go to previous message
Henning Heitkoetter is currently offline Henning HeitkoetterFriend
Messages: 21
Registered: April 2010
Junior Member
I'm sorry, but I cannot reproduce your problem. The generated IDs of definitions (and all other BPMN 2 elements) are, in my case, all valid NCNames due to the underscore.

They are generated during save by Bpmn2ResourceImpl, which calls EcoreUtil.generateUUID to create the IDs. This always creates an ID with underscore.

Do you do anything special when creating the resource or the BPMN model, so that Bpmn2ResourceImpl is not used?

Regards,
Henning
Previous Topic:[BPMN2] Searching for examples
Next Topic:[BPMN2] Using the BPMN2 editor XML as input for ATL
Goto Forum:
  


Current Time: Tue Apr 16 22:12:19 GMT 2024

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

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

Back to the top