Class: Core

Core(project, options)

new Core(project, options)

The Core defines the main API for model manipulation and traversal. It is important to note, that all 'Path' function must be used with caution as the returned information is just an estimate and does not guarantee that the actual node will exist (as in certain scenarios they might become invalid and need to be removed, but said removal can only take place during their load). Try to always 'Load' every node before depending on their paths.

Parameters:
Name Type Description
project ProjectInterface

project connected to storage

options object

contains logging information

Properties
Name Type Description
logger object

gmeLogger

globConf object

gmeConfig

Source:

Methods

addLibrary(node, name, libraryRootHash, libraryInfoopt, callbackopt) → {external:Promise}

It adds a project as library to your project by copying it over. The library will be a node with the given name directly under your project's ROOT. It becomes a read-only portion of your project. You will only be able to manipulate it with library functions, but cannot edit the individual nodes inside. However you will be able to instantiate or copy the nodes into other places of your project. Every node that was part of the META in the originating project becomes part of your project's meta.

Parameters:
Name Type Attributes Description
node module:Core~Node

any regular node in your project.

name string

the name of the library you wish to use as a namespace in your project.

libraryRootHash string

the hash of your library's root (must exist in the project's collection at the time of call).

libraryInfo object <optional>

information about your project.

Properties
Name Type Attributes Description
projectId string <optional>

the projectId of your library.

branchName string <optional>

the branch that your library follows in the origin project.

commitHash string <optional>

the version of your library.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreIllegalOperationError | CoreInternalError | null

the result of the execution.

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result is provided in a promise like manner.

Type
external:Promise

addMember(node, name, member)

Adds a member to the given set.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

name string

the name of the set.

member module:Core~Node

the new member of the set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

addMixin(node, path)

Adds a mixin to the mixin set of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

path string

the path of the mixin node.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

applyResolution(conflict) → {object}

When our attempt to merge two patches ended in some conflict, then we can modify that result highlighting that in case of every conflict, which side we prefer (mine vs. theirs). If we give that object as an input to this function, it will finish the merge resolving the conflict according our settings and present a final patch.

Parameters:
Name Type Description
conflict object

the object that represents our settings for every conflict and the so-far-merged patch.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function results in a tree structured patch object that contains the changesthat cover both parties modifications (and the conflicts are resolved according the input settings).

Type
object

applyTreeDiff(node, patch, callbackopt) → {external:Promise}

Apply changes to the current project.

Parameters:
Name Type Attributes Description
node module:Core~Node

the root of the containment hierarchy where we wish to apply the changes

patch object

the tree structured collection of changes represented with a special JSON object

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the result of the execution.

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promise.

Type
external:Promise

canSetAsMixin(node, path) → {object}

Checks if the given path can be added as a mixin to the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

path string

the path of the mixin node.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns an object with isOk set to true if the given path can be added as a mixin to the given node. If it cannot, the reason will be reported under reason.

Type
object
Example
result = core.canSetAsMixin(node, core.getPath(aValidMixinNode));
// result = { isOk: true, reason: '' }
result = core.canSetAsMixin(node, core.getPath(node));
// result = { isOk: false, reason: 'Node cannot be mixin of itself!' }
result = core.canSetAsMixin(node, core.getPath(nonMetaNode));
// result = { isOk: false, reason: 'Mixin must be on the Meta!!' }
result = core.canSetAsMixin(node, core.getPath(FCO));
// result = { isOk: false, reason: 'Base of node cannot be its mixin as well!' }

clearMetaRules(node)

Removes all META rules defined at the node. Note that it does not clear any rules from other meta-nodes where the node if referenced.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

clearMixins(node)

Removes all mixins for a given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

copyNode(node, parent) → {module:Core~Node}

Copies the given node into parent.

Parameters:
Name Type Description
node module:Core~Node

the node to be copied.

parent module:Core~Node

the parent node of the copy.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns the copied node.

Type
module:Core~Node

copyNodes(nodes, parent) → {Array.<module:Core~Node>}

Copies the given nodes into parent.

Parameters:
Name Type Description
nodes Array.<module:Core~Node>

the nodes to be copied.

parent module:Core~Node

the parent node of the copy.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an array of the copied nodes. The order follows the order of originals.

Type
Array.<module:Core~Node>

createChild(node, base) → {module:Core~Node}

Creates a child, with base as provided, inside the provided node.

Parameters:
Name Type Description
node module:Core~Node

the parent of the node to be created.

base module:Core~Node

the base of the node to be created.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns the created child node.

Type
module:Core~Node

createNode(parametersopt) → {module:Core~Node}

Creates a node according to the given parameters.

Parameters:
Name Type Attributes Description
parameters object <optional>

the details of the creation.

Properties
Name Type Attributes Description
parent module:Core~Node | null <optional>

the parent of the node to be created.

base module:Core~Node | null <optional>

the base of the node to be created.

relid string <optional>

the relative id of the node to be created (if reserved, the function returns the node behind the relative id)

guid module:Core~GUID <optional>

the GUID of the node to be created

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns the created node.

Type
module:Core~Node

createSet(node, name)

Creates a set for the node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

name string

the name of the set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delAspectMeta(node, name)

Removes the given aspect rule of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the aspect.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delAspectMetaTarget(node, name, path)

Removes a valid type from the given aspect of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the aspect.

path string

the absolute path of the valid type of the aspect.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delAttribute(node, name)

Removes the given attributes from the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the attribute.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delAttributeMeta(node, name)

Removes an attribute definition from the META rules of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the attribute.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delChildMeta(node, path)

Removes the given child rule from the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

path string

the absolute path of the child which rule is to be removed from the node.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delConstraint(node, name)

Removes a constraint from the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the constraint.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delMember(node, name, path)

Removes a member from the set. The functions doesn't remove the node itself.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

name string

the name of the set.

path string

the absolute path of the member to be removed.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delMemberAttribute(node, setName, memberPath, attrName)

Removes an attribute which represented a property of the given set membership.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

memberPath string

the absolute path of the member node.

attrName string

the name of the attribute.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delMemberRegistry(node, setName, path, regName)

Removes a registry entry which represented a property of the given set membership.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

path string

the absolute path of the member node.

regName string

the name of the registry entry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delMixin(node, path)

Removes a mixin from the mixin set of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

path string

the path of the mixin node.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delPointer(node, name)

Removes the pointer from the node. (Aliased deletePointer.)

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the pointer in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delPointerMeta(node, name)

Removes the complete META rule regarding the given pointer/set of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the pointer/set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delPointerMetaTarget(node, name, path)

Removes a possible target type from the pointer/set of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the pointer/set

path string

the absolute path of the possible target type.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If node is read-only, or definition does not exist.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delRegistry(node, name)

Removes the given registry entry from the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the registry entry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delSet(node, name)

Removes a set from the node. (Aliased deleteSet.)

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

name string

the name of the set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delSetAttribute(node, setName, attrName)

Removes the attribute entry for the set at the node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

attrName string

the name of the attribute entry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

delSetRegistry(node, setName, regName)

Removes the registry entry for the set at the node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

regName string

the name of the registry entry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

deleteNode(node)

Removes a node from the containment hierarchy.

Parameters:
Name Type Description
node module:Core~Node

the node to be removed.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

deletePointer(node, name)

Removes the pointer from the node. (Aliased delPointer.)

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the pointer in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

deleteSet(node, name)

Removes a set from the node. (Aliased delSet.)

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

name string

the name of the set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

generateTreeDiff(sourceRoot, targetRoot, callbackopt) → {external:Promise}

Generates a differential tree among the two states of the project that contains the necessary changes that can modify the source to be identical to the target. The result is in form of a json object.

Parameters:
Name Type Attributes Description
sourceRoot module:Core~Node

the root node of the source state.

targetRoot module:Core~Node

the root node of the target state.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the status of the exectuion.

treeDiff object

the difference between the two containment hierarchies in a special JSON object

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

if the callback is not defined, the result is provided in a promise like manner.

Type
external:Promise

getAllMetaNodes(node) → {Object.<string, module:Core~Node>}

Returns all META nodes.

Parameters:
Name Type Description
node module:Core~Node

any node of the containment hierarchy.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns a dictionary. The keys of the dictionary are the absolute paths of the META nodes of the project. Every value of the dictionary is a module:Core~Node.

Type
Object.<string, module:Core~Node>

getAspectDefinitionInfo(node, name, member) → {module:Core~DefinitionInfo}

Returns the meta nodes that introduce the given aspect relationship.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the set in question.

member module:Core~Node

the child.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The owner and the target of the aspect meta-rule that makes member a valid member of the named aspect of node.

Type
module:Core~DefinitionInfo

getAspectDefinitionOwner(node, name) → {module:Core~Node}

Returns the meta node that introduces the given aspect.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the set in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The meta-node that defines the aspect and makes a valid aspect for the given node.

Type
module:Core~Node

getAspectMeta(node, name) → {Array.<string>}

Returns the list of valid children types of the given aspect.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the aspect.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns a list of absolute paths of nodes that are valid children of the node and fits to the META rules defined for the aspect. Any children, visible under the given aspect of the node must be an instance of at least one node represented by the absolute paths.

Type
Array.<string>

getAttribute(node, name) → {string|number|bool|object|undefined}

Retrieves the value of the given attribute of the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the attribute.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns the value of the attribute of the node. If the value is undefined that means the node do not have such attribute defined.

Type
string | number | bool | object | undefined

getAttributeDefinitionOwner(node, name) → {module:Core~Node}

Returns the meta node that introduces the given attribute.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the attribute in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The meta-node that defines the attribute and makes it valid attribute for the given node.

Type
module:Core~Node

getAttributeMeta(node, name) → {object}

Returns the definition object of an attribute from the META rules of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the attribute.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns the definition object, where type is always defined.

Type
object
Examples
{
   type: "string"
}
{
   type: "string",
   regexp: "^win"
}
{
   type: "string",
   enum: [ "value1", "value2" ]
}
{
   type: "boolean"
}
{
   type: "integer"
}
{
   type: "integer",
   min: 0,
   max: 10
}
{
   type: "integer",
   enum: [ 3, 8 ]
}
{
   type: "float",
   min: 0,
   max: 9.9
}
{
   type: "asset"
}

getAttributeNames(node) → {Array.<string>}

Returns the names of the defined attributes of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an array of the names of the attributes of the node.

Type
Array.<string>

getBase(node) → {module:Core~Node|null}

Returns the base node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the base of the given node or null if there is no such node.

Type
module:Core~Node | null

getBaseRoot(node) → {module:Core~Node}

Returns the root of the inheritance chain of the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the root of the inheritance chain (usually the FCO).

Type
module:Core~Node

getBaseType(node) → {module:Core~Node|null}

Returns the meta-node of the node in question, that is the first base node that is part of the meta. (Aliased getMetaType).

Parameters:
Name Type Description
node module:Core~Node

the node in question

Source:
Throws:
  • If node is not a Node

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the first node (including itself) among the inheritance chain that is a META node. It returns null if it does not find such node (ideally the only node with this result is the ROOT).

Type
module:Core~Node | null

getBaseTypes(node) → {Array.<module:Core~Node>}

Searches for the closest META node of the node in question and the direct mixins of that node.

Parameters:
Name Type Description
node module:Core~Node

the node in question

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the closest Meta node that is a base of the given node plus it returns all the mixin nodes associated with the base.

Type
Array.<module:Core~Node>

getChild(node, relativeId) → {module:Core~Node}

Retrieves the child of the input node at the given relative id. It is not an asynchronous load and it automatically creates the child under the given relative id if no child was there beforehand.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

relativeId string

the relative id which our child in question has.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Return an empty node if it was created as a result of the function or return the already existing and loaded node if it found.

Type
module:Core~Node

getChildDefinitionInfo(node, child) → {module:Core~DefinitionInfo}

Returns the meta nodes that introduce the given containment relationship.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

child module:Core~Node

the child.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The owner and the target of the containment meta-rule that makes child a valid child of node.

Type
module:Core~DefinitionInfo

getChildrenHashes(node) → {Object.<string, module:Core~ObjectHash>}

Collects the data hash values of the children of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns a dictionary of module:Core~ObjectHash that stored in pair with the relative id of the corresponding child of the node.

Type
Object.<string, module:Core~ObjectHash>

getChildrenMeta(node) → {module:Core~RelationRule}

Return a JSON representation of the META rules regarding the valid children of the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns a detailed JSON structure that represents the META rules regarding the possible children of the node.

Type
module:Core~RelationRule
Example
{
  '/5': { max: 1, min: -1 },
  '/c': { max: -1, min: 2 },
  max: 10,
  min: undefined
}

getChildrenPaths(node) → {Array.<string>}

Collects the paths of all the children of the given node.

Parameters:
Name Type Description
node module:Core~Node

the container node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an array of the absolute paths of the children.

Type
Array.<string>

getChildrenRelids(node) → {Array.<string>}

Collects the relative ids of all the children of the given node.

Parameters:
Name Type Description
node module:Core~Node

the container node in question.

Source:
Returns:

The function returns an array of the relative ids.

Type
Array.<string>

getCollectionNames(node) → {Array.<string>}

Retrieves a list of the defined pointer names that has the node as target.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an array of the names of the pointers pointing to the node.

Type
Array.<string>

getCollectionPaths(node, name) → {Array.<string>}

Retrieves a list of absolute paths of nodes that has a given pointer which points to the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the pointer.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an array of absolute paths of nodes that has the pointer pointing to the node.

Type
Array.<string>

getCommonBase(…nodes) → {module:Core~Node|null}

Returns the common base node of all supplied nodes. Note that if a node and its base are passed, the method will return the base of the base.

Parameters:
Name Type Attributes Description
nodes module:Core~Node <repeatable>

a variable number of nodes to compare

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The common base or null if e.g. the root node was passed or the fco.

Type
module:Core~Node | null
Example
core.getCommonBase(node1, node2, node3);

getCommonParent(…nodes) → {module:Core~Node|null}

Returns the common parent node of all supplied nodes. Note that if a node and its parent are passed, the method will return the parent of the parent.

Parameters:
Name Type Attributes Description
nodes module:Core~Node <repeatable>

a variable number of nodes to compare

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The common parent. Will be null whenever the root-node is passed in.

Type
module:Core~Node | null
Example
core.getCommonParent(node1, node2, node3);

getConstraint(node, name) → {module:Core~Constraint|null}

Gets a constraint object of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the constraint.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the defined constraint or null if it was not defined for the node.

Type
module:Core~Constraint | null
Example
{
  script: "function (core, node, callback) {callback(null, {hasViolation: false, message: ''});}",
  priority: 1,
  info: "Should check unique name"
}

getConstraintNames(node) → {Array.<string>}

Retrieves the list of constraint names defined for the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the array of names of constraints available for the node.

Type
Array.<string>

getFCO(node) → {module:Core~Node}

Return the root of the inheritance chain of your Meta nodes.

Parameters:
Name Type Description
node module:Core~Node

any node in your project.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the acting FCO of your project.

Type
module:Core~Node

getFullyQualifiedName(node) → {string}

Returns the fully qualified name of the node, which is the list of its namespaces separated by dot and followed by the name of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the fully qualified name of the node, i.e. its namespaces and name join together by dots.

Type
string
Example
NS1.NS2.name

getGuid(node) → {module:Core~GUID}

Get the GUID of a node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the globally unique identifier.

Type
module:Core~GUID

getHash(node) → {module:Core~ObjectHash}

Returns the calculated hash and database id of the data for the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the hash value of the data for the given node. An empty string is returned when the node was mutated and not persisted.

Type
module:Core~ObjectHash

getInstancePaths(node) → {Array.<string>}

Collects the paths of all the instances of the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an array of the absolute paths of the instances.

Type
Array.<string>

getJsonMeta(node) → {object}

Gives a JSON representation of the META rules of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns an object that represents all the META rules of the node.

Type
object
Examples
{
  children: {
    items: [ "/1", "/c" ],
    minItems: [ -1, -1 ],
    maxItems: [ -1, -1 ]
  },
  attributes: {
    name: { type: "string" },
    level: { type: "integer"}
  },
  pointers: {
    ptr: {
      min: 1,
      max: 1,
      items: [ "/1" ],
      minItems: [ -1 ],
      maxItems: [ 1 ]
    },
    set: {
      min: -1,
      max: -1,
      items: [ "/c" ],
      minItems: [ -1 ],
      maxItems: [ -1 ]
    }
  },
  aspects: {
    filter: [ "/8", "/c" ]
  },
  constraints: {
    myConstraint: {
      script: "function (core, node, callback) {callback(null, {hasViolation: false, message: ''});}",
      priority: 1,
      info: "Should check unique name"
    }
  }
}
{
  children: {},
  attributes: {
     name: { type: "string" },
  },
  pointers: {},
  aspects: {},
  constraints: {}

getLibraryGuid(node, nameopt) → {module:Core~GUID}

Returns the origin GUID of any library node. (If name is not provided the returned GUID will be the same across all projects where the library node is contained - regardless of library hierarchy.)

Parameters:
Name Type Attributes Description
node module:Core~Node

the node in question.

name undefined | string <optional>

name of the library where we want to compute the GUID from. If not given, then the GUID is computed from the direct library root of the node.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the origin GUID of the node.

Type
module:Core~GUID

getLibraryInfo(node, name) → {object}

Returns the info associated with the library.

Parameters:
Name Type Description
node module:Core~Node

any node in the project.

name string

the name of the library.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the information object, stored alongside the library (that basically carries metaData about the library).

Type
object

getLibraryMetaNodes(node, name, onlyOwnopt) → {Array.<module:Core~Node>}

Returns all the Meta nodes within the given library. By default it will include nodes defined in any library within the given library.

Parameters:
Name Type Attributes Default Description
node module:Core~Node

any node of your project.

name string

name of your library.

onlyOwn bool <optional>
false

if true only returns with Meta nodes defined in the library itself.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns an array of core nodes that are part of your meta from the given library.

Type
Array.<module:Core~Node>

getLibraryNames(node) → {Array.<string>}

Gives back the list of libraries in your project.

Parameters:
Name Type Description
node module:Core~Node

any node in your project.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the fully qualified names of all the libraries in your project (even embedded ones).

Type
Array.<string>

getLibraryRoot(node, name) → {module:Core~Node|null}

Returns the root node of the given library.

Parameters:
Name Type Description
node module:Core~Node

any node in the project.

name string

the name of the library.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the library root node or null, if the library is unknown.

Type
module:Core~Node | null

getMemberAttribute(node, setName, path, attrName) → {string|number|bool|object|undefined}

Get the value of the attribute in relation with the set membership.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

path string

the absolute path of the member node.

attrName string

the name of the attribute.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Return the value of the attribute. If it is undefined, then there is no such attributed connected to the given set membership.

Type
string | number | bool | object | undefined

getMemberAttributeNames(node, name, path) → {Array.<string>}

Return the names of the attributes defined for the set membership to the member node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

name string

the name of the set.

path string

the absolute path of the member.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the array of names of attributes that represents some property of the membership.

Type
Array.<string>

getMemberOwnAttribute(node, setName, path, attrName) → {string|number|bool|object|undefined}

Get the value of the attribute for the set membership specifically defined to the member node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

path string

the absolute path of the member node.

attrName string

the name of the attribute.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Return the value of the attribute. If it is undefined, then there is no such attributed connected to the given set membership.

Type
string | number | bool | object | undefined

getMemberOwnAttributeNames(node, name, path) → {Array.<string>}

Return the names of the attributes defined for the set membership specifically defined to the member node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

name string

the name of the set.

path string

the absolute path of the member.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the array of names of attributes that represents some property of the membership.

Type
Array.<string>

getMemberOwnRegistry(node, setName, path, regName) → {string|number|bool|object|undefined}

Get the value of the registry entry for the set membership specifically defined to the member node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

path string

the absolute path of the member node.

regName string

the name of the registry entry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Return the value of the registry. If it is undefined, then there is no such registry connected to the given set membership.

Type
string | number | bool | object | undefined

getMemberOwnRegistryNames(node, name, path) → {Array.<string>}

Return the names of the registry entries defined for the set membership specifically defined to the member node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

name string

the name of the set.

path string

the absolute path of the member.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the array of names of registry entries that represents some property of the membership.

Type
Array.<string>

getMemberPaths(node, name) → {Array.<string>}

Returns the list of absolute paths of the members of the given set of the given node.

Parameters:
Name Type Description
node module:Core~Node

the set owner.

name string

the name of the set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns an array of absolute path strings of the member nodes of the set.

Type
Array.<string>

getMemberRegistry(node, setName, path, regName) → {string|number|bool|object|undefined}

Get the value of the registry entry in relation with the set membership.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

path string

the absolute path of the member node.

regName string

the name of the registry entry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Return the value of the registry. If it is undefined, then there is no such registry connected to the given set membership.

Type
string | number | bool | object | undefined

getMemberRegistryNames(node, name, path) → {Array.<string>}

Return the names of the registry entries defined for the set membership to the member node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

name string

the name of the set.

path string

the absolute path of the member.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the array of names of registry entries that represents some property of the membership.

Type
Array.<string>

getMetaType(node) → {module:Core~Node|null}

Returns the meta-node of the node in question, that is the first base node that is part of the meta. (Aliased getBaseType).

Parameters:
Name Type Description
node module:Core~Node

the node in question

Source:
Throws:
  • If node is not a Node

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the first node (including itself) among the inheritance chain that is a META node. It returns null if it does not find such node (ideally the only node with this result is the ROOT).

Type
module:Core~Node | null

getMixinErrors(node) → {Array.<module:Core~MixinViolation>}

Checks if the mixins allocated with the node can be used. Every mixin node should be on the Meta. Every rule (attribute/pointer/set/aspect/containment/constraint) should be defined only in one mixin.

Parameters:
Name Type Description
node module:Core~Node

the node to test.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the array of violations. If the array is empty, there is no violation.

Type
Array.<module:Core~MixinViolation>

getMixinNodes(node) → {Object.<string, module:Core~Node>}

Gathers the mixin nodes defined directly at the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The dictionary of the mixin nodes keyed by their paths.

Type
Object.<string, module:Core~Node>

getMixinPaths(node) → {Array.<string>}

Gathers the paths of the mixin nodes defined directly at the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The paths of the mixins in an array ordered by their order of use (which is important in case of some collision among definitions would arise).

Type
Array.<string>

getNamespace(node) → {string}

Returns the resolved namespace for the node. If node is not in a library it returns the empty string. If the node is in a library of a library - the full name space is the library names joined together by dots.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the name space of the node.

Type
string
Example
NS1.NS2

getOwnAttribute(node, name) → {string|number|bool|object|undefined}

Returns the value of the attribute defined for the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the attribute.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the value of the attribute defined specifically for the node. If undefined then it means that there is no such attribute defined directly for the node, meaning that it either inherits some value or there is no such attribute at all.

Type
string | number | bool | object | undefined

getOwnAttributeNames(node) → {Array.<string>}

Returns the names of the attributes of the node that have been first defined for the node and not for its bases.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an array of the names of the own attributes of the node.

Type
Array.<string>

getOwnChildrenPaths(parent) → {Array.<string>}

Collects the paths of all the children of the given node that has some data as well and not just inherited.

Parameters:
Name Type Description
parent module:Core~Node

the container node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an array of the absolute paths of the children.

Type
Array.<string>

getOwnChildrenRelids(node) → {Array.<string>}

Collects the relative ids of all the children of the given node that has some data and not just inherited. N.B. Do not mutate the returned array!

Parameters:
Name Type Description
node module:Core~Node

the container node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an array of the relative ids.

Type
Array.<string>

getOwnConstraintNames(node) → {Array.<string>}

Retrieves the list of constraint names defined specifically for the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the array of names of constraints for the node.

Type
Array.<string>

getOwnJsonMeta(node) → {object}

Returns the META rules specifically defined for the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an object that represent the META rules that were defined specifically for the node.

Type
object

getOwnMemberPaths(node, name) → {Array.<string>}

Returns the list of absolute paths of the members of the given set of the given node that not simply inherited.

Parameters:
Name Type Description
node module:Core~Node

the set owner.

name string

the name of the set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns an array of absolute path strings of the member nodes of the set that has information on the node's inheritance level.

Type
Array.<string>

getOwnPointerNames(node) → {Array.<string>}

Returns the list of the names of the pointers that were defined specifically for the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns an array of names of pointers defined specifically for the node.

Type
Array.<string>

getOwnPointerPath(node, name) → {string|null|undefined}

Returns the absolute path of the target of the pointer specifically defined for the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question

name string

the name of the pointer

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the absolute path. If the path is null, then it means that 'no-target' was defined specifically for this node for the pointer. If undefined it means that the node either inherits the target of the pointer or there is no pointer defined at all.

Type
string | null | undefined

getOwnRegistry(node, name) → {string|number|bool|object|undefined}

Returns the value of the registry entry defined for the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the registry entry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the value of the registry entry defined specifically for the node. If undefined then it means that there is no such registry entry defined directly for the node, meaning that it either inherits some value or there is no such registry entry at all.

Type
string | number | bool | object | undefined

getOwnRegistryNames(node) → {Array.<string>}

Returns the names of the registry enrties of the node that have been first defined for the node and not for its bases.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an array of the names of the own registry entries of the node.

Type
Array.<string>

getOwnSetAttribute(node, setName, attrName) → {string|number|bool|object|undefined}

Get the value of the attribute entry specifically set for the set at the node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

attrName string

the name of the attribute entry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Return the value of the attribute. If it is undefined, then there is no such attribute at the set.

Type
string | number | bool | object | undefined

getOwnSetAttributeNames(node, name) → {Array.<string>}

Return the names of the attribute entries specifically set for the set at the node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

name string

the name of the set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the array of names of attribute entries defined in the set at the node.

Type
Array.<string>

getOwnSetNames(node) → {Array.<string>}

Returns the names of the sets created specifically at the node. N.B. When adding a member to a set of a node, the set is automatically created at the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns an array of set names that were specifically created at the node.

Type
Array.<string>

getOwnSetRegistry(node, setName, regName) → {string|number|bool|object|undefined}

Get the value of the registry entry specifically set for the set at the node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

regName string

the name of the registry entry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Return the value of the registry. If it is undefined, then there is no such registry at the set.

Type
string | number | bool | object | undefined

getOwnSetRegistryNames(node, name) → {Array.<string>}

Return the names of the registry entries specifically set for the set at the node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

name string

the name of the set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the array of names of registry entries defined in the set at the node.

Type
Array.<string>

getOwnValidAspectNames(node) → {Array.<string>}

Returns the list of the META defined aspect names of the node that were specifically defined for the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns the aspect names that are specifically defined for the node.

Type
Array.<string>

getOwnValidAspectTargetPaths(node, name) → {Array.<string>}

Returns the paths of the meta nodes that are valid target members of the given aspect specifically defined for the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the aspec in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The paths of the meta nodes whose instances could be members of the aspect.

Type
Array.<string>

getOwnValidAttributeNames(node) → {Array.<string>}

Returns the list of the META defined attribute names of the node that were specifically defined for the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns the attribute names that are defined specifically for the node.

Type
Array.<string>

getOwnValidPointerNames(node) → {Array.<string>}

Returns the list of the META defined pointer names of the node that were specifically defined for the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns all the pointer names that are defined among the META rules of the node.

Type
Array.<string>

getOwnValidSetNames(node) → {Array.<string>}

Returns the list of the META defined set names of the node that were specifically defined for the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns all the set names that are defined among the META rules of the node.

Type
Array.<string>

getOwnValidTargetPaths(node, name) → {Array.<string>}

Returns the paths of Meta nodes that are possible targets of the given pointer/set introduced by the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of pointer/set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns the paths of valid nodes.

Type
Array.<string>

getParent(node) → {module:Core~Node|null}

Returns the parent of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the parent of the node or NULL if it has no parent.

Type
module:Core~Node | null

getPath(node) → {string}

Returns the complete path of the node in the containment hierarchy.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns a path string where each portion is a relative id and they are separated by '/'. The path can be empty as well if the node in question is the root itself, otherwise it should be a chain of relative ids from the root of the containment hierarchy.

Type
string

getPointerDefinitionInfo(node, name, target) → {module:Core~DefinitionInfo}

Returns the meta nodes that introduce the given pointer relationship.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the pointer in question.

target module:Core~Node

the target node.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The owner and the target of the pointer meta-rule that makes target a valid target of the named pointer of node.

Type
module:Core~DefinitionInfo

getPointerMeta(node, name) → {module:Core~RelationRule|undefined}

Return a JSON representation of the META rules regarding the given pointer/set of the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the pointer/set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns a detailed JSON structure that represents the META rules regarding the given pointer/set of the node.

Type
module:Core~RelationRule | undefined
Examples
pointer
{
  '/a': { max: 1, min: -1 },
  max: 1,
  min: 1
}
set
{
  '/G': { max: -1, min: -1},
  '/i': { max: -1, min: -1},
  max: -1
  min: -1
}

getPointerNames(node) → {Array.<string>}

Retrieves a list of the defined pointer names of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an array of the names of the pointers of the node.

Type
Array.<string>

getPointerPath(node, name) → {string|null|undefined}

Retrieves the path of the target of the given pointer of the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the pointer in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns the absolute path of the target node if there is a valid target. It returns null if though the pointer is defined it does not have any valid target. Finally, it return undefined if there is no pointer defined for the node under the given name.

Type
string | null | undefined

getRegistry(node, name) → {string|number|bool|object|undefined}

Retrieves the value of the given registry entry of the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the registry entry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns the value of the registry entry of the node. The value can be an object or any primitive type. If the value is undefined that means the node do not have such attribute defined.

Type
string | number | bool | object | undefined

getRegistryNames(node) → {Array.<string>}

Returns the names of the defined registry entries of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an array of the names of the registry entries of the node.

Type
Array.<string>

getRelid(node) → {string|null}

Returns the parent-relative identifier of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the last segment of the node path.

Type
string | null

getRoot(node) → {module:Core~Node}

Returns the root node of the containment tree that node is part of.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the root of the containment hierarchy (it can be the node itself).

Type
module:Core~Node

getSetAttribute(node, setName, attrName) → {string|number|bool|object|undefined}

Get the value of the attribute entry in the set.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

attrName string

the name of the attribute entry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Return the value of the attribute. If it is undefined, then there is no such attribute at the set.

Type
string | number | bool | object | undefined

getSetAttributeNames(node, name) → {Array.<string>}

Return the names of the attribute entries for the set.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

name string

the name of the set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the array of names of attribute entries in the set.

Type
Array.<string>

getSetDefinitionInfo(node, name, member) → {module:Core~DefinitionInfo}

Returns the meta nodes that introduce the given set relationship.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the set in question.

member module:Core~Node

the member.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The owner and the target of the set meta-rule that makes member a valid member of the named set of node.

Type
module:Core~DefinitionInfo

getSetNames(node) → {Array.<string>}

Returns the names of the sets of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns an array of set names that the node has.

Type
Array.<string>

getSetRegistry(node, setName, regName) → {string|number|bool|object|undefined}

Get the value of the registry entry in the set.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

regName string

the name of the registry entry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Return the value of the registry. If it is undefined, then there is no such registry at the set.

Type
string | number | bool | object | undefined

getSetRegistryNames(node, name) → {Array.<string>}

Return the names of the registry entries for the set.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

name string

the name of the set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the array of names of registry entries in the set.

Type
Array.<string>

getTypeRoot(node) → {module:Core~Node|null}

Returns the root of the inheritance chain (cannot be the node itself).

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns the root of the inheritance chain of the node. If returns null, that means the node in question is the root of the chain.

Type
module:Core~Node | null

getValidAspectNames(node) → {Array.<string>}

Returns the list of the META defined aspect names of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns all the aspect names that are defined among the META rules of the node.

Type
Array.<string>

getValidAspectTargetPaths(node, name) → {Array.<string>}

Returns the paths of the meta nodes that are valid target members of the given aspect.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the aspec in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The paths of the meta nodes whose instances could be members of the aspect.

Type
Array.<string>

getValidAttributeNames(node) → {Array.<string>}

Returns the list of the META defined attribute names of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns all the attribute names that are defined among the META rules of the node.

Type
Array.<string>

getValidChildrenMetaNodes(parameters) → {Array.<module:Core~Node>}

Retrieves the valid META nodes that can be base of a child of the node.

Parameters:
Name Type Description
parameters object

the input parameters of the query.

Properties
Name Type Attributes Default Description
node module:Core~Node

the node in question.

sensitive bool <optional>
false

if true, the query filters out the abstract and connection-like nodes.

multiplicity bool <optional>
false

if true, the query tries to filter out even more nodes according to the multiplicity rules.

children Array.<module:Core~Node> <optional>
[]

the current children of the node in question (must be passed if multiplicity=true)

aspect string | null <optional>

if given, the query filters to contain only types that are visible in the given aspect.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns a list of valid nodes that can be instantiated as a child of the node.

Type
Array.<module:Core~Node>

getValidChildrenPaths(node) → {Array.<string>}

Returns the list of absolute path of the valid children types of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an array of absolute paths of the nodes that was defined as valid children for the node.

Type
Array.<string>

getValidPointerNames(node) → {Array.<string>}

Returns the list of the META defined pointer names of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns all the pointer names that are defined among the META rules of the node.

Type
Array.<string>

getValidSetElementsMetaNodes(parameters) → {Array.<module:Core~Node>}

Retrieves the valid META nodes that can be base of a member of the set of the node.

Parameters:
Name Type Description
parameters object

the input parameters of the query.

Properties
Name Type Attributes Default Description
node module:Core~Node

the node in question.

name string

the name of the set.

sensitive bool <optional>
false

if true, the query filters out the abstract and connection-like nodes.

multiplicity bool <optional>
false

if true, the query tries to filter out even more nodes according to the multiplicity rules (the check is only meaningful if all the members were passed)

members Array.<module:Core~Node> <optional>
[]

the current members of the set of the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns a list of valid nodes that can be instantiated as a member of the set of the node.

Type
Array.<module:Core~Node>

getValidSetNames(node) → {Array.<string>}

Returns the list of the META defined set names of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns all the set names that are defined among the META rules of the node.

Type
Array.<string>

getValidTargetPaths(node, name) → {Array.<string>}

Returns the paths of Meta nodes that are possible targets of the given pointer/set.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of pointer/set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns the paths of valid nodes.

Type
Array.<string>

isAbstract(node) → {bool}

Checks if the node is abstract.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns true if the registry entry 'isAbstract' of the node if true hence the node is abstract.

Type
bool

isConnection(node) → {bool}

Check is the node is a connection-like node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns true if both the 'src' and 'dst' pointer are defined as valid for the node.

Type
bool

isEmpty(node) → {bool}

Checks if the node in question has some actual data.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns true if the node is 'empty' meaning that it is not reserved by real data. Returns false if the node is exists and have some meaningful value.

Type
bool

isFullyOverriddenMember(node, name, path) → {bool}

Checks if the member is completely overridden in the set of the node.

Parameters:
Name Type Description
node module:Core~Node

the node to test.

name string

the name of the set of the node.

path string

the path of the member in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns true if the member exists in the base of the set, but was added to the given set as well, which means a complete override. If the set does not exist or the member do not have a 'base' member or just some property was overridden, the function returns false.

Type
bool

isInstanceOf(node, baseNodeOrPath) → {bool}

Checks if the node is an instance of base.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

baseNodeOrPath module:Core~Node | string

a potential base node (or its path) of the node

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns true if the base is on the inheritance chain of node. A node is considered to be an instance of itself here.

Type
bool

isLibraryElement(node) → {bool}

Returns true if the node in question is a library element..

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns true if your node is a library element, false otherwise.

Type
bool

isLibraryRoot(node) → {bool}

Returns true if the node in question is a library root..

Parameters:
Name Type Description
node module:Core~Node

the node in question.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns true if your node is a library root (even if it is embedded in other library), false otherwise.

Type
bool

isMemberOf(node) → {object}

Returns all membership information of the given node.

Parameters:
Name Type Description
node module:Core~Node

the node in question

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns a dictionary where every the key of every entry is an absolute path of a set owner node. The value of each entry is an array with the set names in which the node can be found as a member.

Type
object

isMetaNode(node) → {bool}

Checks if the node is a META node.

Parameters:
Name Type Description
node module:Core~Node

the node to test.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns true if the node is a member of the METAAspectSet of the ROOT node hence can be seen as a META node.

Type
bool

isTypeOf(node, typeNodeOrPath) → {bool}

Checks if the given node in any way inherits from the typeNode. In addition to checking if the node "isInstanceOf" of typeNode, this methods also takes mixins into account.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

typeNodeOrPath module:Core~Node | string

the type node we want to check or its path.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns true if the typeNodeOrPath represents a base node, or a mixin of any of the base nodes, of the node. Every node is considered to be a type of itself.

Type
bool

isValidAspectMemberOf(node, parent, name) → {bool}

Returns if a node could be contained in the given container's aspect.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

parent module:Core~Node

the container node in question.

name string

the name of aspect.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns true if the given container could contain the node in the asked aspect.

Type
bool

isValidAttributeValueOf(node, name, value) → {bool}

Checks if the given value is of the necessary type, according to the META rules.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the attribute.

value string | number | bool | object

the value to test.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

Returns true if the value matches the META definitions.

Type
bool

isValidChildOf(node, parent) → {bool}

Checks if according to the META rules the given node can be a child of the parent.

Parameters:
Name Type Description
node module:Core~Node

the node in question

parent module:Core~Node

the parent we like to test.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns true if according to the META rules the node can be a child of the parent. The check does not cover multiplicity (so if the parent can only have twi children and it already has them, this function will still returns true).

Type
bool

isValidNewBase(node, base) → {boolean}

Checks if base can be the new base of node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

base module:Core~Node | null | undefined

the new base.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

True if the supplied base is a valid base for the node.

Type
boolean

isValidNewChild(parentNode, baseNode) → {boolean}

Checks if an instance of the given base can be created under the parent. It does not check for meta consistency. It only validates if the proposed creation would cause any loops in the combined containment inheritance trees.

Parameters:
Name Type Description
parentNode module:Core~Node | null

the parent in question.

baseNode module:Core~Node | null

the intended type of the node.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

True if a child of the type can be created.

Type
boolean

isValidNewParent(node, parent) → {boolean}

Checks if parent can be the new parent of node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

parent module:Core~Node

the new parent.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

True if the supplied parent is a valid parent for the node.

Type
boolean

isValidSetMemberOf(node, setOwner, name) → {bool}

Checks if the node can be a member of the given set at the provided set-owner node. This does not take cardinality rules into account.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

setOwner module:Core~Node

the owner of the set.

name string

the name of the set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns true if according to the META rules, the given node is a valid member of set of the given set-owner.

Type
bool

isValidTargetOf(node, source, name) → {bool}

Checks if the node can be a target of a pointer of the source node in accordance with the META rules.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

source module:Core~Node

the source to test.

name string

the name of the pointer.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns true if according to the META rules, the given node is a valid target of the given pointer of the source.

Type
bool

loadByPath(node, relativePath, callbackopt) → {external:Promise}

From the given starting node, it loads the path given as a series of relative ids (separated by '/') and returns the node it finds at the ends of the path. If there is no node, the function will return null.

Parameters:
Name Type Attributes Description
node module:Core~Node

the starting node of our search.

relativePath string

the relative path - built by relative ids - of the node in question.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the result of the execution

node module:Core~Node

the resulting node

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promise.

Type
external:Promise

loadChild(parent, relativeId, callbackopt) → {external:Promise}

Loads the child of the given parent pointed by the relative id. Behind the scenes, it means that it actually loads the data pointed by a hash stored inside the parent under the given id and wraps it in a node object which will be connected to the parent as a child in the containment hierarchy. If there is no such relative id reserved, the call will return with null.

Parameters:
Name Type Attributes Description
parent module:Core~Node

the container node in question.

relativeId string

the relative id of the child in question.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the result of the execution

node module:Core~Node

the resulting child

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promise.

Type
external:Promise

loadChildren(node, callbackopt) → {external:Promise}

Loads all the children of the given parent. As it first checks the already reserved relative ids of the parent, it only loads the already existing children (so no on-demand empty node creation).

Parameters:
Name Type Attributes Description
node module:Core~Node

the container node in question.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the result of the execution

children Array.<module:Core~Node>

the resulting children

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promise.

Type
external:Promise

loadCollection(node, pointerName, callbackopt) → {external:Promise}

Loads all the source nodes that has such a pointer and its target is the given node.

Parameters:
Name Type Attributes Description
node module:Core~Node

the target node in question.

pointerName string

the name of the pointer of the sources.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the result of the execution

node Array.<module:Core~Node>

the resulting sources

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promise.

Type
external:Promise

loadInstances(node, callbackopt) → {external:Promise}

Loads all the instances of the given node.

Parameters:
Name Type Attributes Description
node module:Core~Node

the node in question.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the status of the execution.

nodes Array.<module:Core~Node>

the found instances of the node.

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promise like manner.

Type
external:Promise

loadMembers(node, setName, callbackopt) → {external:Promise}

Loads all the members of the given set of the node.

Parameters:
Name Type Attributes Description
node module:Core~Node

the node in question.

setName string

the name of the set in question.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the status of the execution.

nodes Array.<module:Core~Node>

the found members of the set of the node.

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promise like manner.

Type
external:Promise

loadOwnChildren(node, callbackopt) → {external:Promise}

Loads all the children of the given parent that has some data and not just inherited. As it first checks the already reserved relative ids of the parent, it only loads the already existing children (so no on-demand empty node creation).

Parameters:
Name Type Attributes Description
node module:Core~Node

the container node in question.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the result of the execution

node Array.<module:Core~Node>

the resulting children

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promise.

Type
external:Promise

loadOwnMembers(node, setName, callbackopt) → {external:Promise}

Loads all the own members of the given set of the node.

Parameters:
Name Type Attributes Description
node module:Core~Node

the node in question.

setName string

the name of the set in question.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the status of the execution.

nodes Array.<module:Core~Node>

the found own members of the set of the node.

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promise like manner.

Type
external:Promise

loadOwnSubTree(node, callbackopt) → {external:Promise}

Loads a complete sub-tree of the containment hierarchy starting from the given node, but load only those children that has some additional data and not purely inherited.

Parameters:
Name Type Attributes Description
node module:Core~Node

the container node in question.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the result of the execution

nodes Array.<module:Core~Node>

the resulting sources

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promise.

Type
external:Promise

loadPointer(node, pointerName, callbackopt) → {external:Promise}

Loads the target of the given pointer of the given node. In the callback the node can have three values: if the node is valid, then it is the defined target of a valid pointer, if the returned value is null, then it means that the pointer is defined, but has no real target, finally if the returned value is undefined than there is no such pointer defined for the given node.

Parameters:
Name Type Attributes Description
node module:Core~Node

the source node in question.

pointerName string

the name of the pointer.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the result of the execution

node module:Core~Node

the resulting target

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promise.

Type
external:Promise

loadRoot(hash, callbackopt) → {external:Promise}

Loads the data object with the given hash and makes it a root of a containment hierarchy.

Parameters:
Name Type Attributes Description
hash module:Core~ObjectHash

the hash of the data object we like to load as root.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the result of the execution

node module:Core~Node

the resulting root node

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promiselike manner.

Type
external:Promise

loadSubTree(node, callbackopt) → {external:Promise}

Loads a complete sub-tree of the containment hierarchy starting from the given node.

Parameters:
Name Type Attributes Description
node module:Core~Node

the node that is the root of the sub-tree in question.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the result of the execution

nodes Array.<module:Core~Node>

the resulting sources

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promise.

Type
external:Promise

loadTree(hash, callbackopt) → {external:Promise}

Loads a complete containment hierarchy using the data object - pointed by the given hash - as the root.

Parameters:
Name Type Attributes Description
hash module:Core~ObjectHash

hash of the root node.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the result of the execution.

nodes Array.<module:Core~Node>

the resulting nodes.

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promise.

Type
external:Promise

moveAspectMetaTarget(node, target, oldName, newName)

Moves the given target definition over to a new aspect. As actual values in case of relation definitions vary quite a bit from the meta-targets, this function does not deals with the actual pointer/set target/members.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

target module:Core~Node

the target that should be moved among definitions.

oldName string

the current name of the aspect that has the target.

newName string

the new aspect name where the target should be moved over.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

moveMember(node, memberPath, oldSetName, newSetName)

Moves an own member of the set over to another set of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

memberPath string

the path of the memberNode that should be moved.

oldSetName string

the name of the set where the member is currently reside.

newSetName string

the name of the target set where the member should be moved to.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

moveNode(node, parent) → {module:Core~Node}

Moves the given node under the given parent.

Parameters:
Name Type Description
node module:Core~Node

the node to be moved.

parent module:Core~Node

the parent node of the copy.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns the node after the move.

Type
module:Core~Node

movePointerMetaTarget(node, target, oldName, newName)

Moves the given target definition over to a new pointer or set. Note this does not alter the actual pointer target or set members.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

target module:Core~Node

the target that should be moved among definitions.

oldName string

the current name of the pointer/set definition in question.

newName string

the new name of the relation towards the target.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

persist(node) → {module:Core~GmePersisted}

Persists the changes made in memory and computed the data blobs that needs to be saved into the database to make the change and allow other users to see the new state of the project.

Parameters:
Name Type Description
node module:Core~Node

some node element of the modified containment hierarchy (usually the root).

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns an object which collects all the changes on data level and necessary to update the database on server side. Keys of the returned object are 'rootHash' and 'objects'. The values of these should be passed to project.makeCommit.

Type
module:Core~GmePersisted

removeLibrary(node, name)

Removes a library from your project. It will also remove any remaining instances of the specific library.

Parameters:
Name Type Description
node module:Core~Node

any node in your project.

name string

the name of your library.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

renameAttribute(node, oldName, newName)

Renames the given attribute of the node if its value is not inherited.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

oldName string

the current name of the attribute in question.

newName string

the new name of the attribute.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

renameAttributeMeta(node, oldName, newName)

Renames the given attribute definition of the node. It also renames the default value of the definition! As a result of this operation, all instances of node will have the new attribute, but if they have overriden the old attribute it will remain under that name (and become meta invalid).

Parameters:
Name Type Description
node module:Core~Node

the node in question.

oldName string

the current name of the attribute definition in question.

newName string

the new name of the attribute.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

renameLibrary(node, oldName, newName)

Rename a library in your project.

Parameters:
Name Type Description
node module:Core~Node

any node in your project.

oldName string

the current name of the library.

newName string

the new name of the project.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

renamePointer(node, oldName, newName)

Renames the given pointer of the node if its target is not inherited.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

oldName string

the current name of the pointer in question.

newName string

the new name of the pointer.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

renameRegistry(node, oldName, newName)

Renames the given registry of the node if its value is not inherited.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

oldName string

the current name of the registry in question.

newName string

the new name of the registry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

renameSet(node, oldName, newName)

Renames the given set of the node if its is not inherited.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

oldName string

the current name of the set in question.

newName string

the new name of the set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setAspectMetaTarget(node, name, target)

Sets a valid type for the given aspect of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the aspect.

target module:Core~Node

the valid type for the aspect.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setAttribute(node, name, value)

Sets the value of the given attribute of the given node. It defines the attribute on demand, means that it will set the given attribute even if was ot defined for the node beforehand.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the attribute.

value string | number | bool | object

the new of the attribute, undefined is not allowed.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setAttributeMeta(node, name, rule)

Sets the META rules of the attribute of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the attribute.

rule object

the rules that defines the attribute

Properties
Name Type Attributes Description
type 'string' | 'integer' | 'float' | 'boolean' | 'asset'

the type of the attribute (valid types see CONSTANTS.ATTRIBUTE_TYPES).

enum Array.<string> <optional>

if the attribute is an enumeration, this array contains the possible values

default string | number | boolean <optional>

The value the attribute should have at the node. If not given it should be set at some point.

multiline boolean <optional>

if true, than the attribute represents a multiline string, for example code snipet.

multilineType string <optional>

describing the type of the multiline (like java or c++) suggesting syntax highlighting.

isPassword boolean <optional>

shows if the string attribute should be handled sensitively on the user interface.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setBase(node, base)

Sets the base node of the given node. The function doesn't touch the properties or the children of the node so it can cause META rule violations that needs to be corrected manually.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

base module:Core~Node | null

the new base.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setChildMeta(node, child, minopt, maxopt)

Sets the given child as a valid children type for the node.

Parameters:
Name Type Attributes Description
node module:Core~Node

the node in question.

child module:Core~Node

the valid child node.

min integer <optional>

the allowed minimum number of children from this given node type (if not given or -1 is set, then there will be no minimum rule according this child type)

max integer <optional>

the allowed maximum number of children from this given node type (if not given or -1 is set, then there will be no minimum rule according this child type)

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setChildrenMetaLimits(node, minopt, maxopt)

Sets the global containment limits for the node.

Parameters:
Name Type Attributes Description
node module:Core~Node

the node in question.

min integer <optional>

the allowed minimum number of children (if not given or -1 is set, then there will be no minimum rule according children)

max integer <optional>

the allowed maximum number of children (if not given or -1 is set, then there will be no maximum rule according children)

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setConstraint(node, name, constraint)

Sets a constraint object of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the constraint.

constraint module:Core~Constraint

the constraint to be set.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setGuid(node, guid, callbackopt) → {external:Promise}

Set the GUID of a node. As the Core itself do not checks whether the GUID already exists. The use of this function is only advised during the creation of the node.

Parameters:
Name Type Attributes Description
node module:Core~Node

the node in question.

guid module:Core~GUID

the new globally unique identifier.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreIllegalOperationError | CoreInternalError | null

the result of the execution.

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result will be provided in a promise.

Type
external:Promise

setMemberAttribute(node, setName, path, attrName, value)

Sets the attribute value which represents a property of the membership.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

path string

the absolute path of the member node.

attrName string

the name of the attribute.

value string | number | bool | object

the new value of the attribute.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setMemberRegistry(node, setName, path, regName, value)

Sets the registry entry value which represents a property of the membership.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

path string

the absolute path of the member node.

regName string

the name of the registry entry.

value string | number | bool | object

the new value of the registry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setPointer(node, name, target)

Sets the target of the pointer of the node.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the pointer in question.

target module:Core~Node | null

the new target of the pointer.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setPointerMetaLimits(node, name, minopt, maxopt)

Sets the global target limits for pointer/set of the node. On META level the only distinction between pointer and sets is the global multiplicity which has to maximize the number of possible targets to 1 in case of 'pure' pointer definitions.

Parameters:
Name Type Attributes Description
node module:Core~Node

the node in question.

name string

the name of the pointer/set.

min integer <optional>

the allowed minimum number of children (if not given or -1 is set, then there will be no minimum rule according targets)

max integer <optional>

the allowed maximum number of children (if not given or -1 is set, then there will be no maximum rule according targets)

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setPointerMetaTarget(node, name, target, minopt, maxopt)

Sets the given target as a valid target type for the pointer/set of the node.

Parameters:
Name Type Attributes Description
node module:Core~Node

the node in question.

name string

the name of the pointer/set.

target module:Core~Node

the valid target/member node.

min integer <optional>

the allowed minimum number of target/member from this given node type (if not given or -1 is set, then there will be no minimum rule according this target type)

max integer <optional>

the allowed maximum number of target/member from this given node type (if not given or -1 is set, then there will be no minimum rule according this target type)

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setRegistry(node, name, value)

Sets the value of the given registry entry of the given node. It defines the registry entry on demand, means that it will set the given registry entry even if was ot defined for the node beforehand.

Parameters:
Name Type Description
node module:Core~Node

the node in question.

name string

the name of the registry entry.

value string | number | bool | object

the new of the registry entry. Can be any primitive type or object. Undefined is not allowed.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setSetAttribute(node, setName, attrName, value)

Sets the attribute entry value for the set at the node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

attrName string

the name of the attribute entry.

value string | number | bool | object

the new value of the attribute.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

setSetRegistry(node, setName, regName, value)

Sets the registry entry value for the set at the node.

Parameters:
Name Type Description
node module:Core~Node

the owner of the set.

setName string

the name of the set.

regName string

the name of the registry entry.

value string | number | bool | object

the new value of the registry.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If the context of the operation is not allowed.

    Type
    CoreIllegalOperationError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError

traverse(root, options, visitFn, callbackopt) → {external:Promise}

The function traverses the sub-tree of the project starting with the given root and calls the visit function for every node.

Parameters:
Name Type Attributes Description
root module:Core~Node

the root node of the sub-tree that needs to be traversed.

options object

parameters to control the traversing.

Properties
Name Type Attributes Default Description
excludeRoot bool <optional>
false

controls whether the root should be excluded from visit.

order 'BFS' | 'DFS' <optional>
'BFS'

controls if the traversal order should be breadth first or depth first.

maxParallelLoad integer <optional>
100

the maximum number of parallel loads allowed.

stopOnError bool <optional>
true

controls if the traverse should stop in case of error.

visitFn function

the visitation function that will be called for every node in the sub-tree, the second parameter of the function is a callback that should be called to note to the traversal function that the visitation for a given node finished.

Properties
Name Type Description
node module:Core~Node

the node that is being visited.

next function

the callback function of the visit function that marks the end of visitation.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreInternalError | null

the status of the execution.

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the end of traverse is marked in a promise like manner.

Type
external:Promise

tryToConcatChanges(mine, theirs) → {object}

Tries to merge two patch object. The patches ideally represents changes made by two parties. They represents changes from the same source ending in different states. Our aim is to generate a single patch that could cover the changes of both party.

Parameters:
Name Type Description
mine object

the tree structured JSON patch that represents my changes.

theirs object

the tree structured JSON patch that represents the changes of the other party.

Source:
Throws:
  • If some of the parameters don't match the input criteria.

    Type
    CoreIllegalArgumentError
  • If some internal error took place inside the core layers.

    Type
    CoreInternalError
Returns:

The function returns with an object that contains the conflicts (if any) and the merged patch.

Type
object

updateLibrary(node, name, libraryRootHash, libraryInfoopt, updateInstructions, callbackopt) → {external:Promise}

It updates a library in your project based on the input information. It will 'replace' the old version, keeping as much information as possible regarding the instances.

Parameters:
Name Type Attributes Description
node module:Core~Node

any regular node in your project.

name string

the name of the library you want to update.

libraryRootHash string

the hash of your library's new root (must exist in the project's collection at the time of call).

libraryInfo object <optional>

information about your project.

Properties
Name Type Attributes Description
projectId string <optional>

the projectId of your library.

branchName string <optional>

the branch that your library follows in the origin project.

commitHash string <optional>

the version of your library.

updateInstructions

not yet used parameter.

callback function <optional>
Properties
Name Type Description
error Error | CoreIllegalArgumentError | CoreIllegalOperationError | CoreInternalError | null

the status of the execution.

Source:
Throws:

If some of the parameters don't match the input criteria.

Type
CoreIllegalArgumentError
Returns:

If no callback is given, the result is presented in a promise like manner.

Type
external:Promise