Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

This object is being used to save one piece of data for later usagea value, which can later be accessed by another Shareable Value Object with the same name. It is not persistent between app or server restarts.

Info

The name of the object will be used to uniquely identify this 'Data ContainerShareable Value' within the app. For info on this behavior read this: Data Processing.

...

App Builder Object

...

Source Code

Code Block
languagejs
function execute() {
  const identifierVar = `${nodeName}-variable`;

  // Setup variable
  if (globalContext[identifierVar] === undefined) {
    globalContext[identifierVar] = {};
  }

  switch (trigger) {
    case 0:
      // Read
      if (globalContext[identifierVar].value !== undefined) {
        return [globalContext[identifierVar], new Date()];
      }
      break;
    case 1:
      // Set
      [, globalContext[identifierVar]] = inPorts;
      return [globalContext[identifierVar], new Date()];
    default: break;
  }
  return [];
}

...

In Ports

Position

Name

Message Type

Description

1

Trigger

Read

Trigger

This port is being used to trigger the

'Data Container'

“Shareable Value“. This means that the value

gets written and read at the same time

that is saved will be send through the value out port.

2

Value

Any

This port is being used to

receive

send the message including the value which is supposed to be saved inside the '

Data Container

Shareable Value'.

...

Out Ports

Position

Name

Message Type

Description

1

Value

Any

This port is being used to send out the stored value of the '

Data Container'.

2

Trigger

Trigger

This port is being used to send out a trigger message once the value has been send out of the 'Data Container

Shareable Value'.

...

Properties

Name

Description

Object Name

The name of the object on the canvas.

Show Code View

The switch to turn on code view for the Code Object.

Duplicate code into custom Code Object

Image Modified