Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this

...

article, you will learn how to Add a Data Query Object and Call a Data Query Object from within an Expression.

...

Examples for specific data query objects including DB Request, DB Request (SQL) and Run Panel are provided.

Anchor
add_data_query_object
add_data_query_object
Add a Data Query Object to the Worksheet

First, choose an object in the toolbox under the Data Query Lib section.

...

In this example, a Code Category lookup is used.
Next, drag the object from the Data Query Lib toolbox onto your worksheet.

...

On this page

Table of Contents
minLevel1
maxLevel2
outlinefalse
styledisc
typelist
printablefalse

Data Query Lib toolboxImage Added
Then, connect the input and output nodes you will be using.
The Data Query object can be used in mapping like any other data lookup object group.

...

Data Query Object in worksheetImage Added

Anchor
call_data_query_object
call_data_query_object
Call a Data Query Object within an Expression

Items that have default output parameters defined can be used without adding them onto the worksheet. They can be called via expressions in the format:

...

Code Block
dataquery_name( arg1, arg2,  )

The arguments of this expression will be delivered as input parameters to the Data Query object specified.
To call a Data Query Object within an expression, start by editing a destination expression. You can choose a library item to be called from the autocomplete dropdown:

Data Query Object within an expressionImage Added
Alternatively, you can also drag and drop a Data Query item directly into the expression:

Data Query Object within an expressionImage Added
Next, set the input parameters:

...

Data Query Object within an expressionImage Added

Anchor
examples_dataquery
examples_dataquery
Examples

Below are some more examples of particular types of Data Query Objects. 

Anchor
dbrequestexample
dbrequestexample
DB Request

The DB Request element allows to use a DB procedure within your solution.
After dragging and dropping the DB Request element to your working area, please click "Settings" (the gear icon in the bottom-left corner)

...

:

Settings icon in worksheetImage Added
The following dialog window can help you to choose the appropriate DB procedure and decide whether to let IWS do auto-mapping or not.

Object Settings windowImage Added
Click

...

OK

...

.
If you want to change input parameters manually, set them in the "Properties" window at the right.

Properties windowImage Added
You can give a Name to your DB Request element. It is used to construct the result status variable names. If the Name is not empty, the name_STATUS_CODEname_CHANNEL_STATUS_CODE, and

name_STATUS_MESSAGE variables are created, and can be used in other expressions. See the following table for more details:

Variable

Possible Values and their Description

name_STATUS_CODE

0 (Success)
-1 (Connection/initialization error)
-2 (Send error)
-3 (Receive timeout)
-4 (Reply read error)

name_CHANNEL_STATUS_CODE

If name_STATUS_CODE is not 0, this variable will contain a channel specific status code.

name_STATUS_MESSAGE

Contains the status message

...

.

Anchor
dbrequestsqlexample
dbrequestsqlexample
DB Request (SQL)

The DB Request (SQL) element allows to use a SQL statement in the rule to interact with the database. After drag-and-dropping the DB Request element to the work area, please click "Settings":

Example of DB Request (SQL)Image Added
The dialog window helps to specify additional parameters for the SQL statement:

Object SettingsImage Added
Then enter the SQL query in the "Expression" cell:

Expression cellImage Added
The DB Request (SQL) element can have a Name. It is used to construct the result status variable names. If this attribute is not empty, the name_STATUS_CODEname_CHANNEL_STATUS_CODE, and

name_STATUS_MESSAGE variables are created, and can be used in other expressions. 

Variable

Possible Values and their Description

name_STATUS_CODE

0 (Success)
-1 (Connection/initialization error)
-2 (Send error)
-3 (Receive timeout)
-4 (Reply read error)

name_CHANNEL_STATUS_CODE

If name_STATUS_CODE is not 0, this variable will contain a channel specific status code.

name_STATUS_MESSAGE

Contains the status message.

The "Properties" window to the right allows to specify the parameters of the DB Request (SQL) element manually.

...

Anchor
runpanelexample
runpanelexample
Run Panel

The Run Panel element allows to execute a panel and retrieve the data received from the STAR engine.
After drag-and-dropping Run Panel to the work area, click "Settings" button in the bottom-left corner to select a panel:

Run panel work areaImage Added
The following dialog window will open. You can either scroll to the required panel or use quick search:

Object Settings windowImage Added
Once the panel is chosen, click OK.

...

IWS will automatically fill in several fields:

Status Message fieldImage Added
You can give the Run Panel element a specific Name. The Name is used to refer to the Run Panel element and to check execution results. If this attribute is not empty, the Name_STATUSName_STATUS_MESSAGE, and Name_PANEL_STATUS variables are created and can be used in other expressions.

Variable

Possible Values and their Description

Name_PANEL_STATUS

0 – The panel was not executed. For example,
the Run Panel condition did not evaluate to TRUE.
1 – Success with data.
2 – Success with no data.
-1 – Error.

Name_STATUS_MESSAGE

Success.
Query returned no data.
Error.

Name_STATUS

1 – Success with data.
101 – Success with no data.
Other values – error.

The "Properties" window to the right allows to edit several parameters of the Run Panel element manually

...

:

Properties windowImage Added

Anchor
datalookup
datalookup
Data Lookup

The Data Lookup provides the ability to perform lookups.
After dragging and dropping it to the work area, you can select the required lookup:

Data Lookup windowImage Added
The following dialog window opens: 

Object Settings windowImage Added
You can either browse the file tree to find the needed lookup, or one can use Quick Search. IWS fills in several fields automatically, and you can fill in the input parameters manually, for example:

Example of Input parametersImage Added
The Data Lookup element can have name parameters. A name is used to refer to the Data Lookup element, later, to check the execution results.

If this attribute is not empty, the Name_STATUS, Name_STATUS_MESSAGE, Name_RESULT and Name_LOOKUP_STATUS variables are created and can be used in other expressions.

The below table lists the possible values and descriptions for the name parameters.

Variable

Possible values and descriptions

Name_LOOKUP_STATUS

0 – The panel was not executed. For example, the Data Lookup execution condition did not evaluate to TRUE.

1 – Success with data.

2 – Success with no data.

-1 – Error.

Name_STATUS_MESSAGE

Success.

Query returned no data.

Error.

Name_STATUS

1 – Success with data.

101 – Success with no data.

Other values – error.

Name_RESULT

The results of the lookup.