| ATL rules doesn't match [message #1861801] |
Sat, 04 November 2023 07:44  |
Eclipse User |
|
|
|
Hello everyone!
I'm a student trying to transform a BPMN model to a UML model with ATL. The thing is that neither the smallest matched rule do match, in fact the output.xmi is empty!
Here the code:
rule StartEvent2InitialNode {
from
s1: BPMN!StartEvent
to
t1: UML!InitialNode
}
rule Sequence2Control {
from
s2: BPMN!SequenceFlow
to
t2: UML!ActivityEdge
}
rule EndEvent2FinalNode {
from
s3: BPMN!EndEvent
to
t3: UML!FinalNode
}
I've trying with just 2 rules to make it simple at the beginning, and my model in input is a .bpmn file with just a start event, a sequence flow and a end event (but i also have the same model in the .bpmn2 extension)
The ecore files that i'm using are in the eclipse site, so i think that they are fine..
Thanks! :)
|
|
|
|
|
| Re: ATL rules doesn't match [message #1861841 is a reply to message #1861819] |
Tue, 07 November 2023 16:46   |
Eclipse User |
|
|
|
Thanks for providing the project source! I noticed that your input models were created using the Eclipse BPMN plugin, but you're trying to use a standalone .ecore file as BPMN metamodel. By default, EMF-based Eclipse plugins, such as BPMN and UML, provide their metamodels through the EMF package registry. The EMF package registry exposes built-in metamodels via their namespace URI (nsURI), and whenever you ask EMF to load a model, it will automatically load it on top of the metamodel that was registered under the namespace URI, e.g. in your "input.bpmn":
<bpmn2:definitions .... xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" ....
Because EMF models always contain the nsURI of their metamodel, you can't actually tell EMF to load a model on top of a specific metamodel. EMF will always figure this out by itself through the package registry.
Whenever the metamodel is already made available through the EMF package registry by some plugin, you don't need to "bring your own" as a .ecore file. In fact, ATL/EMF often get confused about which metamodel to use, and mixes them up.
In your case, the namespace URI declared in the model "input.bpmn" does not match the namespace URI specified in the "bpmn.ecore" file. When ATL asks EMF to load "input.bpmn", EMF just loads it on top of the BPMN metamodel from the package registry. ATL then also loads the "bpmn.ecore", because you specified it, and uses that for the transformation rules to match against. As a result, no rule will match, because nothing is actually loaded on top of "bpmn.ecore".
Your fixed code would look like this:
-- @nsURI BPMN=http://www.omg.org/spec/BPMN/20100524/MODEL
-- @nsURI UML=http://www.eclipse.org/uml2/5.0.0/UML
module transformationBPMN2UML2;
create OUT : UML from IN : BPMN;
rule startevent2node {
from
s1: BPMN!StartEvent
to
t1: UML!InitialNode
}
rule Sequence2Control {
from
s2: BPMN!SequenceFlow
to
t2: UML!ControlFlow
}
rule EndEvent2FinalNode {
from
s3: BPMN!EndEvent
to
t3: UML!FlowFinalNode(
name <- 'end'
)
}
|
|
|
| Re: ATL rules doesn't match [message #1861866 is a reply to message #1861841] |
Wed, 08 November 2023 10:57  |
Eclipse User |
|
|
|
I have changed the code and launched ATL with this new configuration, and now the output.xmi file is starting to fill up. The transformation challenge begins now.
Thank you very much, you saved me!
|
|
|
Powered by
FUDForum. Page generated in 0.03897 seconds