Create Data Table

From PresenceWiki
Revision as of 10:37, 23 August 2010 by Mattpryor (Talk | contribs)

Jump to: navigation, search

Create Data Table

The Create Data Table Node allows you to prime the Presence Context with a Data Table consisting of custom data. This can be useful for testing or just when you wish to include a table of static data.

To include a Create Data Table node in your Task drag the "Create Data Table" item into your Task from the Data Access Task Elements List. You will then see the following input dialog:

The first panel allows you to specify the column names and data types in the new Data Table. The four buttons beneath the list perform the following functions:

  • Add Column
  • Move Column Up
  • Move Column Down
  • Remove Column

When you are happy with the column names, click the "Rows" Tab to create rows for your Data Table:

The four buttons provided are similar in function to those in the Columns tab:

  • Add Row
  • Move Row(s) Up
  • Move Row(s) Down
  • Remove Row(s)

After inserting a new row, double-click inside a cell to edit the cell value. Values can be literal (e.g. "Fred" or "15") or they can be dynamic (e.g. ":var{SURNAME}" or "&random{}" ). If references are made to other columns those columns must appear in the incoming Data Table and will be used as a merge hint.

Type Checking

At runtime values will be converted to the type specified in the column. If the conversion is not possible (for example the column is set up to contain Integers but a non-integer value is found) an error will be thrown.

Merge Strategy

If a Data Table already exists on the Presence Context it will be cross-merged with the new custom Data Table. Each row of the incoming Table will be matched with each row of the new Data Table and new columns will be appended on the right. The following diagram illustrates this: