[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.mdt.ocl] Re: Problem with Link Constraint (OCL)

Hi Ivo

As you say, allInstances() 'does not work' it returns null; presumably because you have some scoping problem that makes the model or its conmtents inaccessible.

You'll have to hope that some GMF guy can help explain how to set up the scope.

	Regards

		Ed Willink

Ivo Petkov wrote:
Hello,

I posted my problem in GMF section, but there are no answers, so I decided to post it here too ( http://www.eclipse.org/forums/index.php?t=msg&th=152579&start=0&S=0af8f2b4cf467d9a4c4284607c0496aa )
Quote:
Hi all,

If few words:
a CompositeMode is part of my model, it can contain subModes and conditionalConnectors, a connection between these two nodes exists, but I want to allow such connection if both nodes are in one and the same CompositeMode.


I tried with the following target link constraint in the GMFMAP:
CompositeMode.allInstances()->exists(cm| cm.subModes->exists(sm| sm = self) and cm.conditionalConnectors->exists(cc| cc = oppositeEnd))


and this doesn't work because allIntances doesn't work for me, here are the debug logs:

[OCL] Evaluate: remes::CompositeMode
[OCL] Result : org.eclipse.emf.ecore.impl.EClassImpl@9cd7cd (name: CompositeMode) (instanceClassName: null) (abstract: false, interface: false)
[OCL] Evaluate: remes::CompositeMode.allInstances()
[OCL] Result : null
[OCL] Evaluate: remes::CompositeMode.allInstances()->exists(cm : CompositeMode | cm.subModes->exists(sm : SubMode | sm.=(self)).and(cm.conditionalConnectors->exists(cc : ConditionalConnector | cc.=(oppositeEnd))))
[OCL] Result : OclInvalid
[OCL] Evaluate: remes::CompositeMode.allInstances()->exists(cm : CompositeMode | cm.subModes->exists(sm : SubMode | sm.=(self)).and(cm.conditionalConnectors->exists(cc : ConditionalConnector | cc.=(oppositeEnd))))
[OCL] Result : OclInvalid


Please help me to fix this problem.

Thanks in advance,
Ivo