[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.mdt.ocl] OCLExpressions

Hello, I am new to OCL and I am trying to use it with QVT. I want to create an OCL Expression from a string. I created a type StringLiteralExp and in the stringSymbol attribute i give it the OCL string.

var strExp:=object OCL::expressions::StringLiteralExp{stringSymbol:='self.name=Class1'};

now i want to use this OCLExpression inside an if condition to evaluate it and check if it is true or false. However, it seems that the if condidtion always returns false. Which I guess because it is not correctly evaluating the ocl expression.


if(strExp=true) then 'true'.dump() else 'false'.dump() endif;

So my questions are : 1. Am-I using the correct way to build an OCL Expression from a string?

2. Is it possible to use the OCL expression inside an IF statement and to evaluate it ?

Thanks in advance.. Mary