Versions Compared

Key

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

...

Business logic configuration details are configured in the second panel, Interaction Configurations. Figure 4 illustrates the panel with expert properties Expert Properties view enabled.

Image RemovedImage Added
Figure 4: Business in Interaction panel logic configuration properties

Anchor
_Toc309031858
_Toc309031858
Attributes

...

This property will override the value provided for property Auto Commit (Y/N) in the MCF panel.

Pre Processing XSL Configuration

Pre Processing XSL configuration can be used to transform request message before processing it. Click the ellipses button against the property to configure the properties.

Refer to the Pre/Post Processing XSL Configuration section under the Common Configurations page for details regarding Pre Processing XSL configuration and Post Processing XSL configuration (below).

Post Processing XSL Configuration 

Post Processing XSL configuration can be used to transform the response message before sending it to the output port.

Process Message Based on Property

The property helps components to skip certain messages from processing.

Refer to the Process Message Based On a Property section under the Common Configurations page.

SQL Query type

This property determines SQL query type to be executed. The user can select one of the SQL query types from SELCET, UPDATE, INSERT and DELETE.
Explanation for types of queries is given in the following table:

Type of query

Explanation

INSERT

Inserts/adds data into database table

UPDATE

Modifies existing data in database table

DELETE

Deletes data from database table

SELECT

Retrieves data from database table

SQL Configuration

Click the SQL Configuration ellipsis button  button to launch the SQL Configuration wizard which allows configuring queries that have to be executed.

Table Selection Dialog

Configuring queries requires selecting database object Tables on which actions have to be taken. The Table Selection Dialog does the required thing. This panel is shown in Figure 5.

...

  1. Click Add button to launch Table Selection Dialog dialog box.
  2. Select required table as explained in Table Selection Dialog section. Selected table is added to the easel under Table. Primary key column, if exists, is marked with Image Modified adjacent to column the column name.
    Image Removed
    Image Added
    Figure 7: Selected table added to easel

  3. Table can be changed by clicking Image Removed replace selected table button the Replace button and removed by clicking Image Removed remove database table the Remove button.
  4. If values are never to be inserted into a particular column, then that column can be unchecked (this requires column has a default value or supports null values) as shown in Figure 8.
    Image Removed
    Image Added
    Figure 8: Ignoring column for insertion

  5. To insert a constant value for a particular column, specify the required value in the Column Value column against the required column name.

    Note
    • If the value is a string value it should be wrapped in single quotes (' ')
    • ? indicates value will be taken from input or from the output of another query where possible
  6. Click the SQL button (see Figure 7) to generate the Insert statement is automatically generated and shown get displayed in the text editor under SQL Statement editor in the SQL tabConfiguration panel. The generated SQL can be validated by pressing the Image Modified (check syntax) button.

    Note

    This feature only checks for invalid tokens, ; it does not perform a complete syntax check.

    EnableReconfiguration: Select the check box against this option to reconfigure the query, if it is not selected, then the Design tab (which is used to configure the query) will not be visible.
    Image Removed
    Image Added
    Figure 9: Generated insert query

  7. Once the query is configured, the user has to generate the input and output parameters by clicking the Generate ParametersParams button.
  8. If the query contains any value which should be taken from input XML, then the generated parameters are used to define the input and output port schemas.
  9. The Add and Delete buttons are used to add and delete particular parameters from the list. Delete All button is used to delete all the parameters from the list.
    Image Removed
    Image Added
    Figure 10: Generated Input/Output Parameters

    Each of the columns is explained below.

    Column Name

    Description

    BindName

    This value is used to generate the schema for the query. In the Figure 10 value for EMPLOYEE_ID (field name) is changed to EMPLOYEE_I. So the schema generated would contain EMPLOYEE_I as the first element instead of default populated value, EMPLOYEE_ID.

    Bind Position

    The position in the query where this value is bound to.

    Warning

    Do not change this value.

    Java TypeName

    JDBC type which maps to Data Type.

    SQL TypeName

    This defines the data type of this column in the database table. This should be correctly defined.

  10. Click Ok to close the dialog.
Insert Statement with select

Insert rows in the configured table by selecting rows from another table.

  1. Follow the steps from 1 to 4 as described in section Simple Insert Statement.
  2. Select the SELECT Query option against Insert values using as shown in Figure 11.
    Image Removed
    Image Added
    Figure 11: Option to insert values into a table using select query

  3. Click Wizard… Select Query Wizard button to launch Query Builder to specify the Select query.
  4. Follow the steps as described in section Select Statement Configuration.
  5. The select query is automatically generated and shown in the text editor under Insert values using in Design tab as shown in Figure 12.
    Image Removed
    Image Added
    Figure 12: Generated Select query which is used in Insert Query
  6. Insert statement is automatically generated and shown in the text editor under SQL Statement in SQL tab. The generated SQL can be validated by pressing (check syntax) button.
    Enable reconfiguration: Select the check box against this option to reconfigure the query, if the option is not selected then the Design tab (which is used to configure the query) will not be visible. When a query is reconfigured Generate Parameters button should be clicked to generate parameters for the modified query.
    Image Removed
    Image Added
    Figure 13: Generated Insert Query

  7. Follow the steps from 7 and 8 as described in section Simple Insert Statement to complete the query configuration.

...

Click ellipsis button next to SQL configuration property after selecting SQL Query Type as DELETE will launch the SQL Configuration Wizard which will useful be useful to configure Insert statement.
Image Removed
Image Added
Figure 14: Sql Configuration Dialog for Delete Query

Simple Delete Statement

Delete rows satisfying defined condition in configured table, with column values taken from input XML or with constant values.

  1. Click Image Removed add database table the Add button to launch Table Selection Dialog dialog box.
  2. Select required table as explained in Table Selection Dialog section. Selected table is added to the easel under Table
    Image Removed
    Image Added
    Figure 15: Selected table added to easel

  3. Table can be changed by clicking Image Removed replace selected table the Replace button and removed by clicking Image Removed remove database table the Remove button.
    Image Removed
    Figure 16: Adding condition on column to WHERE clause

  4. Specify condition which should be satisfied for deleting row under WHERE condition. Select a Click Add to add a new row and select a column name in the first column on which WHERE condition has to be applied.

    Image Added
    Figure 16: Adding condition on column to WHERE clause


  5. When selecting multiple columns for where condition, conditions can be combined using AND or OR under fourth column
    Image Removed
    Image Added
    Figure 17: Combining multiple conditions for WHERE clause

  6. Operator of choice can be chosen from the drop-down under second column.
    Image Removed
    Image Added
    Figure 18: Selecting operator for a condition

  7. To specify a constant value for WHERE condition on a column, specify the required value in the third column against the required column name in where tab.
    Image Removed
    Image Added
    Figure 19: Specifying constant value for a column in condition for WHERE clause

  8. To specify WHERE condition on a column whose value is equal to value defined in another column, select the required column from drop-down in the third column against the required column name in where tab
    Image Removed
    Image Added
    Figure 20: Specifying comparison between columns in condition for WHERE clause
  9. Insert statement is automatically generated and shown in the text editor under SQL Statement in SQL tab. The generated SQL can be validated by pressing Image Modified check syntax button.
    Enable reconfiguration: If this option is checked then the query can be re-configured, if the option is unchecked then the Design tab (which is used to configure the query) will not be visible.
    Image Removed
    Image Added
    Figure 21: Generated Delete Query

  10. Follow the steps from 7 and 8 as described in section Simple Insert Statement to complete the query configuration.
Update Statement Configuration

Image RemovedImage Added
Figure 22: SQL Configuration Dialog for Update Query

Click ellipsis button next to SQL configuration property after selecting SQL Query Type as UPDATE will launch the SQL Configuration Wizard which will useful to configure update statement.

Simple Update Statement

Update rows satisfying defined condition in configured table, with column values taken from input XML or with constant values. Condition values can also be taken from input XML or defined as constant values.

  1. Click add database table button to launch Table Selection Dialog dialog box.
  2. Select required table as explained in Table Selection Dialog section. Selected table is added to the easel under Table.
    Image Removed
    Image Added
    Figure 23: Selected table added to easel
  3. Table can be changed by clicking replace selected table button and removed by clicking remove database table button.
  4. Select the columns whose values have to be set. Figure 24 shows that NAME and AGE are selected for update
    Image Removed
    Image Added
    Figure 24: Selecting column for update

  5. These selected columns will automatically add get added under the SET tab as shown in Figure 25.
    Image Removed
    Image Added
    Figure 25: Columns added to SET clause

  6. Click WHERE tab and select a column name on which where condition has to be applied.
    Image Removed
    Image Added
    Figure 26: Adding condition on column to WHERE clause

  7. When selecting multiple columns forfor where condition, conditions can be combined using AND or OR under And/Or column.
    Image Removed
    Image Added
    Figure 27: Combining multiple conditions under where clause

  8. Operator of choice can be selected from the drop-down menu underOperator column.
    Image Removed
    Image Added
    Figure 28: Selecting operator for a condition

...

Note
  • If the value is a string value it should be wrapped in single quotes (' ')
  • ? indicates value will be taken from input or from the output of another query where possible.

 Image Added
Image Removed
Figure 29: Specifying constant value for a column in SET clause

...

Note

If the value is a string value it should be wrapped in single quotes (' ').

Image RemovedImage Added
Figure 30: Specifying constant value for a column in condition for WHERE clause

...

  1. To specify where condition on a column whose value is equal to value defined in another column, select the required column from the drop-down menu in the Column Value column against the required column name in WHERE tab.

Image RemovedImage Added
Figure 31: Specifying comparison between columns in condition for WHERE clause

Note
  • Select statement is automatically generated and shown in the text editor under SQL Statement. The generated SQL Syntax can be validated by clicking the SQL   button.

  • This feature only checks for invalid tokens, it does not perform a complete syntax check.

 

Enable reconfiguration: If the check box is selected the query can be re-configured, if the query is uncheck then the Design tab (which is used to configure the query) will not be visible. Image Removed

Image Added
Figure 32: Generated update query

Follow the steps from 7 and 8 as described in section Simple Insert Statement to complete the query configuration.

Anchor
_Select_Statement_Configuration%3A
_Select_Statement_Configuration%3A
Select Statement Configuration

...

Click ellipsis button next to SQL configuration property after selecting SQL Query Type as SELECT will launch the SQL Configuration Wizard which will useful to configure Insert statement.

Anchor
Simple Select Statement
Simple Select Statement
Simple Select Statement

Retrieves data from all columns or from selected columns in a configured database table.

  1. Click Image Removedadd database table the Add button to launch Table Selection Dialog dialog box.
  2. Select the required table as explained in the Table Selection Dialog section. Selected table is added to the easel under Table
    Image Removed
    Image Added
    Figure 33: Selected table added to easel
     
  • Table can be changed by clicking replace selected table button and removed by clicking remove database table button.
  • To retrieve specific columns values from the table, check required columns to build a select query with specific columns. If no column is checked, then *SELECT ** is used. Select the columns in order in which they should appear they should appear in select clause.
    Image Removed
    Image Added
    Figure 34: Selecting columns for selection
     
  • Selected columns are shown under Columns tab. Check/Uncheck the check box in Output column against required column name to show/not show the corresponding column in the output XML.

For example, configuration in the following image generates IDNO in the output XML, but does not generate NAME in output XML, though values for both IDNO and NAME are retrieved from the table.
Image Removed
Image Added
Figure 35: Selecting columns for output XML

  • To define a column alias, provide the alias name under Alias column against required column name. Aliases are useful when the column name is not intuitive or too long. When an alias is specified output XML will contain an element with defined alias name instead of the column name.

Image RemovedImage Added
Figure 36: Defining Column Alias

  • To return unique rows check DISTINCT.

Image RemovedImage Added
Figure 37: Distinct option to return unique values

Note
  • Select statement is automatically generated and shown in the text editor under SQL Statement. The generated SQL Syntax can be validated by clicking the SQL   button.

  • This feature only checks for invalid tokens, it does not perform a complete syntax check.

 

Enable reconfiguration:

Select the check box checkbox against this option to reconfigure the query, if this option is not checked then the Design tab (which is used to configure the query) will not be visible.

Image RemovedImage Added
Figure 38: Generated Select Query

  1. Once this query is configured, generate the input and output parameters by clicking the Generate Parameters button. These generated parameters are used to define the input and output port schema.
  2. If the query contains any value which should be taken from input XML then the generated parameters are used to define the input and output port schemas.
  3. Add and Delete buttons are used to add and delete particular parameters from the list. Delete All button used to delete all the parameters from the list. The Output parameter list contains only those columns for which the Output column is checked under Columns tab.

Image RemovedImage Added
Figure 39: Generated Input/Output Parameters

...

Click Ok to close the dialog.

Select Statement with Filter:

Retrieves data from all columns or from selected columns in a configured database table after applying specified conditions. Condition values can be provided from input XML or as constant values.

  1. Follow the steps from 1 to 7 as described in the section Simple Select Statement.
  2. ClickWHERE tab and select a Column name on which WHERE condition has to be applied.
    Image Removed
    Image Added
    Figure 40: Adding condition on column to WHERE clause
     
  3. When selecting multiple columns for WHERE condition, conditions can be combined using AND or OR under And/Or column.
    Image Removed
    Image Added
    Figure 41: Adding condition on column to WHERE clause
     
  4. Operator of choice can be selected from the drop-down list under Operator column.
    Image Removed
    Image Added
    Figure 42: Selecting an operator for a condition
  • Constant values can also be set for values in WHERE condition (under WHERE tab).
    • To specify a constant value for WHERE condition on a column, specify the required value in the Column Value column against the required column name in WHERE tab.

      Note
      • If the value is a string value it should be wrapped in single quotes (' ').
      • ? indicates value will be taken from input or from the output of another query where possible.

      Image RemovedImage Added
      Figure 43: Specifying constant value for a column in SET clause

    • To specify WHERE condition on a Column whose value is equal to value defined in another Column, select the required Column from drop-down list in the Column Value against the required column name in WHERE tab.
      Image Removed
      Image Added
      Figure 44: Specifying comparison between columns in condition for WHERE

 

Select Statement with Sorting:

Retrieves sorted data from all columns or from selected columns in a configured database table. Data is sorted in configured order on columns configured for sorting.

  1. Follow steps 1 to 7 in the section Simple Select Statement.
  2. To specify columns which have to be sorted, select the appropriate sort order from drop-down list under Order By column in Columns tab. Order By for each columns has one of the following values:

 

  1. Order By Value

    Explanation

    Unsorted

    Data is not sorted on values in the column, that is, no order by clause

...

  1. willaddedin the SQL statement.

    Ascending

    Data is sorted in ascending order on values in the column, that is, order by clause will be added in the SQL statement as ORDER BY <column name> ASC.

    Descending

    Data is sorted in descending order on values in the column, that is, order by clause will be added in the SQL statement as ORDER BY <column name> DESC.

    Default

    Data is sorted in default order for order by clause on values in the column, that is, order by clause will be added in the SQL statement as ORDER BY <column name>.

...


  1. Image Added
    Figure 45: Selecting sorting order for column

  2. When multiple columns have to be sorted, sorting priority for each column can be set under Sort Priority. Columns are sorted in order of increasing Sort Priority that is column with minimum value for Sort Priority is order first.

...


  1. Image Added
    Figure 46: SQL Statement with different columns sorted in different order

    Tip

    When values of Sort Priority for multiple columns are same, columns are sorted in the order in which they appear in select clause.

  2. Follow the steps from 8 to 10 as described in the section Simple Select Statement.

 

Select Statement with Grouping:

Retrieves data, after applying grouping conditions, from all columns or from selected columns in a configured database table.

...

  1. Follow steps 1 to 7 in the section Simple Select Statement.
  2. Click GROUP BY tab and check under Select against the columns under Group By on which group by condition should be applied.

...


  1. Image Added
    Figure 47: Selecting columns for grouping condition

  2. To filter the results click HAVING tab and define required conditions. HAVING tab has functionality similar to WHERE tab (described in Select Statement with filter).

...


  1. Image Added
    Figure 48: Adding condition to HAVING clause

  2. Select required columns under Tables.

...

  1. Image Added
    Figure 49: Selecting required columns

  2. Now generate the input and output parameters as described in step 9 in section Simple Select Statement.
  3. Edit the Select statement is which was shown in the text editor under SQL Statement in SQL tab.

    Note

    Editing Select and HAVING clauses should be last action before closing the dialog.

...

  1. Image Added
    Figure 50: Generated SQL Select Query

  2. Click the Ok button to close the dialog box.
Select Statement with Multiple Tables

Retrieves data from all columns or from selected columns from multiple configured database tables. Currently retrieving data from more than one table is not supported.

Date Time Format

Date time format to be used when any of the input parameters represent Date/Time-Stamp data types.

Note

If this value is empty, then mm/dd/yyyy will be used as the default format.

Single Batch Mode

This option determines whether the component should send entire result send entire result of a query as a single message or as multiple messages.

...

Complete result of the query from input request is sent out as a single message. If the result set returned is huge then the component can run into memory problems and stop. When this value is selected, property property Batch Size is  is hidden.

  • no

Result of query from input is Result of query from input is split and sent out as multiple messages. Number of rows from result to from result to be included in each output message is determined by property property Batch Size. When this value is selected, property property Batch Size is  is shown.
Example: If  If a query returns 100 rows, and the batch size is set to 10 then 10 outputs will be generated each contains 10 rows.

Batch Size

This property is visible when the value of property property Single Batch Mode is set as yes is disabled. The property determines the number of units of result an output message contains.

Each row in a result set (typically result of a select query) or an update result (result of updateresult of update, delete, insert operations) is treated as unit of resultas unit of result.

Example:

Consider a stored procedure that returns a result of select query of select query followed by three update queries and another select query. Assume first select return 18 rows and second query returns 11 rows. If If Single Batch Mode is  is set as no and and Batch Size is  is set as 10 then there will be four output messages.

  1. first message: first ten rows from first query
  2. second message: remaining 8 rows from first query from the first query and two update query resultsquery results
  3. third message: third update query result and first nine rows of second select query
  4. fourth message: remaining two rows from second query.from the second query.

Validate Input

If this property is enabled, it validates the input request with the input port XSD.

Refer to the Validate Input section under the Common Configurations page.

Cleanup resources (excluding connection) after each document

This closes all the resources except for the connection used by the microservice after every request. If the less processing time is more important the less memory usage, then it is recommended to disable this property and vice versa.

For more details, refer to the respective section under in the Common Configurations page.

Target Namespace

Refer to the Target Namespace section under the Common Configurations page.

Monitoring Configuration

Please refer to the Monitoring Configuration section in Common Configurations page.

Elements to Decrypt

Select elements to decrypt in the Input Message.

Refer to the Encrypt Decrypt Configuration section in the Common Configurations page for details.

Elements to Encrypt

Select elements to encrypt in the Output Message.

Refer to the Encrypt Decrypt Configuration section in the Common Configurations page for details.

Anchor
_Toc235005835
_Toc235005835
Anchor
_Toc239744631
_Toc239744631
Anchor
_Toc309031860
_Toc309031860
Input

The input of the component varies with the kind of query configuration. If the query has input parameters which have to be provided dynamically, these parameters will be included in the input schema of the component if Generate Parameters button is clicked after configuring SQL.

Anchor
_Toc235005836
_Toc235005836
Anchor
_Toc239744632
_Toc239744632
Anchor
_Toc309031861
_Toc309031861
SELECT

In case of select query, the input parameters that have to be provided will be added as child elements to the SELECT element. When the query is as shown in Sample Query 1, the input schema will contain the parameters which have to be provided for the query as shown in the Figure 51.


Sample Query 1, Select with Where and Having clauses

Figure 51: Input schema – Sample Query 1

Anchor
_Toc235005837
_Toc235005837
Anchor
_Toc239744633
_Toc239744633
Anchor
_Toc309031862
_Toc309031862
INSERT

In case of insert query, the input parameters that have to be provided will be added as child elements to the INSERT element present in the input port schema of the component. The input schema corresponding to Sample Query 2 is as shown in the Figure 53.

Figure 52: Sample Query Simple Insert

Figure 53: Input Schema – Sample Query 2

Anchor
_Toc235005838
_Toc235005838
Anchor
_Toc239744634
_Toc239744634
Anchor
_Toc309031863
_Toc309031863
UPDATE

In case of update query, the input parameters that have to be provided will be added as child elements to the UPDATE element present in the input port schema of the component. The input schema corresponding to Sample Query 3 is as shown in the Figure 55.

...


Figure 55: Input Schema – Sample Query 3

Anchor
_Toc235005839
_Toc235005839
Anchor
_Toc239744635
_Toc239744635
Anchor
_Toc309031864
_Toc309031864
DELETE

In case of update query, the input parameters that have to be provided will be added as child elements to the DELETE element present in the input port schema of the component. The input schema corresponding to Sample Query 4 is as shown in the Figure 57.

...


Figure 58: Input schema with ConnectionFactorySettings

Anchor
_Toc235005840
_Toc235005840
Anchor
_Toc239744636
_Toc239744636
Anchor
_Toc309031865
_Toc309031865
Output

The output schema is auto generated based on the configuration provided. An element Result will be used to represent the result of the query configured. In case of SELECT query, an element Row with zero-many cardinality will be added to this element. Each Row element represents a single entry in the result set obtained. If Generate Parameters button is clicked after configuring SQL different elements corresponding to columns in the result set will be added as child elements to the row elements. The sample output for the Sample Query 1 is as shown in Figure 58.

Figure 58: Output Schema – Sample Query 1
In case of UPDATE, DELETE, INSERT statements an element UpdateCount will be added as child to the Result element which holds the number of rows updated as a result of execution of the query. The output schema for queries 2, 3 and 4 is as shown in Figure 59.

Figure 59: Output Schema – Sample Queries 2,3,4

Date Time Format

Date time format to be used when any of the input parameters represent Date/Time-Stamp data types.

Note

If this value is empty, then mm/dd/yyyy will be used as the default format.

Single Batch Mode

This option determines whether the component should send entire result of a query as a single message or as multiple messages.

  • yes

Complete result of the query from input request is sent out as a single message. If the result set returned is huge then the component can run into memory problems and stop. When this value is selected, property Batch Size is hidden.

  • no

Result of query from input is split and sent out as multiple messages. Number of rows from result to be included in each output message is determined by property Batch Size. When this value is selected, property Batch Size is shown.
Example: If a query returns 100 rows, and the batch size is set to 10 then 10 outputs will be generated each contains 10 rows.

Batch Size

This property is visible when the value of property Single Batch Mode is disabled. The property determines the number of units of result an output message contains.

Each row in a result set (typically result of a select query) or an update result (result of update, delete, insert operations) is treated as unit of result.

Example:

Consider a stored procedure that returns a result of select query followed by three update queries and another select query. Assume first select return 18 rows and second query returns 11 rows. If Single Batch Mode is set as no and Batch Size is set as 10 then there will be four output messages.

  1. first message: first ten rows from first query
  2. second message: remaining 8 rows from the first query and two update query results
  3. third message: third update query result and first nine rows of second select query
  4. fourth message: remaining two rows from the second query.

Anchor
_Toc235005841
_Toc235005841
Anchor
_Toc239744637
_Toc239744637
Anchor
_Toc309031866
_Toc309031866
Functional Demonstration

Anchor
_Toc235005842
_Toc235005842
Anchor
_Toc239744638
_Toc239744638
Anchor
_Toc309031867
_Toc309031867
Scenario 1

Execution of a select query
Start mckoiDB present at %FIORANO_HOME%\esb\samples\mckoiDB by executing CreateMckoiDB.bat and RunMckoi.bat. Configure the DBQuery component as shown in Figure 2 and configure a select statement as described in Simple Select Statement section. Use feeder and display components (shown in Figure 60) to create a flow to send sample input and check the response respectively. DBQuery component configures to a select query. As shown in sample input (Figure 61) DBQuery takes the CUSTOMER column value and returns that particular row. The selected row will be organized as XML and it will be returned to the output port as shown in sample output (Figure 62).

...

Adaptavist ThemeBuilder EngineAtlassian Confluence