Variables and Types

Variables and Types are important concepts in Design Studio.

Every variable can be associated with a default initial value that it retains unless the robot explicitly reassigns it, which it often will as values are extracted and manipulated during the execution. Most robots output the values of variables, by returning them to the caller or inserting them in a database. Robots can also take input values which are assigned to specific variables marked as receiving their values from input. These are called input variables.

You define each variable as either complex or simple.

Simple Variable

A simple variable does not define any attributes, but only represents the type of a single value. Thus, a variable of a simple type contains a single value, for example a text string, and is referred to only by its variable name, such as Username. Simple types are built-in and cannot be edited, or created.

  • Useful when extracting temporary data or as global counters.

  • Commonly used as temporary variables, internal to the robot.

  • You cannot use a simple type for input variables.

  • You cannot output the value of a simple type.

Complex Variable

A complex variable defines a set of attributes. Each complex variable denotes several (named) values. We generally refer to each attribute such as "title" as a separate variable such as "Book" and denote its value using the fully qualified attribute name, such as Book.title. You can create complex types within Design Studio to suit your needs.

Complex variable values are output in various ways. For example, a robot extracting news from a web site might output the values of news variables; each news variable would have a complex type with attributes such as headline, bodyText, date, and author; and each news value to output would comprise a possibly unique subvalue for each named attribute.

For robots containing input variables, they must be specified as part of the robot's input with values assigned to the input variables. For example, a shopping robot that orders books at http://amazon.com might depend on input values containing user and book information. These might be assigned to two input variables in the robot called "user" and "bookInfo" of type "User" and "BookInfo." The following figure shows how a robot accepts input values and generates output values.


Robot Input and Output Values

The figure shows robot input-output. Input values are assigned to input variables, and the values of some variables are output. Only variables of complex types can be assigned from input or have their values output.