Object Selectors

Parent Previous Next

Object Selectors


Object selectors are used in a variety of circumstances to select one or more objects to operate from. Object selectors the path grammar in order to locate related objects within the carbon tree for listing, linking, and building tables. Object selectors also form the basis for the selection of nodes within the Structure Maps.


Syntax:


Selector

Meaning

Uses

$CurrentObject

Returns the currently scoped object. This is useful when generating links to objects within a table.

Can be used within structure maps or templates.

$Object(Path:’path/to/related/object’)

Returns the list of objects returned by the specified path using the Workbench Path Language.

Can be used within structure maps or templates.

$ObjectReference(<referenceKey>)

When a carbon object contains a reference to another object, this can be resolved using the $ObjectReference selector.

Can be used within structure maps or templates.

RunSelector(<selectorKey>)

Run a selector previously stored with ‘DeclareSelector’.

Can only be used within templates.


Important Note:

For more information on the Workbench Path Language syntax used within Object Selectors, please click here.


Examples:


Return the children of the child node ‘Databases’:


$Object(Path:’Databases/’)



Return the children of the child node ‘Databases’, ordered by the ‘Name’ property on each one:


$Object(Path:’Databases/’,OrderBy:@PropertyValue(‘Name’))



Return the object stored in the object reference ‘RelatedPackage’:


$ObjectReference(‘RelatedPackage’)



Store and run a selector for all tables:


DeclareSelector(‘Tables’, $Object(Path:’Tables/’));


For(RunSelector(‘Tables’))

{

       

}