Acquia Journey data structure

Acquia Journey uses an internal data store during graph execution. This data store is used to keep track of all activities in the graph and holds data that is necessary for the processing. Every node has at least one input or output location that refers to the data store. The data in Acquia Journey falls into one of three distinct types:

  • Data Schema - A JavaScript object that lasts for the execution of a single graph - can be read from and written to from any node in the graph.
  • Literal - A constant value which is used as an input to a node or the return value from a Return Node.
  • Public Variable - A JavaScript object that exists outside of the schema. A public variable can be read from and written to from any node in the graph. Public variables have two modes: transactional and persistent. Persistent public variables last throughout the deployment of a graph and across all listen events.

When building a graph and choosing data locations for input and output to nodes the three options for choosing data are shown in the top right panel of the window. This panel can be rotated between the three views of Data Schema, Literals and Public Variables by using the navigation buttons Navigation arrows in the right-hand side of the screen.

Data schema

The Data Schema can be thought of as a single JavaScript Object. The object can contain fields and other objects. It is represented as a hierarchical layout. Elements containing child elements can be opened and folded using the plus and minus buttons next to an item; elements without children will display > to the left of the element name.

Graphs can read and write individual fields or whole records from the schema during execution. It is not necessary to declare fields in the schema prior to graph execution, but it is necessary if they are to be chosen as an input or output location for a node.

Adding a single field to the schema

To add a field to the schema, perform the following actions:

  1. In the right-hand side of the page, click the navigation icons Navigation arrows until Data Schema is displayed.
  2. Click the plus sign:

    Add schema field

  3. The Add Field dialogue will be displayed. Give the new field a name.
  4. Click Save.

Adding a child record to the schema

To add a child record to an existing record, perform the following actions:

  1. In the right-hand side of the page, click the navigation icons Navigation arrows until Data Schema is displayed.
  2. Click the record you want to add a child to.
  3. In the Data Schema icon list, click the Add Child Record to Entities Add Child Record icon.
  4. In the Add Child Record window that appears, paste in any valid JavaScript Object Notation (JSON) record definition. Actual values are not necessary and can be blank but not missing.
  5. Click Save.

Editing the schema

To rename a field in the Data Schema window, click the item to select it, click the Pencil icon, changing the name, and clicking Save.

To delete a record or field from the Data Schema window, click the item to select it, and click the Trashcan button.

Literal values

Literal values are any valid JavaScript object. This includes simple literal values such as strings, numeric values or more complex JavaScript objects. Examples include:

  • Values
    • String - Hello World
    • Numeric - 3, 4.5
  • Objects - { "car" : { "make" : "Ford", "model" : "Mondeo", "engine" : "diesel" } }

Public variables

Public variables can hold any valid JavaScript object. Public variables are usually used to hold data that is necessary but not related to the entity being processed. This may be a temporary value or an access key for example. If the data should be part of the transaction and discarded at the end of the graph execution then it is better expressed as part of the schema. Public variables can be initialized with values unlike schema elements.

Creating a public variable

Public variables have a scope which can be persistent or transactional. Persistent variables exist across all executions of a graph, including all of the executions of a graph from a listener. Transactional variables are reset on each graph execution.

Public variables can have an initial value. This can be empty, which is the default, or it can be initialized with any valid JSON value. For example, a public variable could be initialized with an array value, an object or a base value.

To create a public variable, perform the following actions:

  1. In the right-hand side of the page, click the navigation icons Navigation arrows until Public Variables is displayed.
  2. Click the plus sign

    Add schema field to display the Add Public Variables window:
    Add Variables screen

  3. Provide a name for the variable.
  4. Click to select whether the variable is Persistent or Transactional.
  5. If you want to specify a default value, click Specify and provide a value in the Initial Value field.
  6. Click Save.

Contact supportStill need assistance? Contact Acquia Support