Allow/disable target node depending the source node [message #1770858] |
Thu, 17 August 2017 21:53  |
Eclipse User |
|
|
|
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: Thu, 17 August 2017 21:55] by Moderator
|
|
|
Re: Allow/disable target node depending the source node [message #1770898 is a reply to message #1770858] |
Fri, 18 August 2017 09:58  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02801 seconds