Node functionality

Node is a version of a generic tree node (can represent part of mechanism, special type of simulation, document, program, etc. depending of assigned type), with set of children, reference to previous version, assignments of files, access rights, approvals, tasks, properties and some other meta data.

node_list_types

returns list of types acceptable for nodes in target PBS

QUERY_FUNCTION node_list_types(id: INTEGER): LIST OF STRING

Parameters:
id optional instance id of parent node

node_create

creates first version of new node in current state of PBS and puts it as child into specified parent nodes

To call the query logged in user shall be associated with a person granted with writing privileges in all provided parent nodes (EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION node_create(subject: v_node; in_domain_of_nodes: LIST OF INTEGER): v_node

Parameters:
subject input parameters of the node, see v_node description, see v_node
The following attributes of input structure are ignored:
  • subject.item.instance_id (generated new)
  • subject.item.introduced (replaced with time stamp)
  • subject.item.created (the baseline is associated with logged in user)
  • subject.file_shortcuts
  • subject.node_shortcuts
  • subject.back_links
  • subject.assigned_persons
  • subject.assigned_organizations
  • subject.attached_files
  • subject.assigned_approvals
  • subject.assigned_properties
  • subject.tasks
  • subject.nodus.ancestor (unset)
in_domain_of_nodes list if db ID-s parent nodes and pbs (to create root nodes db ID of current state of pbs shall be put into the aggregate). The parameter could be unset or empty, created node will be a root in current state of PBS

Returns actual attributes of the newly added node (see v_node)

Note:

  1. it is supposed that node is unique by node.id value and its uniquty is checked, if id is unset it is assigned to generated guid
  2. it is supposed that item_type/name/version of the node is unique in scope of its parents (domains), it is checked

node_get

returns data of a node version specified by db ID of its instance and optionally by version tag

To call the query logged in user shall be associated with a person granted with reader privileges in the interesting node (READER_TYPE, EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION node_get(id: INTEGER; version: STRING): v_node

Parameters:
id interesting node instance db id
version optional version tag of the node version (can be used to get another version of node specified by id)

Returns actual data of the required node version (see v_node)


node_get_whole_branch

returns whole branch of the specified node (including children in whole depth)

QUERY_FUNCTION node_get_whole_branch(id: INTEGER; version: STRING): t_nodus

Parameters:
id interesting node instance db id
version optional version tag of the node version (can be used to get another version of node specified by id)

Returns actual data of the required node version branch (see t_nodus)


node_list

lists data of node versions specified by list of their instance db ID-s. Normally source of the the list is v_pbs.nodes or v_node.nodes returned by get_pbs, get_node

To call the query logged in user shall be associated with a person granted with reader privileges over whole pbs (READER_TYPE, EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered).

QUERY_FUNCTION node_list(ids: LIST OF INTEGER): LIST OF v_node

Parameters:
ids list of interesting node versions' instance db ID

Returns list of actual data of the required node versions (see t_nodus)


node_get_children

QUERY_FUNCTION node_get_children(id: INTEGER; version: STRING): LIST OF v_node

Parameters:
id interesting node instance db id
version optional version tag of the node version (can be used to get another version of node specified by id)

Returns list of children of the specified node (see t_nodus)


node_get_actual_properties

list of properties actually assigned to the specified node (without mandatory, but not assigned)
Note: to get list of properties with mandatory, but not assigned properties call node_get_properties

QUERY_FUNCTION node_get_children(id: INTEGER; version: STRING): LIST OF v_assigned_property

Parameters:
id interesting node instance db id
version optional version tag of the node version (can be used to get another version of node specified by id)

Returns assigned properties of the specified node (see v_assigned_property)


node_create_successor - deprecated!!!

creates next version of specified node in current state of PBS, replacing in some parents reference to prev. version with new one. New version is created as clone of the existing one, including person and organization assignments, attachments, references, properties and child nodes. Only assigned approvals and tasks are not moved.

To call the query logged in user shall be associated with a person granted with writing privileges in all provided parent nodes (EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION node_create_successor(
      id                : INTEGER;
      new_version       : STRING;
      remove_old_form,
      add_new_to        : LIST OF INTEGER;
      inherit_children,
      inherit_files     : BOOLEAN) :  v_node
Parameters:
id interesting node instance db id
new_version optional version tag for new node version, if unset or empty version tag is generated in sequence of existing
remove_old_from optional list of parent nodes' db ID where from old version (id) shall be replaced by newly created
add_new_to optional list of parent nodes' db ID where newly created version shall be added as child
inherit_children TRUE if new version inherits used nodes of the old one
inherit_files TRUE if newly created version gets copy of file attachments
NOTE
  1. remove_old_form and add_new_to are unset the new version becomes a root node of the current pbs state,
  2. if remove_old_form is specified and add_new_to is unset new version will be added to parents listed in remove_old_form (to replace old)

Returns actual attributes of the newly added node version (see v_node)


node_shift_version

replaces or moves version of specified child node with another its version in domain of parent noduses

To call the query logged in user shall be associated with a person granted with writing privileges in all provided parent nodes (EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION node_shift_version(
      replace_in,
      add_to            : LIST OF INTEGER;
      node_id           : INTEGER;
      version_tag       : STRING): v_node
Parameters:
replace_in optional list of parent nodes' db ID where specified child shall be replaced with its another version
add_to optional list of parent nodes' db ID where specified version of the node shall be added as child
node_id db ID of node version to be replaced with another its version
version_tag optional version tag of version to replace specified child in domain of parents

Returns node version specified by version_tag (see v_node)


node_branch_extend

creates new version of the specified node in context of specified parents. New version will replace the target version. New versions of the parent (if they are not editable) will be created incrementally up to creating new current state of pbs if required. Newly created node versions will be assigned with automatically generated version tags

To call the query logged in user shall be associated with a person granted with writing privileges in all provided parent nodes (EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION node_branch_extend( 
      node_id           : INTEGER;
      branch            : LIST OF INTEGER;
      inherit_children,
      inherit_files     : BOOLEAN) :  LIST OF v_node
Parameters:
node_id db ID of node version to be extended with new version
branch optional list of db ID-s of nodes using target node version (may be indirectly) which can be extended with successor (new version) in execution of the function NOTE: By default all not editable using (parent) nodes will be extended with new version
inherit_children TRUE if new version inherits used nodes of the old one
inherit_files TRUE if newly created version gets copy of file attachments

Returns list of node versions created in the function (at least one - extension of the target version) (see v_node)


node_extract

extracts specified node version including child nodes in whole depth from target model with or without its history
QUERY_FUNCTION node_extract(
      id             : INTEGER;
      with_history   : BOOLEAN;
      user_comment,
      target_model,
      PDI_file       : STRING) :  STRING
Parameters:
id interesting for extraction node instance id
with_history TRUE to include into extraction all prev. versions
user_comment (optional) text of user's comment for PDI file
target_model (optional) qualified name of the target model in form 'rep_name.mod_name', if unset or empty model is named by system_get_config('EXPORT', 'REPOSITORY') + '.' + system_get_config('EXPORT', 'MM_PREFIX') + system_get_config('COUNTERS', 'MM_MODEL')
PDI_file name of optional PDI file to be created in the extraction

Returns list of node versions created in the function (at least one - extension of the target version) (see v_node)


node_extract_ext

extracts specified node version including child nodes in whole depth from target model with or without its history with extended output
QUERY_FUNCTION node_extract_ext(
      id             : INTEGER;
      with_history   : BOOLEAN;
      user_comment,
      target_model,
      PDI_file       : STRING):  extract_result
Parameters:
id interesting for extraction node instance id
with_history TRUE to include into extraction all prev. versions
user_comment (optional) text of user's comment for PDI file
target_model optional, qualified name of the target model in form 'rep_name.mod_name', if unset or empty model is named by system_get_config('EXPORT', 'REPOSITORY') + '.' + system_get_config('EXPORT', 'MM_PREFIX') + system_get_config('COUNTERS', 'MM_MODEL')
PDI_file name of optional PDI file to be created in the extraction

Returns structure with the following attributes (see extract_result)


node_mark_visited

set visited mark in the node for user
QUERY_FUNCTION node_mark_visited(
      subj     : INTEGER) 
               : LIST OF v_update_flag
Parameters:
subj node instance id

Returns list of parents that can change after that updated flag (see v_update_flag)


node_update

updates data of the specified by bd ID node version

To call the query logged in user shall be associated with a person granted with writing privileges in all provided parent nodes (EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION node_update(subj: v_node):  v_node
Parameter:
subj updated data of the node version (see v_node description). Target instance is specified by subj.nodus.item.instance_id
The following attributes are ignored:
  • subject.file_shortcuts
  • subject.node_shortcuts
  • subject.back_links
  • subject.assigned_persons
  • subject.assigned_organizations
  • subject.attached_files
  • subject.assigned_approvals
  • subject.assigned_properties
  • subject.tasks
  • subject.nodus.ancestor
  • subject.nodus.item.introduced
  • subject.nodus.item.creator

Returns actual data of the updated node version (see v_node)


node_info

collects and returns some generic info over specified version of node

No any special access rights is required to call the query

QUERY_FUNCTION node_info(id: INTEGER): LIST OF info_line
Parameter:
id db ID of node version to be informed

Returns Information represented by list of simple string structures: field name - field value:


node_get_owning_organizations

collects and returns list of assigned to the node organizations (including indirect assignment)
QUERY_FUNCTION node_get_owning_organizations(id: INTEGER): LIST OF v_assigned_organization
Parameter:
id db ID of node version to be informed
Returns v_assigned_organization

node_get_owning_persons

collects and returns list of assigned to the node persons (including indirect assignment)
QUERY_FUNCTION node_get_owning_persons(id: INTEGER):  LIST OF v_assigned_person
Parameter:
id db ID of node version to be informed
Returns v_assigned_person

node_get_properties

collects and returns list of assigned to the node properties (including default assignments of mandatory properties)
QUERY_FUNCTION node_get_properties(id: INTEGER): LIST OF v_assigned_property
Parameter:
node db ID of node version to be informed
Returns v_assigned_property

node_move

move version of specified node from one parents to another
QUERY_FUNCTION node_move(
      id                : INTEGER;
      old_parents,
      new_parents       : LIST OF INTEGER) :  v_node
Parameters:
id db ID of node version to be moved
old_parents optional list of parent nodes' db ID where from the node version shall be removed
new_parents optional list of parent nodes' db ID where the node version shall be added as child
Returns actual attributes of the node version v_node

node_clone_branch

clones specified node in full its depth - creates a branch on PBS tree by sample

To call the query logged in user shall be associated with a person granted with writing privileges in all provided parent nodes (EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION node_clone_branch(
      source         : INTEGER;
      parents        : LIST OF INTEGER;
      sceleton_only  : BOOLEAN) :  v_node
Parameters:
source db ID of node version to be cloned
parents mandatory list of parent nodes' db ID where the clone shall be added as child
sceleton_only reserved for future development

Returns actual attributes of the branch root node v_node

NOTE: now the function create new branch using only structure of the source node branch (as well as names/descriptions/types) without other data (like attached items)


node_get_my_access

returns access of the currently logged in user in context of the specified node version taking into account default role of the user, all organizations where he presents, assignments of the user or users' organizations in the node and its parents
QUERY_FUNCTION node_get_my_access(id: INTEGER): STRING
Parameter:
id db ID of node version to be inquired

Returns one of the following: 'ADMIN', 'EDITOR', 'READER', 'INELIGIBLE'


node_delete_version

removes specified version (or all versions of the node) from target population and may be substitutes it with another version in context of all its parents

To call the query logged in user shall be associated with a person granted with admin privileges in all nodes using target node as parent (ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION node_delete_version(
      subject              : INTEGER;
      substitute           : STRING;
      remove_all_versions  : BOOLEAN): INTEGER
Parameters:
subject db ID of node version to be removed
substitute version tag for a node version that shall substituted/removed one
remove_all_versions TRUE if all versions of the node should be removed

NOTE: if remove_all_versions = TRUE, substitute value is ignored, if remove_all_versions = FALSE and substitute value equals to the version tag of the target node version it is not substituted, if substitute is empty or unset previous version (ancestor of the removed node) will be used

Returns one of the following: 'ADMIN', 'EDITOR', 'READER', 'INELIGIBLE'


node_merge

imports root nodes from specified SimDM model as children of the target node version
QUERY_FUNCTION node_merge(
      target_node_id : INTEGER;
      source_model   : STRING;
      source_item_id : INTEGER;
      user_comment,
      fork_date      : STRING):  merge_result
Parameters:
target_node_id db ID of node version to be populated with nodes of the source model
source_model fully specified source model in format: "[repository_name].[model_name]"
source_item_id optional source item id if the source_item_id belongs to pbs - all its child nodes are subject for merge if the source_item_id belongs to node - only the node (and its content including child nodes) is subject to merge by default (0) current or final state of source pbs is merged
user_comment (optional) user comment to be added into merge log
fork_date optional time stamp in TIMESTAMP_FORMAT that keep datetime of the sources export from target model the date is required to resolve merge conflicts

Returns view of updated node (see v_node)


Back to Home page