Hierarchy
- OrganisationStructure
Methods
createItem
-
The method allows you to create a new item of the organizational chart.
Parameters
-
name: string
-
type: OrganisationStructureItemType
Returns OrganisationStructureItem
-
createTree
-
The method creates a new organizational chart tree.
Parameters
-
rootName: string
Returns OrganisationStructureTree
-
fetchTree
-
The method is used to load the current org chart tree.
const tree = await System.organisationStructure.fetchTree();
Returns Promise<OrganisationStructureTree>
save
-
The method saves the configured tree as the current org chart.
Before saving, the org chart will be automatically validated.
Parameters
Returns Promise<ErrorObject[]>
search
-
The method is used to perform search in the org chart.
You can use this method to filter, start extraction from a specific item, limit selection, sort, get the first result, or get the results page.
Example:const position = await System.organisationStructure .search().where(position => position.name.eq('CEO')).first();
Returns OrganisationStructureSearch
Organizational chart object
Used to get the current org chart as a tree to create a new org chart tree or a new item or to save the configured tree as the current org chart.
const tree = await System.organisationStructure.fetchTree(); const newItem = System.organisationStructure.createItem('MArketing Director', OrganisationStructureItemType.Position); tree.getRoot(). addChild(newItem); const errs = await tree.validate(); if (errs.length === 0) { // Validation successful const sErrs = await System. organisationStructure.save(tree); }