Declaring variables for the Start node

The Start node is where you "declare," or specify, variables that will be used in the process. These are variables that you create and can be used to do whatever you want them to do. When the variables have been declared on the Start node, they are available for other nodes to access in the process.

When you click the Add button on the Start node, a blank dialog box opens up for you to populate the following fields:

  • Variable name: You can name your variable anything you want it to be. It's a good idea to use a name that will make it easy to know the data that the variable represents. For example, if you are creating a variable to represent a salary, you might want to name it "Salary."

  • Variable type: This is the type of data (numeric, alphanumeric, and so on) that the variable represents. Options are:

    Variable type Definition
    Array

    Use this type of variable for data that has multiple values.

    Example:

    strArray["a", "b", "c"]

    Note: 

    The array variable type accepts data types other than string but, because the data is stored in the database as a string, it is a good idea to use array variables for string data only.

    Retrieve array values from other nodes by specifying the array index: alpha[0].

    Usage note: Using arrays with WorkObject nodes

    Array variables that are passed to a process through a WorkObject node will be treated as strings even if an integer array is specified. For example, if the WorkObject node defined an array intArray=[1,2,3], the receiving process treats it as a string array. Therefore, an operation like intArray[0] + intArray[1] will result in 12 (not the value "3") because of string concatenation.

    A way to get around this when working with arrays which receive data from WorkObject nodes is to use the JavaScript parseInt() operation. Use the parseInt operation in the process that uses the variable passed in by the WorkObject.

    For example, this expression...

    parseInt(intArray[0]) + parseInt(intArray[1])

    ...gets the expected value of "3".

    Boolean

    True or false type.

    Default = true

    Date

    Whole number.

    Default: Current date via the function today()

    Double

    Decimal number, such as, 12.6

    Default=0.0

    Integer

    Whole number.

    Default=0

    Note: 

    The system will interpret integer values with leading zeros as belonging to an alternate numeral system. For example, an integer value of 0x10 would be interpreted as base 16 (hexadecimal), and an integer value of 010 would be interpreted as base 8 (octal). If you do not wish for your value to be interpreted in this way, use the "String" data type instead.

    Long

    A large integer

    Default=0

    String

    Alphanumeric data (letters and numbers that are not used for calculations).

    Default=blank

    XML

    XML variables can be used to assign an XML document to a variable. You can then use E4X expressions to retrieve node values.

    Following is a simple assignment example:

    <employees>
      <person>
        <firstname>John</firstname>
        <lastname>Doe</lastname>
        <salary>65000</salary>
      </person>
    </employees>
    

    Following is an example of a simple E4X expression to retrieve John Doe's salary.

    employees.person.(lastname == "Doe").salary

    This expression returns a list which can be assigned to an array variable by using the following expression:

    new Array(employees.person.(lastname == "Doe").salary)

    Usage notes: Using XML variables with WorkObject nodes

    • WorkObject nodes have a 512 character limitation. This means that an XML variable passed to a WorkObject cannot be larger than 512 characters.

    • This document does not provide information about using E4X.

  • The Name and Value fields are for building the condition. Specify the information and then click the Add Name or Add Value fields to move the information into the Variable Expression work space.

  • You can select a function from the drop-down list. This is for evaluating the expression. For a list of the available functions, see JavaScript functions.

  • If you make a mistake when creating your expression and want to start over, use the Clear button to remove all text and symbols from the expression workspace.

After you create the expression, you can view it from the Properties dialog box of the node where you added the expression.

If you need to edit the expression, double-click it to open the Variable Expression Builder.