Activity
An OpenSpirit Update Activity creates and executes a query to update
data via an OpenSpirit Data Connection.
OpenSpirit Update Configuration Fields
Field | Global Var? | Optional? | Description |
Name | No | No | User assigned name given to query activity |
Description | No | Yes | User assigned description (optional) |
OpenSpirit Data Connection | No | No | A shared resource that defines a project or data source. See OpenSpirit Data Connection. |
SQL Query | No | No | The SQL UPDATE query that defines which columns to update. The SQL is constructed using the OpenSpirit Update Query builder. |
Model | No | Read Only | Displays the data model used in the SQL query. The model is specified in the OpenSpirit Update Query builder. |
The input for the activity is the following.
Input Item | Datatype | Description |
QueryParameters | Complex | Contains the list of prepared parameters and the values of the attributes to be inserted in the SQL statement. Prepared parameters allow you to substitute process data for items in the SQL statement. The types and names of the prepared parameters are based on the SQL query. |
The output for the activity is the following.
Output Item | Datatype | Description |
OspOutput |
Complex | The root class for the output of the OpenSpirit Update activity. This class contains all output items for the activity. |
NumRowsUpdated | Integer | The number of rows updated by this query. |
QueryParameters |
Complex | The input QueryParameters are echoed here so that subsequent activities may use the supplied values. |
The Error Output tab lists the possible exceptions that can be thrown by this activity.
Exception | Thrown When ... |
OspException |
The query could not be successfully executed. The msg element should contain some indication of the reason. |
OpenSpirit Update Query Builder
The UPDATE query builder allows you to construct a SQL query statement without having to type any SQL. Follow the steps illustrated below:
1. Select the data model you wish to use. All OpenSpirit data connectors expose the OpenSpirit common data model and many also expose the native model of the underlying data store. If you chose a native model make sure it matches the data source type
2. Select which table you wish to insert into. Note that display names are used in the combo box. The actual table name will appear in the constructed SQL query.
3. Select which columns,
or attributes, you wish to update. The icon
may be used to display the description, if available, for each column.
Note that display names are used in the listing of attributes. The
actual attribute name will appear in the constructed SQL query. An
input parameter will be constructed for every selected attribute with
the same name and type as the selected attribute.
4. Click on the Query Constraint tab to specify constraints to define which rows should be updated.
5. In the Query Constraint tab you may add constraints on selected attributes by clicking on the add button next to the desired attribute.
6. Then select the desired operator and enter a constraint value. If you wish to set the constraint value at run time then type a "?" in the value field and an input parameter will be generated. The input parameter name will be the name of the attribute and its xml element type will be based on the attribute data type.
7. As you are adding query constraints you may see the updated SQL by clicking on the Update SQL button.
Note that for some data stores (e.g. Kingdom and Petra) , after data is updated, it will not be visible in the native application that is connecting to the same project unless the application refreshes its connection or is restarted. This is due to caching done in the vendor's API.