Script Node Writable Derived

This is an extension of script node, which is used only for the context node, i.e. the node that invoked the script. It adds additional methods to modify the derived data of the context node. (Any other modifications must use ScriptNodeWritableOriginal or service calls.)

The set methods return false if there are problems with the set, for example the member type or target does not exist, or the user is not authorised to link to the target. Details of the error are available in standard error fields on the script node writable object.

In all the calls, memberType and target can be specified by number, string reference or script node.

The methods allow members to be set and deleted by sequence. Sequence numbers are 1-based. Members do not automatically renumber, so deleting number 2 of the list A, B, C will leave C as number 3.

boolean = setMember(memberType,sequence,SciptMember) Set member at given sequence. Sequence is optional and defaults to 1. Sequence of 0 means "add at the end".
boolean = setValue(memberType[,sequence],value) Set value (scale and target are set null), sequence defaults to 1, 0 means add at end.
boolean = setScale(memberType[,sequence],scale) Set scale (value and target are set null), sequence defaults to 1, 0 means add at end.
boolean = setTarget(memberType[,sequence],target) Set target (value and scale are set null), sequence defaults to 1, 0 means add at end.
boolean = addMember(memberType,ScriptMember) Add member to end of member list.
boolean = addValue(memberType,value) Add member with value to end of member list.
boolean = addScale(memberType,scale) Add member with scale to end of member list.
boolean = addTarget(memberType,target) Add member with target to end of member list.
boolean = addAll(memberType,ScriptMember[]) Append all the members in an array to the current set of members.
boolean = deleteMember(memberType[,sequence]) Delete one item. Remember that this does not shuffle down the other members. Sequence defaults to 1, 0 has no special meaning.

Return false if there is an error. No such member is not considered an error. (ScriptNodeWritableDerived should always return true, but ScriptNodeWritableOriginal may return false.)

boolean = deleteAll(memberType) Delete all the members of a type.

Return false if there is an error. No such member is not considered an error. (ScriptNodeWritableDerived should always return true, but ScriptNodeWritableOriginal may return false.)

boolean = setNodeName(name) Set the name of the node.