Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » problem string concat operation OclUndefined ?(OCL)
icon5.gif  problem string concat operation OclUndefined ? [message #1746946] Tue, 08 November 2016 00:03 Go to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
when i generate getRule1() :
lazy rule Rule2Rule{
      from f:GrammAcme!Rule
	  
      to t:MMAcme!Rule(	
      	
      	
      	 ruletext<-thisModule.getRule1()

)}

  helper  def: getRule1(f:GrammAcme!Rule):String=
  	 if not f.designRuleExpression.qt.formalParam.oclIsUndefined() then 
		   if not f.designRuleExpression.qt.designRuleExpression.qb.oclIsUndefined() then
		  if not  f.designRuleExpression.qt.designRuleExpression.qb.orExpression.impliesExpression.iffExpression.equalityExpression.relationalExpression.additiveExpression
         .multiplicativeExpression.unaryExpression.primitiveExpression.ruleExpression.oclIsUndefined() then
		 if not  f.designRuleExpression.qt.designRuleExpression.qb.orExpression.impliesExpression.iffExpression.equalityExpression.relationalExpression.additiveExpression
         .multiplicativeExpression.unaryExpression.primitiveExpression.ruleExpression.qb.orExpression.impliesExpression.iffExpression.equalityExpression.relationalExpression
         .additiveExpression.multiplicativeExpression.unaryExpression.primitiveExpression.id.oclIsUndefined() then
  	
  	  f.nameRule +' '+ '='+' ' + f.typeRule +' '+ f.designRuleExpression.qt.typeExp + ' '+ f.designRuleExpression.qt.nameComponent
		 + ' '+':'+' ' +f.designRuleExpression.qt.formalParam.type  
		+ ' '+'in'+ ' '+  f.designRuleExpression.qt.setExpression.nameSetReference
		 +'.' + f.designRuleExpression.qt.setExpression.set.toString().regexReplaceAll('Sequence',' ').replaceAll('{',' ').replaceAll('}',' ').replaceAll('\'',' ').trim()
		 +' '+'|' +' '+'('+
		 f.designRuleExpression.qt.designRuleExpression.qb.orExpression.impliesExpression.iffExpression.equalityExpression.relationalExpression.additiveExpression
         .multiplicativeExpression.unaryExpression.primitiveExpression.ruleExpression.qb.orExpression.impliesExpression.iffExpression.equalityExpression.relationalExpression
         .additiveExpression.multiplicativeExpression.unaryExpression.primitiveExpression.id.idName+'.'+f.designRuleExpression.qt.designRuleExpression.qb.orExpression.impliesExpression.iffExpression.equalityExpression.relationalExpression.additiveExpression
         .multiplicativeExpression.unaryExpression.primitiveExpression.ruleExpression.qb.orExpression.impliesExpression.iffExpression.equalityExpression.relationalExpression
         .additiveExpression.multiplicativeExpression.unaryExpression.primitiveExpression.id.iddNames.toString().regexReplaceAll('Sequence',' ').replaceAll('{',' ').replaceAll('}',' ').replaceAll('\'',' ').trim()
		+')'+' '+'=='
			  	else  OclUndefined endif 
				else  OclUndefined endif 
			
		else  OclUndefined endif 
						  						  else  OclUndefined endif 
												  ;

here i don't have a problem and i have this result :

Quote:

<rules ruletext="rule10 = invariant forall ps : PortTWSService in self.PORTS | (ps.Prec) =="/>




when i generate getRule3() i don't have a problem

lazy rule Rule2Rule{
      from f:GrammAcme!Rule
	  
      to t:MMAcme!Rule(	
      	
      	
      	 ruletext<-thisModule.getRule3()

)}

 helper def: getRule3(f:GrammAcme!Rule):String=
  if not f.oclIsUndefined() then
   	if not f.designRuleExpression.qt.designRuleExpression.oclIsUndefined() then
 	
 	if not f.designRuleExpression.qt.designRuleExpression.qb.oclIsUndefined() then
 	if not f.designRuleExpression.qt.designRuleExpression.qb.orExpression.impliesExpression.iffExpression.equalityExpression.relationalExpression.additiveExpression
         .multiplicativeExpression.unaryExpression.primitiveExpression.ruleExpression.oclIsUndefined() then
 
		 if not f.designRuleExpression.qt.designRuleExpression.qb.orExpression.impliesExpression.iffExpression.equalityExpression.relationalExpression.additiveExpression
         .multiplicativeExpression.unaryExpression.primitiveExpression.ruleExpression.qb.orExpression.impliesExpression.iffExpression.equalityExpression.relationalExpressions->first().
         oclIsUndefined() then
		
		
		
		f.designRuleExpression.qt.designRuleExpression.qb.orExpression.impliesExpression.iffExpression.equalityExpression.relationalExpression.additiveExpression
         .multiplicativeExpression.unaryExpression.primitiveExpression.ruleExpression.qb.orExpression.impliesExpression.iffExpression.equalityExpression.relationalExpressions->first().
          additiveExpression.multiplicativeExpression.unaryExpression.primitiveExpression.id.idName
	  						
	else  OclUndefined endif 
				else  OclUndefined endif 
					else  OclUndefined endif 
				
		else  OclUndefined endif 
						  						  else  OclUndefined endif ;								  ;


i have this result :

Quote:

<rules ruletext="activer"/>

but when i concat getRule3() + getRule1() like this :

 lazy rule Rule2Rule{
      from f:GrammAcme!Rule
	  
      to t:MMAcme!Rule(	
      	
      	
      	 ruletext<-thisModule.getRule1()+thisModule.getRule3()
)}


i have this problem :
Quote:

org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found: OclUndefined.+(org.eclipse.m2m.atl.engine.emfvm.lib.OclUndefined)
at Rule2Rule#296(Acme2Acme.atl[116:2-116:47])
local variables: self=Acme2Acme : ASMModule, f=IN!<unnamed>, t=OUT!<unnamed>
at Family2Family#113(Acme2Acme.atl[28:32-28:55])
local variables: self=Acme2Acme : ASMModule, f=IN!<unnamed>, q=IN!<unnamed>, j=OUT!WSM, e=IN!<unnamed>
at __applyFamily2AcmeFile#24(Acme2Acme.atl[12:17-12:46])
local variables: self=Acme2Acme : ASMModule, link=TransientLink {rule = Family2AcmeFile, sourceElements = {q = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@9a6d8c (eClass: org.eclipse.emf.ecore.impl.EClassImpl@1a36881 (name: FamilyBody) (instanceClassName: null) (abstract: false, interface: false)), f = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@11642c7 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@8201b4 (name: Family) (instanceClassName: null) (abstract: false, interface: false))}, targetElements = {j = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@d60adf (eClass: org.eclipse.emf.ecore.impl.EClassImpl@14f5028 (name: AcmeFile) (instanceClassName: null) (abstract: false, interface: false))}, variables = {}}, f=IN!<unnamed>, q=IN!<unnamed>, j=OUT!WSM
at __exec__#8(Acme2Acme.atl)
local variables: self=Acme2Acme : ASMModule, e=TransientLink {rule = Family2AcmeFile, sourceElements = {q = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@9a6d8c (eClass: org.eclipse.emf.ecore.impl.EClassImpl@1a36881 (name: FamilyBody) (instanceClassName: null) (abstract: false, interface: false)), f = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@11642c7 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@8201b4 (name: Family) (instanceClassName: null) (abstract: false, interface: false))}, targetElements = {j = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@d60adf (eClass: org.eclipse.emf.ecore.impl.EClassImpl@14f5028 (name: AcmeFile) (instanceClassName: null) (abstract: false, interface: false))}, variables = {}}
at main#27(Acme2Acme.atl)
local variables: self=Acme2Acme : ASMModule


i don'tt unrestand wahat is the problem ??????

[Updated on: Tue, 08 November 2016 11:18]

Report message to a moderator

Re: problem string concat operation OclUndefined ? [message #1746974 is a reply to message #1746946] Tue, 08 November 2016 09:17 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5352
Registered: July 2009
Senior Member
Hi

You are much more likely to get a sensible response on an ATL forum where users may understand ATL's flavour of OCL.

I can only comment that the messages suggest that "OclUndefined" does not exist and in OMG OCL it certainly does not. There is however an oclIsUndefined() library operation.

Regards

Ed Willink
Re: problem string concat operation OclUndefined ? [message #1746988 is a reply to message #1746974] Tue, 08 November 2016 11:16 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
please any help ???
Re: problem string concat operation OclUndefined ? [message #1746998 is a reply to message #1746988] Tue, 08 November 2016 12:46 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11084
Registered: July 2009
Senior Member
what about asking this in the ATL forum as Ed suggested?

Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Previous Topic:Embedded Xtext editor with only a sub part of the Grammar of my DSL
Next Topic:Import File
Goto Forum:
  


Current Time: Tue Aug 22 09:42:04 GMT 2017

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

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