Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Inter-model references problem(Problem with additional namesapce)
Inter-model references problem [message #1690502] Fri, 27 March 2015 16:17 Go to next message
Vincent Sennedot is currently offline Vincent SennedotFriend
Messages: 10
Registered: March 2015
Junior Member
Hello,

I'm trying to do a model to model transformation with two input EMF models and two output EMF models. It transforms a 2.3.0 model version to a 2.6.0 model version.
The inputs models are:

  • "Recovery.sa" with namespace ".../sametamodel/v2.3.0"
  • "Recovery.fearedevents" with namespace ".../fearedevents/v2.3.0"

The output models are:

  • "Recovery.sa" with namespace ".../sametamodel/v2.6.0"
  • "Recovery.fearedevents" with namespace ".../fearedevents/v2.6.0"


The two input models reference each other, as the two output models.

The "Recovery.fearedevents" is declared like this:
<?xml version="1.0" encoding="UTF-8"?>
<fearedevents:FearedEventsLibrary xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance"
    xmlns:fearedevents=".../fearedevents/v2.3.0"
    xmlns:sa=".../sametamodel/v2.3.0" ...>
  <fearedEventsList ...>
    <failureModesList xsi:type="sa:FailureMode" href="Recovery.sa#_1u1N7_mxEeKDk4RlwuVRlA"/>
  </fearedEventsList>
  ...
</fearedevents:FearedEventsLibrary>

So the fearedEventsList has a child (failureModesList) which has its type (FailureMode) declared in the "sa" namespace (".../sametamodel/v2.6.0").

And the rule used to transform a FearedEvent is:
rule FearedEventImport extends AbstractDescribedObjectFEImport {
    from
        pPrevious: FE230!FearedEvent
    to
        pNext: FE260!FearedEvent (
            familiesList <- pPrevious.familiesList,
            failureModesList <- pPrevious.failureModesList, -- Here is the problem
            selected <- pPrevious.selected,
            linkedModesList <- pPrevious.linkedModesList
        )
}

The problem is that the failureModesList is an instance of the FailureMode type from the 2.3.0 version for the input and the output models and it throws an exception.

The failureModesList should be an instance of the FailureMode type from the 2.3.0 version for the input model and an instance of the FailureMode type from the 2.6.0 version for the output model.
The fact is the additional namespace (".../sametamodel/v2.3.0") is used for the input and the output models for the transformation of "Recovery.fearedvents" file.

How could I set different additional namepsace for the input and the output models ? Or is there an other way to solve my problem ?

Best regards,

Vincent

P.S.: I changed the namespace because i can only use links to eclipse.org for now.
Re: Inter-model references problem [message #1690515 is a reply to message #1690502] Fri, 27 March 2015 18:21 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

Where's the rule that transforms the FailureMode?

Cheers,
Dennis
Re: Inter-model references problem [message #1690634 is a reply to message #1690515] Mon, 30 March 2015 09:13 Go to previous messageGo to next message
Vincent Sennedot is currently offline Vincent SennedotFriend
Messages: 10
Registered: March 2015
Junior Member
Actually, I don't have one for the .fearedevents file as it's just a reference, but I have one for the .sa file :

--  Rule for failure mode element
rule FailureModeImport extends AbstractProbabilisticObjectImport {
	from
		pPrevious: SA230!FailureMode
	to
		pNext: SA260!FailureMode (
			parent <- pPrevious.parent,
			nature <- pPrevious.nature,
			type <- pPrevious.type,
                        fearedEventsList <- pPrevious.fearedEventsList,
                        fearedEventsFamiliesList <- pPrevious.fearedEventsFamiliesList,
                        includedInFMECA <- false
		)
}


Do I need one for the .fearedevents file too ? If I do, what should I put in ?

Vincent
Re: Inter-model references problem [message #1691261 is a reply to message #1690634] Sat, 04 April 2015 07:24 Go to previous message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

The FailureModeImport rule uses different metamodels than FearedEventImport. If there are references from FE230 to SA230, you should only use FE230 as metamodel in ATL, and ATL will automatically import SA230. If you specify SA230 again, this may result in duplicate metaclasses being loaded, and therefore duplicate model elements.

Cheers,
Dennis
Previous Topic:Generation of elements and refereces between them
Next Topic: problem in running of ATL module
Goto Forum:
  


Current Time: Thu Apr 18 11:56:32 GMT 2024

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

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

Back to the top