Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Generated model in bad format(ATL transformation)
Generated model in bad format [message #1414768] Mon, 01 September 2014 09:07 Go to next message
behnaz changizi is currently offline behnaz changiziFriend
Messages: 11
Registered: January 2014
Junior Member
Hi,
I have a small set of ATL rules to refine a BPMN2.0 model into another BPMN2.0 model.
The problem I encounter is that the nested elements are shown in a wierd format.
For instance a Process inside a definition appears as:

<rootElements xsi:type="bpmn2:Process" id="process_1" name="Default Process">

rather than

<bpmn2:Process id="process_1" name="Default Process">

Also the namespace are not shown properly in the header part of xml. So instead of


the generated output has the following format:

<xmi:XMI xmi:version="2.0" xmlns:xmi="xxx" xmlns:xsi="xxx" xmlns:bpmn2=xxx>

rather than

<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="xxx" xmlns:bpmn2="xxx" xmlns:bpmndi="xxx" xmlns:dc="xxx" xmlns:di=" xxx" id="Definitions_1" targetNamespace="xxx">

The followings are my ATL rules, the BPMN20 ecore matamodel, the input and the output file. I am using the BPMN2.0 ecore from eclipse.org/bpmn2-modeler.

Does anyone have an idea what might be wrong?
Many thanks in advance,
Behnaz

--@nsURI bpmn2=xxx
module b2b;
create OUT: bpmn2out from IN: bpmn2;

rule transaction {
from
t : bpmn2!Transaction
to
b : bpmn2out!Transaction(name <- t.name, id <- t.id)
}


rule process {
from
t : bpmn2!Process
to
c : bpmn2out!Process(name <- t.name, id <- t.id
, supports <- t.supports
, processType <- t.processType
, flowElements <- t.flowElements
)
}


rule definition {
from
t : bpmn2!Definitions(not false)
to
c : bpmn2out!Definitions(id <- t.id
,rootElements <- t.rootElements
, diagrams <- t.diagrams
)
}


rule baseElement {
from
t : bpmn2!BaseElement(not t.oclIsTypeOf(bpmn2!Definitions) and
not t.oclIsTypeOf(bpmn2!Process) and not t.oclIsTypeOf(bpmn2!Transaction)
and not t.oclIsKindOf(bpmn2!Event) and not t.oclIsKindOf(bpmn2!EventDefinition)
and not t.oclIsKindOf(bpmn2!Task) and not t.oclIsKindOf(bpmn2!FlowElement))
to
c : bpmn2out!BaseElement(id <- t.id)
}

rule startEvent {
from
a : bpmn2!StartEvent
to
d : bpmn2out!StartEvent(name <- a.name)
}

rule endEvent {
from
a : bpmn2!EndEvent
to
d : bpmn2out!EndEvent(name <- a.name)
}

rule task {
from
a : bpmn2!Task
to
d : bpmn2out!Task(name <- a.name)
}

rule sequenceFlow {
from
a : bpmn2!SequenceFlow
to
d : bpmn2out!SequenceFlow(name <- a.name)
}

rule cancelEventDefinition {
from
a : bpmn2!CancelEventDefinition
to
d : bpmn2out!CancelEventDefinition(id <- a.id)
}

P.S. I had to remove URL in order to post my message. Please see the attachments.
  • Attachment: sn.atl
    (Size: 1.43KB, Downloaded 364 times)
  • Attachment: process_1.bpmn
    (Size: 5.87KB, Downloaded 400 times)
  • Attachment: o.bpmn
    (Size: 0.94KB, Downloaded 313 times)
  • Attachment: BPMN20.ecore
    (Size: 255.71KB, Downloaded 276 times)
Re: Generated model in bad format [message #1414776 is a reply to message #1414768] Mon, 01 September 2014 09:25 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
You get the xmi wrapper as your ATL isn't creating a valid output model. For example you have StartEvent, EndEvent incorrectly transformed. If you have all the elements tarnsformed correctly then the nesting in the XML of the ouput model will be correct and you will not get the xmi wrapper. So basically the xmi element is there because you have multiple root elements in your outpur instead of one i.e. bpmn2:definitons
Regards,
Ronan
Re: Generated model in bad format [message #1416042 is a reply to message #1414776] Thu, 04 September 2014 08:07 Go to previous messageGo to next message
behnaz changizi is currently offline behnaz changiziFriend
Messages: 11
Registered: January 2014
Junior Member
Thanks Ronan for your reply.
I can't agree more with you that the output is wrong. However, the cause is still unclear to me.
Mentioning the rootElements, I only have one rootElement that is the process in the output.
The rules generating Start and End events are very basic. It seems to me they generate the correct element (if I make the condition of other rules false, I get the correct results from these rules), but the problem is when they are set inside another element e.g rootElement.

rule startEvent {
from
a : bpmn2!StartEvent
to
d : bpmn2out!StartEvent(name <- a.name)
}

rule endEvent {
from
a : bpmn2!EndEvent
to
d : bpmn2out!EndEvent(name <- a.name)
}

Any thought?
Thanks,
B
Re: Generated model in bad format [message #1416141 is a reply to message #1416042] Thu, 04 September 2014 12:25 Go to previous messageGo to next message
behnaz changizi is currently offline behnaz changiziFriend
Messages: 11
Registered: January 2014
Junior Member
I have also notices in java APIs for writing the model into a file, the user guide in camunda website suggests to "disable generation of xsi:schemaLocation because that may generate wrong entries"
By
Map<String, Boolean> options = new HashMap<String, Boolean>();
options.put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.FALSE);
..
resource.save(out, options);

I was wondering if it has any connection to my problem.
Thanks,
B
Re: Generated model in bad format [message #1416146 is a reply to message #1416042] Thu, 04 September 2014 12:32 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
You must write some ATL inside your rules to say where the elements should be nested. So for example where is the code to nest the EndEvent and StartEvent into a container? ATL can't guess how your model should be generated you need to explicitly state how the transform will work. If you don't state where the elements should be nested you will get them all at the root, like you have.
Regards,
Ronan
Re: Generated model in bad format [message #1416153 is a reply to message #1416146] Thu, 04 September 2014 12:49 Go to previous messageGo to next message
behnaz changizi is currently offline behnaz changiziFriend
Messages: 11
Registered: January 2014
Junior Member
Sure Ronan and I am telling ATL in the following rules:
rule process {
from
t : bpmn2!Process
to
c : bpmn2out!Process(name <- t.name, id <- t.id
, supports <- t.supports
, processType <- t.processType
, flowElements <- t.flowElements
)
}


rule definition {
from
t : bpmn2!Definitions(not false)
to
c : bpmn2out!Definitions(id <- t.id
,rootElements <- t.rootElements
, diagrams <- t.diagrams
)
}

which says the flowElements should go inside Process and rootElement should be nested in definition.
Their place in the output is also correct but the generated tag for them is incorrect.
Re: Generated model in bad format [message #1416158 is a reply to message #1416153] Thu, 04 September 2014 13:02 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
I don't know the BPMN MetaModel so well but it looks to me like the generated elements are *not* in the right place. The element names are wrong because they are not postioned correctly. When you get your nesting fixed they will be serialized correctly. So from what I can see your transformation is incomplete. For example the rule startEvent is running but you don't have it matched inside another rule, thus the output of startEvent goes int eh wrong place. Fix the transform and the output will serialize correctly.
Regards,
Ronan
Re: Generated model in bad format [message #1783105 is a reply to message #1416158] Thu, 08 March 2018 00:41 Go to previous message
Leonel Peña is currently offline Leonel PeñaFriend
Messages: 2
Registered: February 2018
Junior Member
I know this post is old but I have the same problem do you fix it? if yes how?
Previous Topic:[EMFTVM] generate model
Next Topic:ATL how to Hide Tag?
Goto Forum:
  


Current Time: Thu Apr 18 08:44:12 GMT 2024

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

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

Back to the top