|
|
|
Re: ATL rules doesn't match [message #1861841 is a reply to message #1861819] |
Tue, 07 November 2023 21:46 |
|
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'
)
}
Cheers,
Dennis
|
|
|
|
Powered by
FUDForum. Page generated in 0.01525 seconds