tracking-code-which-will-go-to-the-HEAD DefaultData

Class

DefaultData

DefaultData(pluginConfiguration, props, eventopt)

Class that represents all data of a Plugin.
Constructor

# new DefaultData(pluginConfiguration, props, eventopt)

Default constructor.
Parameters:
Name Type Attributes Description
pluginConfiguration DefaultConfiguration Plugin configuration storage.
props object All properties.
name string Name of plugin.
version string Version of plugin.
components Array.<Component> <optional>
Components array.
variables Array.<Variable> <optional>
Variables array.
definitions object <optional>
All definitions.
definitions.components Array.<ComponentDefinition> <optional>
All component definitions.
definitions.link Array.<ComponentLinkDefinition> <optional>
All component link definitions.
parseLogs Array.<parseLog> <optional>
Parse log array.
resources object <optional>
All svg models.
resources.icons object <optional>
All svg models' icons
resources.markers object <optional>
All svg models' markers.
resources.links object <optional>
All svg models' links.
resources.models object <optional>
All svg models' components.
resources.style string <optional>
All specific style.
scene object <optional>
All scene data, position, zoom factor, current selection and selected container type.
scene.x number <optional>
Translation x of the scene.
scene.y number <optional>
Translation y of the scene.
scene.zoom number <optional>
Zoom factor of the scene.
scene.selection Array.<string> <optional>
List of ids of selected components.
scene.selectionRef string <optional>
Type on container selection. If null it refers to root container.
event object <optional>
Event manager.
next function <optional>
Function to emit event.

View Source models/DefaultData.js, line 13

Members

Array.<Component>

# components

All plugin components.
Default Value:
  • []

View Source models/DefaultData.js, line 78

DefaultConfiguration

# configuration

Plugin configuration storage.

View Source models/DefaultData.js, line 133

# coreVersion

Get version of plugin core.

View Source models/DefaultData.js, line 158

Object

# definitions

All plugin definitions.

View Source models/DefaultData.js, line 101

Array.<EventLog>

# eventLogs

All plugin event logs.

View Source models/DefaultData.js, line 128

object

# eventManager

Event manager.

View Source models/DefaultData.js, line 123

string

# name

Plugin name.

View Source models/DefaultData.js, line 67

Array.<ParserLog>

# parseLogs

All parser errors.
Default Value:
  • []

View Source models/DefaultData.js, line 111

object

# resources

Object that contains resources.
Default Value:
  • null

View Source models/DefaultData.js, line 140

object

# scene

All scene data, position, zoom factor, current selection and selected container type.

View Source models/DefaultData.js, line 84

ComponentTemporaryLink
Current temporary link.

View Source models/DefaultData.js, line 151

Array.<Variable>

# variables

All plugin variables.

View Source models/DefaultData.js, line 96

string

# version

Plugin version.

View Source models/DefaultData.js, line 72

Methods

# addComponent(definition, path) → {string}

Create and add new component inside components list.
Parameters:
Name Type Description
definition ComponentDefinition Component definition.
path string Component path.

View Source models/DefaultData.js, line 227

Component id.
string

# canBeLinked(source, target) → {boolean}

Indicate if type can be linked with another.
Parameters:
Name Type Description
source string Source type.
target string Target type.

View Source models/DefaultData.js, line 391

True if type can be linked to another otherwise false.
boolean
Indicate if type can have a link.
Parameters:
Name Type Description
type string Component type.

View Source models/DefaultData.js, line 381

True if component can have link otherwise false.
boolean
Create temporary link.
Parameters:
Name Type Description
source string Id of component can be the source in a link.
anchorName string Anchor name of the component.

View Source models/DefaultData.js, line 401

# deleteAllEventLogsBefore(date)

Delete all event logs before the specified datetime.
Parameters:
Name Type Description
date number Date time as timestamp.

View Source models/DefaultData.js, line 585

# emitEvent(props) → {number}

Emit event with log.
Parameters:
Name Type Description
props object EventLog information.
See:

View Source models/DefaultData.js, line 595

EventLog id.
number

# generateComponentId() → {string}

Generate id from definition and components list. The id is composed of "id_" and the number of component plus 1.

View Source models/DefaultData.js, line 245

Unique string for the id.
string

# getAttributeValue(attribute) → {string|Array.<string>}

Get the value of an attribute.
Parameters:
Name Type Description
attribute ComponentAttribute Attribute to get value.

View Source models/DefaultData.js, line 322

Value of attribute.
string | Array.<string>

# getChildren(id) → {Array.<Component>}

Get children of container component with corresponding id.
Parameters:
Name Type Description
id string Component container id.

View Source models/DefaultData.js, line 510

Children component array.
Array.<Component>

# getComponentByConfigurationKey(key) → {Component}

Get component by configuration any kind of key. The configuration file is using a certain type of key for the components, this key is used to define their position. So in order to retrieve the component's position from the configuration file, we need to know which kind of key is used. By default, if not overriden by plugin, it has the same behavior as getComponentById.
Parameters:
Name Type Description
key string Key to use for finding the component. By default the key is the id.

View Source models/DefaultData.js, line 199

Component or null.
Component

# getComponentById(id) → {Component}

Get component by id.
Parameters:
Name Type Description
id string Component id.

View Source models/DefaultData.js, line 167

Component or null.
Component

# getComponentDepth(id) → {number}

Recursively calculates the depth of a component within a hierarchical structure, starting at 0. The depth of a component is defined as the number of levels it is nested within other components. A top-level component has a depth of 0. For each level of nesting, the depth increases by 1.
Parameters:
Name Type Description
id string Component id.

View Source models/DefaultData.js, line 179

Component depth.
number

# getComponentIdFromValue(value) → {string}

Get the ID of a linked resource.
Parameters:
Name Type Description
value string Value of the link.

View Source models/DefaultData.js, line 372

ID of the linked resource.
string

# getComponentsByType(type) → {Array.<Component>}

Get all components corresponding to the given type.
Parameters:
Name Type Description
type string Type of component to find.

View Source models/DefaultData.js, line 217

Component list.
Array.<Component>

# getEventLogById(id) → {EventLog}

Get event log by id.
Parameters:
Name Type Description
id number Event log id.

View Source models/DefaultData.js, line 577

Event log or undefined.
EventLog

# getLinkedComponentsIds(attribute) → {Array.<string>}

Get the ID of the linked component.
Parameters:
Name Type Description
attribute ComponentAttribute Link to get value.

View Source models/DefaultData.js, line 335

ID of the linked component.
Array.<string>
Get all links from all component attributes.

View Source models/DefaultData.js, line 288

List of links.
Array.<ComponentLink>

# getUsedLinkDefinitions() → {Array.<ComponentLinkDefinition>}

Uniquely get the definitions used for existing links.

View Source models/DefaultData.js, line 440

- List of link definitions.
Array.<ComponentLinkDefinition>

# getVariableValue(name) → {string|Array.<string>}

Get the value of a variable.
Parameters:
Name Type Description
name string Name of the variable.

View Source models/DefaultData.js, line 350

Value of the variable.
string | Array.<string>
Build internal links for workflow containers.

View Source models/DefaultData.js, line 413

List of links
Array.<ComponentLink>

# initLinkDefinitions(parentEventIdopt)

Initialize all link definitions from all component attribute definitions.
Parameters:
Name Type Attributes Description
parentEventId string <optional>
Parent event id.

View Source models/DefaultData.js, line 460

# insertComponentAfter(movedId, targetId)

Insert the moved component after the target in the internal component list
Parameters:
Name Type Description
movedId string The id of the component to move
targetId string The id of the component that will be immediately before the moved component

View Source models/DefaultData.js, line 559

# insertComponentBefore(movedId, targetId)

Insert the moved component before the target in the internal component list
Parameters:
Name Type Description
movedId string The id of the component to move
targetId string The id of the component that will be immediately after the moved component

View Source models/DefaultData.js, line 541

# removeComponentById(id)

Remove component by id and all attributes that used this component id.
Parameters:
Name Type Description
id string Component id.

View Source models/DefaultData.js, line 263

Remove link attribute in components.
Parameters:
Name Type Description
link ComponentLink Link to remove.

View Source models/DefaultData.js, line 277

# renameComponentExternalId(id, newExternalId)

Rename a component external ID.
Parameters:
Name Type Description
id string ID of component.
newExternalId string New external ID of component.

View Source models/DefaultData.js, line 208

# setVariableValue(name, value)

Set the value of a variable.
Parameters:
Name Type Description
name string Name of the variable.
value string New value of the variable.

View Source models/DefaultData.js, line 359