Skip to main content



      Home
Home » Modeling » OCL » Problem with Link Constraint (OCL)
Problem with Link Constraint (OCL) [message #480651] Tue, 18 August 2009 02:30 Go to next message
Eclipse UserFriend
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& amp;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
Re: Problem with Link Constraint (OCL) [message #480907 is a reply to message #480651] Tue, 18 August 2009 16:57 Go to previous message
Eclipse UserFriend
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& amp;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
>
Previous Topic:Re: OCL closures implementation
Next Topic:def expression?
Goto Forum:
  


Current Time: Wed Jul 23 10:00:18 EDT 2025

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

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

Back to the top