Global Variables View

The Global Variables view lets you specify and organize FreeMarker variables that are available to any Playbook Step. These variables to not have to be defined by the step, and changing the value of the variable in this view instantly changes it for any playbook that is using it.

The Global Variables view can be opened onto to any perspective with the Window→Show View menu item. Type into the filter at the top to narrow the list.

Related Info: Managing Views and Perspectives

  • Variables are stored in lists shown in the left column. Each list can have one or more variable/value combinations, and a description.
  • To create a new list, click the + button in the view toolbar and enter a name. Lists and list names are purely for organization and do not effect how they are used by playbooks.
  • To create a new variable, click in the left column of the table and enter the name of the variable. Follow the rules of FreeMarker names (i.e. don't use the hyphen or start with a number)
  • To create the value that the variable will be replaced with, click on the right column of the table and enter or paste your text. (FreeMarker syntax can also be used in a value, creating a nested variable.)
  • To use a variable name in a playbook, wrap it's name in the FreeMarker syntax of ${variablename}
  • To delete a variable/value combo, click the red X to the right of the item.
  • To delete an entire list, click the red X in the view toolbar.

(from FreeMarker Expressions)

Terminology: Package, Variable, Value

You'll see these words mentioned when we talk about making playbooks.

  • Package: A JSON-formatted file that DarkLight creates when an event enters the system. The package passes through the steps in one or more playbooks and contains all of the information from the originating event plus any variables and graphs the playbooks add. The playbook has a section for variables (the miscData) and a section for graphs. The primary graph in a package is named _default_.
  • Variable: The name given to something you want to refer to later. Variables are stored in the Package miscData. When content arrives to package from a Data Feed, it is put into a variable called rawInput by default. If a step asks for a variable, it does not need to use Freemarker syntax.
  • Value: The contents of a variable, regardless of how many individual items are in the variable. Values can be in the form of a single item, or as an array of elements in rows and columns. If a step asks for a Value, it must be written in FreeMarker syntax ${likeThis} ${orThis[0]} ${orSometimesThis[0][0] and will have the FreeMarker icon next to it.

About Variables and Values in DarkLight

Many steps save their results in an output variable. Common steps used to store values in variables are Step: Query Package, Step: Query Knowledge Base, and most of the steps in the Transform and Query categories.

Variables can be one of three types, and many of the steps will indicate which type they output:

Icon Output Type FreeMarker Version
Single Value (Scalar) ${examplevar}
List (One-Dimensional Array) ${examplevar[0]}
Table (Two-Dimensional Array) ${examplevar[0][0]
This SELECT query will output a Table variable, even if there is only one result. When referring to this variable later, you would use the form department[0][0]
  • help/global_variables
  • Last modified: 2019/07/16 18:48