Difference between revisions of "Presence Context"

From PresenceWiki
Jump to: navigation, search
(Local and Task Variables)
(The Presence Context)
Line 1: Line 1:
==The Presence Context==
==The Presence Context==

Latest revision as of 06:36, 20 August 2015

The Presence Context

Presence context.png

What is the Presence Context?

The Presence Context is a container which is retained in memory and is passed from node to node during a Task execution. It contains information such as:

  • The current Data Table
  • Local Variables
  • Internal information about the current task and the container that it is running in

Data Table

In Presence, data is stored in a virtual table consisting of rows and columns. This is populated by querying databases, XML documents, Web Services, mail accounts etc, or via the Create Data Table Node. Only one Data Table exists at any time. Joining queries together causes the Data Table to be appended with new results. A full list of Task Elements that populate the Data Table can be found in the Data Access Task Elements section.

Local and Task Variables

This is a collection of name / value pairs. See the section on Variables for a more detailed explanation. Please note that until a Global Variable is committed (when a Task completes successfully) it is treated as a Task Variable within the Presence Context.

Compound Variables

If you were to define a compound variable it may look something like this when being defined:

${:var{Column1}endPart} = ${ Column 1 Data from all rows Appended with the Word EndPart}

If there were 2 rows of data, one containing the character 'A' and one containing 'B' then we would have two Presence Variables called



These can be referenced during the task. When you refer to a Dynamic variable name in a task, Presence will automatically iterate over all of the column values for you.

The context will automatically parse and convert the following sequences:

[cr] - insert a carriage return

[lf] - insert a line-feed

[ff] - insert a form-feed

Unicode sequences - any Unicode sequence can be added using the standard notation \uxxxx (replace the x's with a valid sequence). For more information on Unicode see http://www.unicode.org/ Ctrl+M Show up the character map to insert unicode.

Saving and Loading

The Presence Context can be saved as an XML document mid-Task. This can be helpful for debugging your Tasks, or when obtaining support from International Presence. Please see Context XML Nodes for further information.