Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » problem string concat operation OclUndefined ?
icon5.gif   problem string concat operation OclUndefined ? [message #1746978] Tue, 08 November 2016 10:26 Go to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
Hi, 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 what is the problem ??????
Re: problem string concat operation OclUndefined ? [message #1746984 is a reply to message #1746978] Tue, 08 November 2016 11:04 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6111
Registered: July 2009
Senior Member
Hi

I already replied to this on the Xtext forum suggesting that you need to ask on the ATL forum. This is not an OCL issue.

Regards

Ed Willink
Re: problem string concat operation OclUndefined ? [message #1746985 is a reply to message #1746984] Tue, 08 November 2016 11:11 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
No Message Body

[Updated on: Tue, 08 November 2016 12:16]

Report message to a moderator

Re: problem string concat operation OclUndefined ? [message #1746991 is a reply to message #1746985] Tue, 08 November 2016 12:00 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6111
Registered: July 2009
Senior Member
I don't see any such correspondence on https://www.eclipse.org/forums/index.php/f/241/

Regards

Ed Willink
Previous Topic:UML2AS: Error when translating OpaqueExpression with multiple languages
Next Topic:Validating a Model through Java
Goto Forum:
  


Current Time: Fri Nov 16 16:53:51 GMT 2018

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

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

Back to the top