typeOf(>Relation.First.()) ? |
Post Reply |
Author | |||||||
grossd18
Major Contributor Joined: 30.Sep.2016 Points: 22 |
Post Options
Thanks(0)
Posted: 13.Oct.2016 at 07:28 |
||||||
Hi,
is there a way to identify in a navigation expression what the type of the target object is? I know that there is the type keyword, but this doesn't seem applicable when using navigation expressions. thank you, Daniel |
|||||||
stevek
MetaCase Joined: 11.Mar.2008 Points: 641 |
Answer Post Options Thanks(0) |
||||||
You can condense mutiple navigation steps into a navigation chain, with filtering by type at each step:
You can use more complex type filtering: wildcards, or multiple acceptable types in parentheses, separated by |. If you want any type, just put an empty pair of parentheses:
You can skip parts you don't need to filter on, e.g. if you're in an object, go to any connected ObjectType instance regardless of relationship or role type:
If you need to filter more, you can use a where clause to add a condition:
If you want just the first occurrence, you can use unique. Normally that is used to handle a particular case just once, e.g.
Since it prevents duplicates occurring in this loop for its argument, in this case :Library, you can give it a fixed string like '1' so everything after the first element will be a duplicate:
If you just want to test for something, you can simply use a navigation chain in an if statement:
Note a few cases above where a type name is explicitly ended by a semicolon, e.g. "~OtherRole; where" - that's so MERL knows this is a type called "OtherRole", not "OtherRole where".
Edited by stevek - 13.Oct.2016 at 09:46 |
|||||||
Post Reply | |
Tweet |
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |