|Allow/disable target node depending the source node [message #1770858]
||Fri, 18 August 2017 01:53
| Lina 20
Registered: March 2017
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
[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
|| Maxime Porhel
Registered: July 2009
Location: Nantes, France
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).
Maxime Porhel - Obeo
Need training or professional services for Sirius?
Powered by FUDForum
. Page generated in 0.01309 seconds