ProcessMIX User Guide
Categories

DB connector builder

Updated on March 19, 2023
Print

DB connector builder is a component that provides the ability to connect to external or internal databases. The internal database is available as an additional resource that can be added on to the organization page.

How to create the first DB Connector?

To create a new DB Connector, select the Connector icon on the Project Explorer panel — left end panel. Make sure you are in the Connector entity. Now create a DB Connector by clicking on the icon on the Explorer panel and select the DB Connector. To create a connector in a folder, you need to select the desired folder and then click on the icon. In the pop-up window, enter the DB Connector name and click the CREATE button.

Note:

The Connector’s name should be longer than 1 symbol and shorter than 100. It can contain letters (Latin a-z A-Z), numbers 0-9, $, and underscores. It should begin with a letter or underscore character.

DB Connector has been created.

How to set up a DB Connector?

After creating a connector, the next step you need to do is connect to the database and work with it.

To do this, select the database type, and enter the URL to the database (for example – jdbc:postgresql://postgres:5432/postgresdb). This URL should contain a port for proper connection to the database if it is required and the database name after /, please see the example. Also, you should fill in the user and password to get access to the database on the central part of DB Connector, then click on the CHECK CONNECTION button.

Note:

Pattern for entering URL: jdbc:DBTYPE://URL:PORT/DBNAME

There are currently two types available: sqlserver and postgresql.

You have connected to the database.

If the connection is not established, please check the entered data and try again.

To add a Description to the REST Connector. Click on the description section and enter the value.

Preservation occurs when starting/switching work with another entity or closing a tab.

How to create connector queries?

To add a new query, click on the icon in the Queries section. In the pop-up window, enter the query name and click the CREATE button.

To filter Connector queries to find the necessary services, click on the icon. You will see a field in which you can enter the name of the query that you need to find and enter the requested value. After that, the match results will be presented in a general list.

Note:

The Connector’s query name should be longer than 1 symbol and shorter than 255. It can contain letters (Latin a-z A-Z), numbers 0-9, $, and underscores. It should begin with a letter or underscore character.

Queries settings

Queries support all SQL operations, you can create tables, delete, add records to the database, and more.

For the platform to recognize a certain value as a parameter, it must be enclosed in curly braces {..}, after which the variable will appear in the testing section and will be available in the connector node settings to match the data when used in a flow. 

Warning:

The internal database has its capacity limits, if the memory capacity is full, you cannot add new data.

How to test the DB Connector query?

The Connector Builder has built-in functionality that allows the user to test queries against specific data and see the result. It also allows it to change its content if the request does not work correctly.

To test the query, you need to fill in Test values and select the necessary data type.

Warning:

Make sure that the entered values match the expected types of data.

Click the TEST button.

In the Query test results section, you can see the response of the database.  The output of the result is limited to three records. In the Message section, you will see a summary of the request or the error.

If you want to get the generated structure based on the results of the query to use it later during the flow creation, click the GENERATE button and select the parameters ​​you need to add to the structure, and click the CONFIRM button.

Note:

If you need to have all the records matching your query as a result, then activate the checkbox ‘Does the result contain multiple rows?’ Otherwise, your result will contain only the data of the first match.

Supported data types:

  1. Boolean — value “true” or “false”
  2. Array <Boolean> — array of boolean values
  3. String — text, for example, “Peter Peterson”
  4. Array <String> — array of string values
  5. Integer — number, for example, “22”
  6. Array <Integer> — array of integer values
  7. Float — floating-point or decimal number, for example, “0.1234”
  8. Array <Float> — array of float values

Additional operations with the DB Connector

Select the DB Connector on the Project Explorer panel — left end panel. By clicking the right mouse button, a context menu opens through which a number of operations are available.

Let’s see what operations are possible:

  1. Edit or simply click on the name of the connector — allows you to open the DB Connector.
  2. Copy — allows you to copy the connector to transfer it later..
  3. Clone — allows you to create a clone of the connector. The cloned connector will have the same name as the Name of the parent connector + Clone(n).
  4. Cut — allows you to cut connectors for transfer later.
  5. Paste — allows you to paste the connector. This is not available unless you have previously used the Copy or Cut options.
  6. Rename — allows you to rename the connector.
  7. Delete — allows you to delete the connector.

Additional operations with Queries

Select Query on the queries section. By clicking the right mouse button, a context menu opens through which a number of operations are available.

Let’s see what operations are possible:

  1. Clone — allows you to create a clone of the query. The cloned query will have the same name as the Name of the parent query + Clone(n).
  2. Rename — allows you to rename the query.
  3. Delete — allows you to delete the query.

How to set environment variables to change DB settings using artifacts: war or jar?

To set environment variables use Tomcat containers.

Configuration parameters:

project.connector.{x}.connection.{y} = {value}

Where x is the name of the connector, and y is the property name (jdbcUrl, username, password).