Require Columns

From PresenceWiki
Jump to: navigation, search

Presence Tasks can be cascaded or nested from one to another. To make it easier to access data on the Presence Context between nested processes we can specify which columns are required or will be used from the parent task.

For example, suppose our parent Task contains an SQL Query which creates two data columns:



Later on in the Task we delegate to a Nested Task, which uses these columns to produce a report of some kind. When joining up the node that references the columns Presence will issue a warning:

Invalid column reference.png

This serves as a warning only - you can still link the nodes by clicking "Yes". However this should alert you to a possible flaw in your data flow logic. A Require Columns node earlier in the Task will prevent this warning.

Note that adding a required column only allows you to access the virtual column from the Presence Context without the column actually being created there by means of a query. It is not required in order for the Presence Server to correctly pass data between tasks at run time - that occurs automatically.

Drop a Require Column(s) node onto a task; the following dialog is displayed.

Require columns dialog.png

Click the New button (bottom left). The Enter Column Name(s) dialog appears. Enter the name of the column you wish to reference from your initiating process. You do not need to specify the :var{}, just the column name.

Specify the Data Type of the column. This again aids visibility in the Presence Context.

Because you are manually typing in the column name it is of course extremely important that your column name exactly matches the column in the initiating task. If you specify a column name that does not exist in the data, the column will be created anyway but with all NULL values.

Data Filter | Require Columns | Append Data Column | Multiple Column Appender

Drop Column | Drop Row(s) | Calculate Column Aggregate | Dataset Splitter | Merge Data

Create Data Table | Clear Data Table | Sort Data Table | Drop Duplicate Rows | Store Data Table | Retrieve Data Table

Task Elements > Data Table Nodes > Require Columns