Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MDT (Model Development Tools) » [BPMN2] Using the BPMN2 editor XML as input for ATL
[BPMN2] Using the BPMN2 editor XML as input for ATL [message #606547] Mon, 26 July 2010 13:11 Go to next message
Pieter is currently offline PieterFriend
Messages: 7
Registered: July 2010
Junior Member
Hi all,

I'm defnining a transformation in ATL, which uses the BPMN2 metamodel as source.

I'd like to use the output XML from the BPMN2 editor as input for the ATL transformation. This does however not work. The output XML from the editor looks like this (conforming the BPMN2 xsd schema):


<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL-XMI" id="sid-Definitions">
<bpmn2:process id="sid-Process">
<bpmn2:startEvent id="sid-StartEvent">
<bpmn2:outgoing>sid-SF1</bpmn2:outgoing>
</bpmn2:startEvent>
<bpmn2:task id="sid-Task">
<bpmn2:incoming>sid-SF1</bpmn2:incoming>
<bpmn2:outgoing>sid-SF2</bpmn2:outgoing>
</bpmn2:task>
<bpmn2:endEvent id="sid-EndEvent">
<bpmn2:incoming>sid-SF2</bpmn2:incoming>
</bpmn2:endEvent>
<bpmn2:sequenceFlow id="sid-SF1" sourceRef="sid-StartEvent" targetRef="sid-Task"/>
<bpmn2:sequenceFlow id="sid-SF2" sourceRef="sid-Task" targetRef="sid-EndEvent"/>
</bpmn2:process>
</bpmn2:definitions>


This does conform to the BPMN metamodel, however, this is not excepted by ATL, because "definitions", "task", etc. ain't classes defined in the metamodel (rather they are attributes). A valid XML format accepted by ATL is the following:


<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns="platform:/resource/Cent2Decent/BPMN.ecore">

<Definitions id="Process1" xmi:id="Process1">
<rootElements xmi:type="Process" id="sid-Process" name="Process1" xmi:id="sid-Process">
<flowElements xmi:type="Task" name="Task1" id="sid-Task1" xmi:id="sid-Task"/>
<flowElements xmi:type="StartEvent" name="StartEvent" id="sid-StartEvent" xmi:id="sid-StartEvent"/>
<flowElements xmi:type="EndEvent" name="EndEvent" id="sid-EndEvent" xmi:id="sid-EndEvent"/>
<flowElements xmi:type="SequenceFlow" name="SF1" id="sid-SF1" sourceRef="sid-StartEvent" targetRef="sid-Task1" xmi:id="sid-SF1"/>
<flowElements xmi:type="SequenceFlow" name="SF2" id="sid-SF2" sourceRef="sid-Task1" targetRef="sid-EndEvent" xmi:id="sid-SF2"/>
</rootElements>
</TDefinitions>

</xmi:XMI>


Is there a way to switch between the two representations? Or is there a way to load the first XML file directly in ATL?
Re: [BPMN2] Using the BPMN2 editor XML as input for ATL [message #606549 is a reply to message #606547] Mon, 26 July 2010 13:43 Go to previous messageGo to next message
Henning Heitkoetter is currently offline Henning HeitkoetterFriend
Messages: 21
Registered: April 2010
Junior Member
Hi Pieter,
thanks for trying out the BPMN2 project.

What version of the BPMN2 editor are you using? Did you get it directly from our repository? If so, when?

Pieter wrote on Mon, 26 July 2010 09:11
> <bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL-XMI" id="sid-Definitions">


I'm asking because the XML file is not 100% ok, the namespace for bpmn2 should be http://www.omg.org/spec/BPMN/20100524/MODEL (without the -XMI), and this should be the behaviour of our current version.

Could you change the namespace manually (remove "-XMI" from it) and retry the transformation?

Regards,
Henning
Re: [BPMN2] Using the BPMN2 editor XML as input for ATL [message #606564 is a reply to message #606547] Tue, 10 August 2010 09:05 Go to previous messageGo to next message
Reiner Hille is currently offline Reiner HilleFriend
Messages: 18
Registered: July 2009
Junior Member
Hi Peter,
the MDT BPMN2 project supports both official file formats: XML (accrording to the OMG schema) and XMI (according to CMOF Metamodel).
The editor by default saves in XML format, as we consider it to be used more frequently. However, the editor has a "Save as" functionality. "Use File->Save as" and enter a file name with ".xmi" extension - then the file will appear in XMI format.
The code that does the conversion is rather simple - quoting now from BPMNEditor.java:

protected void doSaveAs(URI uri, IEditorInput editorInput) {
if (uri.toString().endsWith("xmi")) {
Resource oldResource = editingDomain.getResourceSet().getResources().get(0);
XMIResource newResource = new XMIResourceImpl();
editingDomain.getResourceSet().getResources().add(newResourc e);
newResource.setURI(uri);
List<EObject> content = new ArrayList<EObject>(oldResource.getContents());
for (EObject eObject : content) {
if (eObject.eClass().getName().equals("DocumentRoot")) {
newResource.getContents().addAll(eObject.eContents());
} else {
newResource.getContents().add(eObject);
}
}
oldResource.unload();
editingDomain.getResourceSet().getResources().remove(oldReso urce);

} else {
(editingDomain.getResourceSet().getResources().get(0)).setUR I(uri);
}
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
IProgressMonitor progressMonitor = getActionBars().getStatusLineManager() != null ? getActionBars()
.getStatusLineManager().getProgressMonitor() : new NullProgressMonitor();
doSave(progressMonitor);
}
Re: [BPMN2] Using the BPMN2 editor XML as input for ATL [message #719060 is a reply to message #606564] Thu, 25 August 2011 23:13 Go to previous messageGo to next message
IvannalFriend
Messages: 3
Registered: August 2011
Junior Member
Hi all,

I'm defnining a transformation in ATL, which uses the BPMN2 metamodel as target.
how can I generate the namespace for bpmn2 in the target diagram ?

Thanks in advance!
Re: [BPMN2] Using the BPMN2 editor XML as input for ATL [message #723386 is a reply to message #719060] Thu, 08 September 2011 12:50 Go to previous messageGo to next message
Henning Heitkoetter is currently offline Henning HeitkoetterFriend
Messages: 21
Registered: April 2010
Junior Member
Hello Ivannal,

could you elaborate on your problem? The mapping of namespace http://www.omg.org/spec/BPMN/20100524/MODEL to a prefix, normally bpmn2, should be generated automatically for the root element (definitions). Does this not happen in your case? What does the output of your transformation look like?

Regards,
Henning
Re: [BPMN2] Using the BPMN2 editor XML as input for ATL [message #723874 is a reply to message #723386] Fri, 09 September 2011 18:21 Go to previous messageGo to next message
Maru Missing name is currently offline Maru Missing nameFriend
Messages: 4
Registered: July 2009
Junior Member
Hello Henning,

I'm defnining a transformation in ATL, which uses the upcolbpip metamodel (a UML Profile) as source and the BPMN2 metamodel as target.

The first rule is:

module Rules;
create OUT : bpmn2 from IN : upcolbpip;
-- Crea los diagramas basicos
rule diagrams
{
	from collaboration : upcolbpip!UPColBPIPModel

	to definitions : bpmn2!Definitions
	(
		name <- collaboration.name,
		exporter <- 'Eclipse',
		exporterVersion <- '3.6'
	)
}


The output is:

<?xml version="1.0" encoding="ISO-8859-1"?>
<bpmn2:definitions xmlns:bpmn2="...omg.org/spec/BPMN/20100524/MODEL" id="_M2SWENsOEeCrqNqK_G9yTQ" exporter="Eclipse" exporterVersion="3.6" name="VMI model example"/>


Why do it generate Quote:
/>
instead of Quote:
</bpmn2:definitions>
?

how can I generate this?:
<?xml version="1.0" encoding="UTF-8"?> 
<bpmn2:definitions  
      xmlns:bpmn2="...omg.org/spec/BPMN/20100524/MODEL"  
      id="id1"> 
</bpmn2:definitions> 


P.S. I can not use links because I sent less than 5 messages.

Thanks in advance!

Re: [BPMN2] Using the BPMN2 editor XML as input for ATL [message #724360 is a reply to message #723874] Mon, 12 September 2011 07:29 Go to previous message
Henning Heitkoetter is currently offline Henning HeitkoetterFriend
Messages: 21
Registered: April 2010
Junior Member
Hello Ivanna,

why do you want to explicitly generate a closing tag instead of an empty-element tag, both being semantically equivalent? Note that your preferred version will be generated as soon as you have some child elements to the definitions element.

I'm not aware of any options that control this behavior.

Regards,
Henning
Previous Topic:[BPMN2] What determines the id type of Definitions?
Next Topic:OCLinEcore Editor in standalone application
Goto Forum:
  


Current Time: Sat Dec 20 11:41:59 GMT 2014

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

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