Don’t Mix Datasource Configurations with Your Rules

Don’t Mix Datasource Configurations with Your Rules

Posted on October 03, 2018 0 Comments
Don’t Mix Datasource Configurations with Your Rules in Corticon_870x450

It's now easier than ever to keep the datasource loosely but consistently coupled with the business logic within Progress Corticon. Read on to see how.

To help ensure your decision services can be deployed into different system configurations such as Dev, Test and Production, it’s important to keep your rules free of database configuration. In Progress Corticon 5.7, we’ve improved the process by packaging all database configuration details in one XML file for easier integration.

How to Export the Datasource Configuration File

Once the datasource connection has been set up, you can export the file and use it for any rule project. Developers and database administrators can also update the file for fine-grained control over how Decision Services access the database.

1. Configure the Datasource Access

In the Vocabulary menu in Corticon Studio, select Add Datasource and choose either ADC or EDC. Then enter the datasource connection information as shown below. For more information on how to set up datasource access, see the Corticon Server: Data Integration Guide.

Configure the Datasource Access - Progress Corticon

Figure 1: Set-up screen for datasource configuration

2. Export the Datasource Configuration File

In the Vocabulary menu, select Datasource Configuration File > Export…

Export Datasource Configuration File - Progress Corticon

Figure 2: Menu selection to export the Datasource Configuration file.

3. Inspect the XML file

The resulting XML file includes all the defined connections to external datasources and looks similar to the code shown below.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<decisionService>
    <datasources>
         <database useForQueryService="true" name="Patient Data">
            <connection-url>jdbc:progress:sqlserver://DevSQLSrverDB:1433;
                            databaseName=PatientRecords</connection-url>
            <database-driver>com.corticon.database.id.MsSql2014</database-driver>
            <password>045032017061061017032045</password>
            <username>061046</username>
        </database>
        <database useForQueryService="false" name="Treatment Data">
            <connection-url>jdbc:progress:sqlserver://DevSQLSrverDB:1433;
                            databaseName=CMSDetail</connection-url>
            <database-driver>com.corticon.database.id.MsSql2014</database-driver>
            <password>045032017061061017032045</password>
            <username>061046</username>
        </database>   
    </datasources>
</decisionService>

 

Advantages of a Single Corticon Datasource File

Database Management

Database administrators can use the Datasource Configuration file to specify exactly how Corticon accesses the database, including authentication protocols, properties, trace generation and logs. Simply include any properties supported by the database driver in the connection URL, as in the example below.

<connection-url>
jdbc:progress:postgresql://host:port;databaseName=test;BulkLoadBatchSize=50;ConnectionRetryDelay=50;ConnectionRetryCount=5;LoginTimeout=500;SpyAttributes=(log=(file)C:\\spy_.log;)
</connection-url>

This approach solves some challenges of past Corticon versions that made it hard for DBAs to tightly manage database access.

Environment Management

Developers can easily move from one environment to another as the project proceeds. Just export the Datasource Configuration file, update the URL and include the appropriate username and password. The deployment administrator can then seamlessly integrate the file in the new environment.

Security

In the Datasource Configuration file, the username and password are encrypted. And if the same configuration needs to be used for another database instance with different credentials, Corticon ships with an encryption utility you can invoke by accessing CORTICON_HOME]\Server\bin\ and typing the command corticonManagement -en -i <string to encrypt>. The script yields an encrypted string you can specify in the XML.

Loose Coupling Between Rule Development and Database Management

Since the Datasource Configuration manages all aspects of the connection, rule modelers can leave database details to administrators and deployment engineers. And with those details in just one XML file, it’s much easier to keep the datasource loosely but consistently coupled with the business logic.

We hope this ability, along with the new feature upgrades in Corticon 5.7, make your life as a developer easier. You can check out everything that’s new in the latest version of Corticon here, and if you’re new to Corticon feel free start a free trial or reach out and request a demo.

Zoheb Shaikh

Zoheb Shaikh

Zoheb works in the capacity of a Principal Technical Support Engineer supporting Corticon and DataDirect. He has spent about a decade developing and supporting software systems and Customer Service is his calling.

Comments

Comments are disabled in preview mode.
Topics

Sitefinity Training and Certification Now Available.

Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.

Learn More
Latest Stories
in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

Loading animation