Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MDT (Model Development Tools) » [BPMN2] own attributes removed on save
[BPMN2] own attributes removed on save [message #939165] Wed, 10 October 2012 13:38
Niko Dac is currently offline Niko DacFriend
Messages: 2
Registered: October 2012
Junior Member
Hi all,

I try to add specific attributes to my bpmn2 diagram. I followed examples to create my own property section and my own attributes.

Everything works fine when I modify the value of the attribute in my property section and I get immediately the following bpmn file and the diagram editor as dirty:

<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http:www.w3.org/2001/XMLSchema-instance" xmlns="http:sample.bpmn2.org/bpmn2/sample/collaboration" xmlns:bpmn2="http:www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http:www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http:www.omg.org/spec/DD/20100524/DC" xmlns:enrmodel2="http:www.enrichment.com/enr2" xmlns:xsd="http:www.w3.org/2001/XMLSchema" xsi:schemaLocation="http:www.omg.org/spec/BPMN/20100524/MODEL http:www.omg.org/spec/BPMN/20100524/MODEL-XMI http:www.omg.org/spec/DD/20100524/DC http:www.omg.org/spec/DD/20100524/DC-XMI http:www.omg.org/spec/BPMN/20100524/DI http:www.omg.org/spec/BPMN/20100524/DI-XMI" id="Definitions_1" expressionLanguage="http:www.w3.org/1999/XPath" targetNamespace="http:sample.bpmn2.org/bpmn2/sample/collaboration" typeLanguage="http:www.w3.org/2001/XMLSchema">
<bpmn2:collaboration id="Collaboration_1" name="Default Collaboration">
<bpmn2:participant id="Participant_1" name="Initiating Pool" processRef="bpmn2:tProcess Process_1"/>
<bpmn2:participant id="Participant_2" name="Non-initiating Pool"/>
</bpmn2:collaboration>
<bpmn2:process id="Process_1" processType="None">
<bpmn2:task id="Task_1" name="t1" completionQuantity="1" isForCompensation="false" startQuantity="1">
<bpmn2:extensionElements>
<enrmodel2:time-management enrmodel2:date="1"/>
</bpmn2:extensionElements>

</bpmn2:task>
</bpmn2:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1" name="Default Collaboration Diagram">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="bpmn2:tCollaboration Collaboration_1">
<bpmndi:BPMNShape id="BPMNShape_1" bpmnElement="bpmn2:tParticipant Participant_1">
<dc:Bounds height="1000.0" width="200.0" x="60.0" y="0.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_2" bpmnElement="bpmn2:tParticipant Participant_2">
<dc:Bounds height="1000.0" width="200.0" x="480.0" y="50.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_Task_1" bpmnElement="bpmn2:tTask Task_1">
<dc:Bounds height="50.0" width="110.0" x="75.0" y="105.0"/>
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>

I use the following code to create my attribute:

documentRoot1 = Enrmodel2Factory.eINSTANCE.createDocumentRoot();
timeManagement = Enrmodel2Factory.eINSTANCE.createTimeManagement();
EStructuralFeature f2 = documentRoot1.eClass().getEStructuralFeature("timeManagement");
documentRoot1.eSet(f2, timeManagement);
EStructuralFeature f1 = timeManagement.eClass().getEStructuralFeature("date");
timeManagement.eSet(f1, attributeValue);
ModelUtil.addExtensionAttributeValue(task, f2, timeManagement);

However, when I save the diagram, my attribute is removed from the file and I don't find how to preserve this one. I have found document on recording command, resource saving... but everything I do does not work Sad .

What is wrong in my process or what I missed to do?

Thank you for any input Smile ,

Niko
Previous Topic:EMF based project to support Reusable Asset Specification (OMG Standard)
Next Topic:[MDT-OclInEcore] Code executed for dynamic instances but not for generated editor
Goto Forum:
  


Current Time: Sun Jun 04 07:38:17 GMT 2023

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

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

Back to the top