Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Allow/disable target node depending the source node
Allow/disable target node depending the source node [message #1770858] Fri, 18 August 2017 01:53 Go to next message
Lina 20 is currently offline Lina 20Friend
Messages: 32
Registered: March 2017
Member
Hi,

I have an element base edge that works fine. I defines the source and target mappings. But what I want is to enable or disable a target element depending on the source node. For example I have A, B, C, D nodes and the edge R.
All of them could be the source of my edge R. But when I select A, the target can not be B, must be C or D.

SourceFinderExpression: [self.sourceC /]
SourceTargetExpression: [self.targetC /]
I was trying with the semantic candidate expression
[If self.sourceC.oclIsKindOf (Outcome) then self.targetC. Endif /]

But I get the following error: missing "else OclExpressionCS edif" to complete scope. I do not figure out how to return the grouping of nodes.

I appreciate your help. Thanks

Lina

[Updated on: Fri, 18 August 2017 01:55]

Report message to a moderator

Re: Allow/disable target node depending the source node [message #1770898 is a reply to message #1770858] Fri, 18 August 2017 13:58 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Lina,

Looking at the AQL documentation, it seems that the syntax of your candidates expression is not correct (if end endif must be un lowercase and you have a traiing "." just before your endif, you might also need return something for the else case:
 if self.name.startsWith('a') then self else self.eContainer() endif 


Note that semanticCandidateExpression will help you to select elements on which you want to create edges.
I would use the target finder expression to do your filter as your condition is on the target.
Note that Sirius will only create an edge if the evaluation of the mapping find a candidate, a source and a target (if your expressions returns several source and target, it will produce all the corresponding edges, if your expressions return an empty collection or nothing, there will be no edge created for the corresponding candidate).

Regards,

Maxime


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Moved odesign file
Next Topic:Filter classes in FeatureEditorDialog and edit existing properties tab
Goto Forum:
  


Current Time: Fri Apr 26 04:40:06 GMT 2024

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

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

Back to the top