Server administration

Match Backend Extension

The purpose of the backend extension is to retrieve from and store data in a database. Using the keywords the user can save some consultation results or he can retrieve data from the DB and show it to the user during the consultation.

The Match Backend Extension needs to be enabled in the Application Manager as well as in every Knowledge Based Application that uses it.

Enable / Disable Match Backend Extension

To enable or disable the Match Backend Extension for a KBA, perform the following actions:

  1. In the Overview page, click the button of the KBA you want to edit.
  2. Expand the Extensions Configuration panel and then expand the Forward Extension panel.
  3. Check the disable extension option.
  4. Click on Submit to save the changes.

You now have disabled the Match Backend Extension. To enable the extension, uncheck the disable extension option.

How to use the backend extension - Assisted Mode

Keyword

TABLE TO RETRIEVE CONTENT FROM

Meaning

When TYPE OF DATABASE ACTION is set to RETRIEVE TABLE CONTENT, use this variable to select the table where to retrieve contents from.

Remarks

  • When using the smart repository, the table name should be in uppercase.

Keyword

COLUMN IN TABLE TO RETRIEVE CONTENT FROM

Meaning

When retrieving contents from a table, set this variable to the column name where to retrieve the contents from.

Remarks

  • When using the Smart Repository, the column name should be in uppercase.
  • Use * as value to retrieve all columns.
  • Repeat the keyword to select multiple columns.

Keyword

COLUMN-NAME TO FILTER TABLE ROWS ON

Meaning

The column name to filter on.

Used for either retrieving specific rows, updating specific rows or deleting specific rows.

Remarks

  • Leave empty to retrieve all columns.
  • Requires the following keywords to be set:

○      COLUMN-NAME TO FILTER TABLE ROWS ON

○      COLUMN-OPERATOR TO FILTER TABLE ROWS ON

○      COLUMN-VALUE TO FILTER TABLE ROWS ON

Keyword

COLUMN-OPERATOR TO FILTER TABLE ROWS ON

Meaning

The operator for column filtering.

Used for either retrieving specific rows, updating specific rows or deleting specific rows.

Possible values

<, <=, =, >, >=, IN

Remarks

  • Use the IN operator to check if the column value is part of a set.
  • Leave empty to retrieve all columns.
  • Requires the following keywords to be set:

○      COLUMN-NAME TO FILTER TABLE ROWS ON

○      COLUMN-OPERATOR TO FILTER TABLE ROWS ON

○      COLUMN-VALUE TO FILTER TABLE ROWS ON

Keyword

COLUMN-VALUE TO FILTER TABLE ROWS ON

Meaning

Set this variable with a value or a value reference to filter on.

Used for either retrieving specific rows, updating specific rows or deleting specific rows.

Remarks

  • Use a set here when using the IN operator.
  • Requires the following keywords to be set:

○      COLUMN-NAME TO FILTER TABLE ROWS ON

○      COLUMN-OPERATOR TO FILTER TABLE ROWS ON

○      COLUMN-VALUE TO FILTER TABLE ROWS ON

Keyword

TABLE TO CHANGE CONTENT OF

Meaning

When TYPE OF DATABASE ACTION  is set to UPDATE TABLE CONTENT or DELETE TABLE CONTENT, use this variable to select the table for which to update the content.

Remarks

  • When using the Smart Repository, the table name should be in uppercase.
  • When UPDATE TABLE CONTENT, it requires the following keywords to be set:

○      TABLE TO CHANGE CONTENT OF

○      COLUMN-NAME TO CHANGE CONTENT OF

○      COLUMN-VALUE TO CHANGE CONTENT WITH

  • When DELETE TABLE CONTENT, it requires the following keywords to be set:
    • COLUMN-NAME TO FILTER TABLE ROWS ON
    • COLUMN-OPERATOR TO FILTER TABLE ROWS ON
    • COLUMN-VALUE TO FILTER TABLE ROWS ON

Keyword

COLUMN-NAME TO CHANGE CONTENT OF

Meaning

When changing contents from a table, set this variable to the column name where to retrieve the contents from.

Remarks

  • When using the Smart Repository, the column name should be in uppercase.
  • Repeat the keyword to update multiple columns or define multiple columns when adding a new row.
  • Requires the following keywords to be set:

○      TABLE TO CHANGE CONTENT OF

○      COLUMN-NAME TO CHANGE CONTENT OF

○      COLUMN-VALUE TO CHANGE CONTENT WITH

Keyword

COLUMN-VALUE TO CHANGE CONTENT WITH

Meaning

Set this variable with a value or a value reference to change the content of.

Remarks

  • Repeat the to update multiple columns or define multiple columns when adding a new row.
  • Requires the following keywords to be set:

○      TABLE TO CHANGE CONTENT OF

○      COLUMN-NAME TO CHANGE CONTENT OF

○      COLUMN-VALUE TO CHANGE CONTENT WITH

Example:

image2013-10-4-16-17-47

 How to use the backend extension - Manual Mode

The first thing using the manual Mode is to initiate a database action indicating the type of action that will be performed (insert, select, delete or update). For doing so, we need the keywords:

Keyword

NEW DATABASE ACTION

Meaning

Clears old values from variables related to the Backend Extension as well as for User select-mechanism

To do: create separate NEW USER SELECT to only clear User select-variables

Possible values

X

Remarks

  • On initiate action on database, all variables related to backend should be ‘cleared’ to avoid use of old values.

Keyword

DATABASE CONNECTION NAME TO USE

Meaning

Set this variable to the name of the database connection to use. (See  database connections)

Remarks

  • The database connections are managed through the MWP configuration UI.
  • Use “Repository” to interact with the Smart Repository, the case specific database. The case specific database is a copy of the case master database.

Keyword

TYPE OF DATABASE ACTION

Meaning

Determines the type of action to perform on the database.

Possible values

  • RETRIEVE TABLE CONTENT
  • ADD NEW TABLE CONTENT
  • UPDATE TABLE CONTENT
  • DELETE TABLE CONTENT

Remarks

  • This variable must always have a value.
  • When using FULL SQL-QUERY, use the following values:

○      RETRIEVE TABLE CONTENT               for SELECT

○      ADD NEW TABLE CONTENT               for INSERT

○      UPDATE TABLE CONTENT                  for UPDATE

○      DELETE TABLE CONTENT                   for DELETE

Example:

image2013-10-4-16-17-19

Once we have specified the database action, the SQL query needs to be specified:

Keyword

FULL SQL-QUERY

Meaning

Use this to write a customized query using SQL.

Remarks

  • Limited to the following type of queries:

○      SELECT

○      INSERT

○      UPDATE

○      DELETE

Example:

image2013-10-4-16-18-10

To trigger the connection with the database and perform the query, the following keywords are needed:

Keyword

EXECUTE DATABASE ACTION

Meaning

Validates the query, connects to the database and executes the action on the database.

Possible values

  • SUCCESS
  • FAILURE

Remarks

  • This should be used as a condition with a condition subtable. This subtable should have an empty condition and the goal of the subtable should be predefined to FAILURE. This will make it default to this when the Backend Extension is disabled.
  • DATABASE CONNECTION NAME TO USE should be KNOWN.
  • When it returns one of the three failed statuses, variable QUERY ERROR MESSAGE will contain the related error message.
    If DATABASE ACTION ERROR MESSAGE is empty, check if the Backend Extension perhaps is disabled.
  • Variable QUERY ROWS INVOLVED will contain the number of rows involved in the action.

The following keywords describe how to process the result.

Keyword

DATABASE ACTION ROWS INVOLVED

Meaning

When a database action is completed successfully, this variable will contain the number of rows that were involved.

Remarks

  • This variable can be used to loop through a result set.

Keyword

DATABASE RESULTSET NEXT ROW

Meaning

Set this variable to X to move to the next row in the result set.

Possible values

X

Keyword

DATABASE RESULTSET

Meaning

Contains the resultset in a HTML grid, allowing for easy debugging by DISPLAYing it.

Keyword

DATABASE ACTION SUMMARY

Meaning

This variable has a value when an error occurred in the Backend Extension, assisting in debugging your model.

Keyword

SET MATCH VALUE

Meaning

Use this to set the value of a variable with the result of a database action.

Remarks

  • Use the following syntax:
    <variable name> = QUERYVAL(<column name>)

For handling the errors during the execution:

Keyword

DATABASE ACTION ERROR TYPE

Meaning

Used to identify the type of error.

Possible values

  • QUERY
  • CONNECTION
  • DEFINITION

Example:

screen-shot-2016-10-18-at-10-17-46

Extra keywords for processing the results:

Keyword

COLUMN-NAME TO RETURN VALUE FOR ADDED ROW

Meaning

This keyword allows you to configure one or more columns for which the value should be returned once it’s inserted.

This does not make any sense for data that is inserted through the knowledge, because you already know what the new data is. This can be very useful though for retrieving the (auto increment) ID of a newly inserted row.

Remarks

  • Must be set before running the query.

Keyword

COLUMN-VALUE RETURNED FOR ADDED ROW

Meaning

This variable will contain the ID of a newly inserted row.

Remarks

  • Must be accessed after running the query.
  • Variable COLUMN-NAME TO RETURN VALUE FOR ADDED ROW must be set.

Example

get-self-updating-pk-value

Debug Api

The extension supports

action param meaning
MatchBackendExtension-enableLogging true / false the extension will create a debug-download with the original query, the query parsed and prepared for execution, and the parameter list