Data Relationship Management Objects
Following are the Oracle Data Relationship Management objects with methods and properties described.
SysObject
One SysObject, called Sys, is automatically created. This object is available in all contexts, and provides general functions as well as information about the Data Relationship Management application. There are no properties for this object.
Table 12-9 SysObject Methods
Name | Description |
---|---|
FormattedDate (value, formatString) |
Formats dates according to the Formula system rules. Useful for backward compatibility to exactly match old Formula properties.
|
GetNextID(key) |
Returns the next available integer ID for a given string key value |
GetPropDef(abbrev) |
Returns a PropDefObject for the given property name. The name must be the fully qualified name. |
GetRequestByID(int) |
Returns a workflow request by ID. |
GetSysPrefValue(abbrev) |
Returns the value of the given system preference (for example, HierNodeSeparator) |
InRange(dataType, input, min, max, minExclusive, maxExclusive) |
Corresponds to the formula function InRange. Required parameters are dataType, input, and min. |
IsNodeAbove(ancestor, child) |
Returns True if ancestor is above child in the hierarchy. Returns False if parameters are not LocalNodeObjects or are not in the same hierarchy. |
IsNodeBelow(descendant, parent) |
Returns True if descendant is below parent in the hierarchy. Returns False if parameters are not LocalNodeObjects or are not in the same hierarchy. |
RunFormula(node, propDef, formulaString) |
Runs a Data Relationship Management formula and returns the string results
|
PropDefObject
There are no methods for this object.
Table 12-10 PropDefObject Properties
Name | Description |
---|---|
Abbrev |
The property definition name (including fully qualified namespace) |
Cascade |
True if the property values are inherited |
ColumnWidth |
The default export column width |
DataType |
A DataType enumeration value, for example DataType.String (see Enumeration Constants) |
Descr |
Description |
DefaultValue |
Default Value of the property definition. The type depends on the data type of the property definition. |
EditorLabel |
Label |
Global |
True if property is a Global Node property |
Hidden |
True if property is hidden from the property grid |
ID |
ID |
Level |
A PropLevel enumeration value, for example, PropLevel.Node (see Enumeration Constants) |
List |
True if prop lets user select from a list of values |
ListValues |
Array of values from which a user can select |
LookupValues |
Lookup key-value pairs for a lookup property. Use the Key and Value properties of the objects in this array. |
MaxValue |
Maximum value |
MinValue |
Minimum value |
Namespace |
Namespace of property definition |
PropType |
A PropType enumeration value, for example, PropType.Defined (see Enumeration Constants) |
PropClass |
Deriver class (Formula or Script) |
ReadOnly |
True if property is read-only (such as a Core stats property) |
VersionObject
Table 12-11 VersionObject Properties
Name | Description |
---|---|
Abbrev |
Name |
Descr |
Description |
HierCount |
Number of hierarchies |
ID |
ID |
NodeCount |
Number of nodes |
Table 12-12 VersionObject Methods
Name | Description |
---|---|
GetHierarchies() |
Gets an array of all the hierarchies in the version that are available to the current user |
GetGlobalNodes() |
Gets an array of all the global nodes (NodeObjects) in the version |
GetOrphans() |
Gets an array of all the orphans (NodeObjects) in the version |
HierByAbbrev(abbrev) |
Gets a HierarchyObject by name |
HierByID(id) |
Gets a HierarchyObject by ID |
NodeByAbbrev(abbrev) |
Gets a NodeObject by name |
NodeByID(id) |
Gets a NodeObject by ID |
NodeExists(abbrev) |
Returns True if a global node exists with the given name |
Prop(abbrev) |
Gets the NodePropObject for the given property of the version |
PropValue(abbrev) |
Gets the value of the given property of the version. The return type depends on the data type of the property definition. |
HierarchyObject
Table 12-13 HierarchyObject Properties
Name | Description |
---|---|
Abbrev |
Name |
Descr |
Description |
HierarchyUrl |
Hierarchy URL |
ID |
ID |
NodeCount |
Number of nodes in hierarchy |
SharedNodesEnabled |
True if shared nodes are enabled |
TopNode |
The LocalNodeObject top node |
Version |
The VersionObject |
VersionAbbrev |
Name of version |
VersionID |
ID of version |
Table 12-14 HierarchyObject Methods
Name | Description |
---|---|
NodeByAbbrev(abbrev) |
Gets a NodeObject by name |
NodeByID(id) |
Gets a NodeObject by ID |
NodeExists(abbrev) |
Returns True if a local node with the given name exists |
Prop(abbrev) |
Gets the NodePropObject for the given property of the version |
PropValue(abbrev) |
Gets the value of the given property of the version. The return type depends on the data type of the property definition. |
Common Node Properties and Methods
Some properties and methods are common to both NodeObject and LocalNodeObject although these two objects do not share a prototype chain.
In all cases where the value can differ because of the global or local context, the correct value is returned for that context. For example, when calling GetChildren() on a NodeObject, the resulting Array will contain NodeObjects. When making the same call on a LocalNodeObject, the resulting Array will contain LocalNodeObjects.
Table 12-15 Common Properties for NodeObject and LocalNodeObject
Name | Description |
---|---|
Abbrev |
Core.Abbrev |
AddedBy |
Core.AddedBy |
AddedOn |
Core.AddedOn |
Changed |
Core.Changed |
ChangedBy |
Core.ChangedBy |
ChangedOn |
Core.ChangedOn |
ChildNodeCount |
Number of child nodes |
Descr |
Core.Descr |
DomainAbbrev |
Core.DomainAbbrev |
DomainNodeAbbrev |
Core.DomainNodeAbbrev |
ID |
Core.ID |
Inactive |
Core.Inactive |
IsPrimary |
True if the node is the primary for a shared node; False if node is not shared or not the primary |
IsShared |
True if the node is a shared node |
Leaf |
Core.Leaf |
NodeApproved |
Core.NodeApproved |
Version |
The node’s owner VersionObject |
VersionAbbrev |
The node’s version name |
VersionID |
The node’s version ID |
Table 12-16 Common Methods for NodeObject and LocalNodeObject
Name | Description |
---|---|
GetChildren(sorted) |
Gets an Array of the direct children of this node, optionally in sorted order. Default for sorted is False. |
GetDescendants(inclusive, sorted) |
Gets an Array of the descendants of this node, optionally including this node and/or in sorted order. Default for inclusive is True. Default for sorted is False. |
NodeByAbbrev(abbrev) |
Gets a NodeObject by name |
NodeByID(id) |
Gets a NodeObject by ID |
NodeExists(abbrev) |
Returns True if a global node with the given name exists |
Prop(abbrev) |
Gets the NodePropObject for the given property of the version |
PropValue(abbrev) |
Gets the value of the given property of the version. The return type depends on the data type of the property definition. |
LocalNodeObject
Oracle recommends that you use the various xxxWith functions to locate other nodes in the hierarchy. For example ChildrenWith executes much faster than calling GetChildren() and iterating the results. Similarly, GetReferenceInHier is much faster and easier to use than calling GetReferences() and iterating the results.
Table 12-17 LocalNodeObject Properties
Name | Description |
---|---|
GlobalNode |
Global NodeObject for the current node |
Hier |
HierarchyObject for the hierarchy the node is in |
HierAbbrev |
Core.HierAbbrev |
HierID |
Core.HierID |
Level |
Number representing the node’s level in the hierarchy |
MissingPrimary |
True if the primary node is not found |
NodeUrl |
Node URL |
Parent |
LocalNodeObject for the parent node of this node. Null is returned for the top node of a hierarchy. |
ParentNodeAbbrev |
Name of parent node |
Primary |
The primary node for this shared node. If the primary is not in this hierarchy, returns the primary in the first hierarchy in which it occurs. If you need the list of hierarchies in which the primary appears, call GetReferences() on the returned primary node. If a shared node or primary cannot be found, returns null. |
PrimaryNotInHier |
True if the primary node exists but not in this hierarchy |
Table 12-18 LocalNodeObject Methods
Name | Description |
---|---|
AncestorsWith(func, maxResults, searchFromTop, inclusive) |
Searches the ancestor chain for nodes that satisfy the given function. This is the fastest way to locate ancestors. Returns an Array of LocalNodeObject results.
|
ChildrenWith(func, maxResults) |
Searches the node’s child list for nodes that satisfy the given function. This is the fastest way to find children. Returns an Array of LocalNodeObject results.
|
DescendantsWith(func, maxResults, inclusive, depthFirst) |
Searches the descendant chain for nodes that satisfy the given function. This is the fastest way to find descendants Returns an Array of LocalNodeObject results.
|
GetAncestorEnumerator() |
Gets a NodeEnumeratorObject that enumerates the ancestor nodes |
GetAncestors(inclusive) |
Gets an Array of LocalNodeObject ancestors |
GetChildEnumerator(sorted) |
Gets a NodeEnumeratorObject that enumerates the child nodes. If sorted is True, then the children will be in sorted order. |
GetDescendantEnumerator() |
Gets a NodeEnumeratorObject that enumerates the descendant nodes |
GetImplicitly SharedDescendants(inclusive) |
Gets the child nodes of the primary node this shared node is related to |
GetInvertedLevel() |
Equivalent to the formula InvertedLevel function |
GetReferences() |
Gets an Array of LocalNodeObjects that are references for this node (all hierarchies this node appears in) |
GetReferenceInHier(hierAbbrev) |
Gets the reference to this node in the given hierarchy. If the hierarchy is not accessible or this node does not exist in that hierarchy, then the result will be null. |
NextSibling() |
Gets the next sibling of this node in the sort order |
PreviousSibling() |
Gets the previous sibling of this node in the sort order |
SiblingsWith(func, maxResults, inclusive) |
Searches the node’s siblings for nodes that satisfy the given function. Returns an Array of LocalNodeObject results.
|
NodePropObject
Table 12-19 NodePropObject Properties
Name | Description |
---|---|
Abbrev |
The name of the property definition |
ControllingHierarchy |
The HierarchyObject for the property definition's controlling hierarchy in this version. If the property is not a global node property, does not have a controlling hierarchy, or the controlling hierarchy is not found, then the return value will be null. |
Locked |
True if the value is locked |
Origin |
A PropOrigin enumeration value, for example, PropOrigin.Overridden (see Enumeration Constants) |
Owner |
The object that this value is associated with (VersionObject, HierarchyObject, NodeObject, or LocalNodeObject) |
PropType |
A PropType enumeration value, for example, PropType.Defined (see Enumeration Constants) |
StringValue |
The raw string value of this property. In the case of Derived or RWDerived properties this may be the property definition default value or the overridden value. |
Value |
The interpreted value of this property (for example, for DataType.Float and DataType.Integer, this value will be a Number object). Not all DataTypes necessarily have a non-string representation. |
Table 12-20 NodePropObject Methods
Name | Description |
---|---|
GetPropDef() |
Gets the PropDefObject for the node prop |
RangeListObject
The RangeListObject represents a RangeList of values and can be used to inspect a RangeList property without having to manually parse strings. A new RangeListObject can also be constructed to return from a derived property of the appropriate data type.
Constructor Example
var x = new RangeListObject();
var y = new RangeListObject("1-10,20-25");
var z = new RangeListObject([{start:1, end:10},{start:20, end:25}]);
Table 12-21 RangeListObject Constructor Parameters
Parameters | Optional | Description |
---|---|---|
ranges |
True |
Range values for initialization. This parameter is optional. Two formats are accepted:
|
Table 12-22 RangeListObject Properties
Name | Description |
---|---|
Ranges |
An Array of objects. Each object has two properties:
This property is read-only. To modify the range use the methods below. |
Table 12-23 RangeListObject Methods
Name | Description |
---|---|
AddRange(start, end) |
Adds a new range to the range list. This may expand an existing range entry or create a new one. To add a single number to the list, use it for both the start and end parameters. Both parameters will be coerced to integers if necessary. |
Contains(value) |
Returns True if the value is in the range list, otherwise False. value will be coerced to an integer if necessary. |
IsSupersetOf(range) |
Returns True if the current RangeListObject is a superset of the given RangeListObject. Passing another type of object is an error. |
RemoveRange(start, end) |
Removes a range from the list. This removal may split an existing range entry into two or remove an entry entirely. To remove a single number from the list use it for both the start and end parameters. Both parameters will be coerced to integers if necessary. |
NodeEnumeratorObject
A NodeEnumeratorObject is a more efficient way to operate on a list of nodes. Instead of building the entire list all at once, the enumerator grabs only one node at a time as needed. If you find what you are looking for halfway through the list, you can abandon the enumerator. Properties and methods that return an Array of node objects must build the entire array immediately, whether you access the items at the end of the array or not.
The enumerator starts with a null Current value. You must call MoveNext() to advance the enumerator to the first node in the list.
Note:
A good practice is to use the With methods like AncestorsWith or SiblingsWith methods when you need to find only a few nodes out of all possible matches and need to iterate the list only one time. If you need to cycle over the list of ancestor nodes multiple times or you know you will need most or all of the ancestors, then an enumerator may be faster.
Table 12-24 NodeEnumeratorObject Methods
Name | Description |
---|---|
GetCurrent() |
The current node (either a NodeObject or LocalNodeObject depending on the context). |
MoveNext() |
Advances the enumerator to the next node. Returns False if there are no more nodes to enumerate. |
ValidationObject
Table 12-25 ValidationObject Properties
Name | Description |
---|---|
Abbrev |
Name of the validation (including fully-qualified namespace) |
Descr |
Description |
EditorLabel |
Label |
Cascade |
True if validation assignment is inherited |
ValidationClass |
Name of validation class |
ValidationLevel |
A ValidationLevel enumeration value, for example ValidationLevel.Node (see Enumeration Constants). |
ValidationType |
A ValidationType enumeration value, for example ValidationType.Batch (see Enumeration Constants). |
Validation Scripts
-
The validation script returns a JavaScript object that contains a property named "success". If the script returns a Boolean value or a non-Boolean object (for example, Number or String), then its value is converted to Boolean using standard JavaScript conversion rules and then assigned to the success property. The script can optionally return a JavaScript array of values in a property named parameters. The array values are substituted into the failure message of the validation using string substitution.
-
You can return a Boolean value (True or False). If you return True, the validation succeeds; otherwise it fails. If you do not return a value, it is considered the same as returning False.
-
If you return a non-Boolean object, such as Number or String, it is converted to Boolean then returned. Standard JavaScript conversion applies. Numbers equal to zero, empty strings, and null or undefined objects are interpreted as false. All other values are true.
-
If you return a complex object that contains a property named "success," that success property is converted to Boolean and used as the return value of the validation. You can optionally return an Array of values in a property named "parameters." This is a JavaScript Array object, that needs to be populated and then used in the parametrized Failure Message. The parameters are substituted into the failure message of the validation using string substitution. You should return the correct number of values corresponding to the placeholders in the failure message. If you return extra parameters they are ignored. If you do not return enough parameters, the missing parameters are considered empty strings.
RequestObject
The RequestObject represents a governance request, including request header, and items. The Items property represents a list of the request items added to the request. A key attribute is the Version property, the target version for the request including its hierarchies and nodes, all accessible via the relevant script objects.
Table 12-26 RequestObject Properties
Name | Description |
---|---|
ID |
ID |
Title |
Title of request |
Version |
Target version for request |
ModelName |
Workflow model for request |
StageName |
Current stage of request |
StageType |
WorkflowStageType enumeration value, for example, WorkflowStageType.Submit (see Enumeration Constants) |
Status |
WorkflowStatus enumeration value, for example, WorkflowStatus.Submitted (see Enumeration Constants) |
Items |
List of RequestItemObject added to the request |
RequestItemObject
The RequestItemObject represents an individual request item for a governance request, including information about the current task and the node being updated, along with the details (property values) for the item. The Request property provides access to the full request object for the item, including header properties and other items.
The NodeNamePendingInRequest method is used for identifying potential node name conflicts with other in-flight requests for the target version, returning True if an item on another pending request contains an Add item for the same node name.
Table 12-27 RequestItemObject Properties
Name | Description |
---|---|
ItemID |
Item ID |
RequestID |
Request ID |
Request |
Request object to which the item belongs |
NodeName |
Core.Abbrev of node being updated |
Description |
Core.Descr of node being updated |
HierarchyName |
Hierarchy of node being updated |
ParentName |
Core.Parent of node being updated |
TaskName |
Workflow task name of request item |
TaskAction |
WorkflowAction enumeration value, for example, WorkflowAction.AddLimb (see Enumeration Constants) |
TaskDomain |
Domain name (if any) of workflow task |
ItemDetails |
List of RequestItemDetailObject for request item |
Table 12-28 RequestItemObject Methods
Name | Description |
---|---|
NodeNamePendingInRequest(name) |
Accepts a parameter of a specific node name to test. Returns True if an in-flight request other than the current one for the version contains an AddLimb/Leaf item with the specified name. |
RequestItemDetailObject
The RequestItemDetailObject represents an individual request item detail for a governance request, corresponding to a single property value.
Table 12-29 RequestItemDetailObject Properties
Name | Description |
---|---|
CalcValue |
Calculated value of property |
HasCalcValue |
Returns True if the value is calculated |
Modified |
Returns True if the value was modified in the request |
PropertyName |
Name of property |
Value |
Value of property |