Acquia Journey data structure

Acquia Journey maintains an internal data store during graph execution. Every graph node has at least one input or output location that refers to a data store property. As the graph executes, each node may alter the data store. The data in Acquia Journey falls into one of following distinct types:

  • Data Schema - A JavaScript object that lasts for the execution of a single graph. It can be read from and altered by any node within 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 graph listener events.

When building a graph and choosing the data location for a node, the three options for choosing data are shown in the top right panel of the window. This panel can be toggled through the Data Schema, Literals and Public Variables views by using the navigation buttons Navigation arrows on the right-hand side of the screen.

Data schema

The Data Schema is a single JavaScript object that can contain fields and other objects in a hierarchical layout. Elements containing child elements can be displayed and hidden 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. Expand the Data Schema and click the field you want to add a child field to.
  3. Click the plus sign:

    Add schema field

  4. The Add Field dialogue will be displayed. Enter a name for the new field.
  5. 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 dialog that appears, paste in any valid JavaScript Object Notation (JSON) record definition. Each property in the JSON record will become a field. Any other values are ignored.
  5. Click Save.

Renaming a field in the schema

To rename a field in the Data Schema, complete the following steps:

  1. In the right-hand side of the page, click the navigation icons Navigation arrows until Data Schema is displayed.
  2. Click the field you want to edit.
  3. Click the Pencil icon.
  4. In the Edit Field dialog, enter the new field name.
  5. Click Save.

Deleting a field or record from the schema

To delete a field (and all of its children) from the Data Schema, complete the following steps:

  1. In the right-hand side of the page, click the navigation icons Navigation arrows until Data Schema is displayed.
  2. Click the field you want to delete.
  3. Click the Trashcan icon.

Literal values

A Literal value is any valid JavaScript ES5 (ECMAScript 5) primitive or object. Examples include:

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

Assigning a literal value

In Acquia Journey, a literal value may be assigned directly to a graph node. To assign or edit a literal value for a node, complete the following steps:

  1. Click the node in your graph you want to associate with a literal value.
  2. In the right-hand side of the page, click the navigation icons Navigation arrows until Literals is displayed.
  3. In the Literals text field, enter a literal value.
  4. In the Edit panel for the node, click the left arrow left arrow icon to associate your literal value with the node. An example of a Set Node with an object literal associated with is shown in the following example:
    Set Node

Public variables

Public variables are used to hold data that is necessary, but not related to, the entity being processed. Public variables can hold any valid JavaScript object or primitive value, such as a temporary value or an access key. If the data should be part of the transaction and discarded at the end of the graph execution, then it should be included with the schema, instead of a public variable. 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, while transactional variables are reset on each graph execution.

Public variables are empty by default, but they can have any valid JavaScript Object Notation (JSON) or primitive as an initial value. For example, a public variable could be initialized with the number 120, the string journey, or the JSON literal {"count":90, "label":"How many?"}.

To create a public variable, perform the following actions:

  1. In the right-hand side of the page, click the navigation Navigation arrows icons until Public Variables is displayed.
  2. Click the Plus sign to display the Add Public Variables dialog:
    Add Variables screen
  3. Enter 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.

Editing a public variable

To edit a public variable, complete the following steps:

  1. In the right-hand side of the page, click the navigation icons Navigation arrows until Public Variables is displayed.
  2. Click the pencil icon to display the Edit Public Variables dialog.
  3. Make any necessary changes.
  4. Click Save.

Deleting a public variable

To delete a public variable, complete the following steps:

  1. In the right-hand side of the page, click the navigation icons Navigation arrows until Public Variables is displayed.
  2. Click the trash can icon to delete the highlighted public variable name. You cannot undo this action.

Contact supportStill need assistance? Contact Acquia Support