Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » ATL rules doesn't match(ATL matched rules)
ATL rules doesn't match [message #1861801] Sat, 04 November 2023 11:44 Go to next message
Giulia Pascale is currently offline Giulia PascaleFriend
Messages: 3
Registered: November 2023
Junior Member
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 #1861810 is a reply to message #1861801] Sun, 05 November 2023 13:05 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 581
Registered: September 2012
Location: Belgium
Senior Member

Can you export your Eclipse project as a zip file and attach it here?

Cheers,
Dennis
Re: ATL rules doesn't match [message #1861819 is a reply to message #1861810] Mon, 06 November 2023 16:00 Go to previous messageGo to next message
Giulia Pascale is currently offline Giulia PascaleFriend
Messages: 3
Registered: November 2023
Junior Member
Hi!
Sure, this is the project exported as a zip.
I also have it on github. https://github.com/MissFoxy/SOSE_progetto

PS. Sorry, I just noticed now that I didn't indent the code properly in the first message.
  • Attachment: BPMN2UML.zip
    (Size: 142.34KB, Downloaded 5 times)
Re: ATL rules doesn't match [message #1861841 is a reply to message #1861819] Tue, 07 November 2023 21:46 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 581
Registered: September 2012
Location: Belgium
Senior Member

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
Re: ATL rules doesn't match [message #1861866 is a reply to message #1861841] Wed, 08 November 2023 15:57 Go to previous message
Giulia Pascale is currently offline Giulia PascaleFriend
Messages: 3
Registered: November 2023
Junior Member
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!
Previous Topic:Assigning values to a Map owned by a target element
Goto Forum:
  


Current Time: Sat Nov 11 08:16:52 GMT 2023

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

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

Back to the top