[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.modeling.mdt.ocl] Expressions in Raw Text

			OCLExpression<EClassifier> expr = parseDef(
				"package ocltest context Fruit " + //$NON-NLS-1$
				"def: bestColor(c : Color) : Color = if self.color = Color::black
then c else self.color endif" + //$NON-NLS-1$
				" endpackage"); //$NON-NLS-1$
			
			Constraint constraint = (Constraint) expr.eContainer().eContainer();
			assertNotNull(constraint);
			
			assertEquals(UMLReflection.DEFINITION, constraint.getStereotype());
			
			assertSame(color, expr.getType());


I found this in the tests of ocl ecore.

My question, how can I evaluate expressions against this method.
The other methods define the operation via helper.defineOperation, but
how can I make this operation available for the evaluator.

Chris