Linking Scripts

These scripts contain all the logic for creating links between nodes. This involves, to a large extent, deciding which links to create.

Hooks

The hooks in this section are organized in 3 sub-categories. The first category includes hooks that are triggered by changes in the graph. Some of them are tasked to schedule a “rescan-for-linking” event, which is the lowest priority event and its purpose is to scan through all the linkable session items and link them to a particular target. The “rescan-for-linking” event is always scheduled to run once for all the graph changes in a cycle. This is achieved by flagging the event as already scheduled in the module-standard-event-source; this flag is then cleared by a hook that runs on this event.

Selecting a target for each linkable and linking to it is deferred to another set of hooks by pushing a “select-target” event for each linkable. This event is the highest priority event and therefore no other changes in the graph are processed while targets are being selected.

Hooks triggered by changes in the graph

Hook name

File

Triggered by

Action

linking/rescan-trigger

rescan.lua

linkable SI added|removed or metadata-changed

schedules rescan-for-linking event

linking/linkable-removed

rescan.lua

linkable SI removed

destroys links related to the removed linkable

linking/follow

move-follow.lua

metadata-changed

schedules rescan-for-linking when the configured default sources/sinks are changed by the user

linking/move

move-follow.lua

metadata-changed

schedules rescan-for-linking when node target metadata properties are changed

linking/rescan-virtual-links

rescan-virtual-links.lua

link SI added, removed or metadata-changed