Home Manual Reference Source Test
import AddReferencesStream from 'atscm/src/lib/server/AddReferencesStream.js'
public class | source

AddReferencesStream

Expression Extends:

class AddReferencesStream extends waitForDependencies(CallScriptStream)

A stream that adds non-standard references to nodes when pushed.

Test:

Constructor Summary

Public Constructor
public

constructor(options: Object)

Creates a new stream for adding references to pushed nodes.

Member Summary

Public Members
public get

Id of the CreateNode script added with atscm import.

Private Members
private

A stack of NodeId#values to be retried afterwards.

Method Summary

Public Methods
public

Returns the referenced nodes that should be processed before the given file.

public

handleOutputArguments(file: AtviseFile, outArgs: node-opcua~Variant[], callback: function(err: Error))

Handles the results of a script call.

public

Prints an error message telling that adding one or more references failed.

public

Returns the references that need to be set for a file.

public

The options required to add references to the node for the given file.

Public Constructors

public constructor(options: Object) source

Creates a new stream for adding references to pushed nodes.

Params:

NameTypeAttributeDescription
options Object

The options to pass to the CallScriptStream.

Public Members

public get scriptId: NodeId source

Id of the CreateNode script added with atscm import.

Test:

Private Members

private _retry: Set<string> source

A stack of NodeId#values to be retried afterwards.

Public Methods

public dependenciesFor(file: AtviseFile): NodeId[] source

Returns the referenced nodes that should be processed before the given file.

Params:

NameTypeAttributeDescription
file AtviseFile

The file to check.

Return:

NodeId[]

The files dependencies.

public handleOutputArguments(file: AtviseFile, outArgs: node-opcua~Variant[], callback: function(err: Error)) source

Handles the results of a script call.

Params:

NameTypeAttributeDescription
file AtviseFile

The file the script was called with.

outArgs node-opcua~Variant[]

The raw method results.

callback function(err: Error)

Called once finished.

Test:

public processErrorMessage(file: AtviseFile): string source

Prints an error message telling that adding one or more references failed.

Params:

NameTypeAttributeDescription
file AtviseFile

The file who's node could not be created.

Return:

string

The resulting error message.

Test:

public referencesToAdd(file: AtviseFile): Object source

Returns the references that need to be set for a file.

Params:

NameTypeAttributeDescription
file AtviseFile

The file to check.

Return:

Object

The files's references.

public scriptParameters(file: AtviseFile): Object source

The options required to add references to the node for the given file.

Params:

NameTypeAttributeDescription
file AtviseFile

The processed file.

Return:

Object

The options passed to the AddReferences script.

Test: