Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Full name reference - Classifiers seem not to be equal
Full name reference - Classifiers seem not to be equal [message #1066585] Wed, 03 July 2013 10:05 Go to next message
Thomas Haarhoff is currently offline Thomas Haarhoff
Messages: 8
Registered: December 2012
Location: Germany
Junior Member
Hello,
I have to rules here for you.
rule CompareUse {
	from input: IN!InstructionDef(input.instruction.oclIsTypeOf(IN!Compare))
	to
		outI :OUT!LocalComputation(
			expression <-  lexpr,  
			instructionResult <- intReg

		),
		intReg: OUT!Variable (
			name <- input.register
		),
		lexpr : OUT!"expressions::Equal"(
			left <- left,
			right <- right
		),
		left : OUT!"expressions::StringValue"(
			strValue <- input.instruction.value1  
		),
		right : OUT!"expressions::StringValue"(
			strValue <- input.instruction.value2  
		)
}


rule BranchCompare {
        from input: MM!LocalComputation(input.expression.oclIsTypeOf(MM!"expressions::Equal"))
...
}


The rule CompareUse is from a Model-2-Model Transformation and the snippet of the rule BranchCompare is from a refining transformation.

Short Overview:
M2M: Transform every Compare Instruction from IN to a OUT!LocalComputation with an expression(Equal here).
Ref: Select all LocalComputations that have an equal expression.

-

After the M2M Transformation the new Model contains LocalComputations like this:
<instructions xsi:type="LocalComputation">
      <instructionResult name="cmp2"/>
      <expression xsi:type="expressions:Equal">
        <left xsi:type="expressions:StringValue" strValue="1"/>
        <right xsi:type="expressions:StringValue" strValue="1"/>
      </expression>
    </instructions>


Thats ok so far.
The refining on the other hand doesn't work.
If i debug the snippet like this:
from
input: MM!LocalComputation (
	input.expression.oclIsTypeOf(MM!"expressions::Equal").debug(input.expression.oclType())

I get:
org.eclipse.emf.ecore.impl.EClassImpl@71f68c1b (name: Equal) (instanceClassName: null) (abstract: false, interface: false): false

But if I'm wrong that should be true... not false.


Thanks for reading and your time,

Thomas
Re: Full name reference - Classifiers seem not to be equal [message #1066645 is a reply to message #1066585] Wed, 03 July 2013 14:32 Go to previous messageGo to next message
Thomas Haarhoff is currently offline Thomas Haarhoff
Messages: 8
Registered: December 2012
Location: Germany
Junior Member
Small update.
I tried to change the header of the transformations.
In the version above I used
--@path IN=...

I changed it. So the transformation is now using the URI.
--@nsURI IN=...

But now also the first transformation isn't working any more.
with the Error:
org.eclipse.m2m.atl.engine.emfvm.VMException: Cannot find class IN::expressions::Equal in reference model IN

Is there a problem with using the nsURI and the full name reference?

Thomas


*EDIT*
fixed it. Just switching to Runtime Workbench.
By switching from @path to @nsURI also the first error disappeard.
Sorry for all that confusing stuff :/

Thomas

[Updated on: Wed, 03 July 2013 15:45]

Report message to a moderator

Re: Full name reference - Classifiers seem not to be equal [message #1066660 is a reply to message #1066645] Wed, 03 July 2013 15:21 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 607
Registered: July 2009
Senior Member
Hello,

Have you tried to do something like:
from
input: MM!LocalComputation (
	input.expression.oclIsTypeOf(MM!Equal).debug(input.expression.oclType())

Do you obtain a similar result/error?


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: Full name reference - Classifiers seem not to be equal [message #1067278 is a reply to message #1066660] Mon, 08 July 2013 08:00 Go to previous message
Thomas Haarhoff is currently offline Thomas Haarhoff
Messages: 8
Registered: December 2012
Location: Germany
Junior Member
Hello, I restored the version and yes. Same Error.
But its working now. As I mentioned in my edit before.
Thanks Smile
Previous Topic:transforming an XML to text file
Next Topic:ifExp in ATL textual syntax.
Goto Forum:
  


Current Time: Tue Oct 21 13:43:36 GMT 2014

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

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