Set theory in selectors
Posted: Mon Sep 12, 2011 3:11 pm
Writing actifsource templates you define one selector per context. A selector lets you navigate through your model starting from a resource of your meta model and following any relation.
In some complex cases you might need to combine the results from different paths using the set theory. At the moment we have implemented three different commands:
union (OR)
All elements reached through A.b orC.d.
intersect (AND)
Only elements which are reached through A.b and C.d.
except (AND NOT)
All elements which are reached through A.b without the ones reached through C.d.
String type system
Note that the result of any set action is always strongly typed. The returned type is the most common type of all involved types. If there is no inheritance hierarchy between the types the result is at least of type Resource or NamedResource.
Screenshot of an example using reverse navigation, type cast an the intersect command
In some complex cases you might need to combine the results from different paths using the set theory. At the moment we have implemented three different commands:
union (OR)
All elements reached through A.b orC.d.
A.b union C.d
intersect (AND)
Only elements which are reached through A.b and C.d.
A.b intersect C.d
except (AND NOT)
All elements which are reached through A.b without the ones reached through C.d.
A.b except C.d
String type system
Note that the result of any set action is always strongly typed. The returned type is the most common type of all involved types. If there is no inheritance hierarchy between the types the result is at least of type Resource or NamedResource.
Screenshot of an example using reverse navigation, type cast an the intersect command