Deploying a Decision Service that accesses a database
- Last Updated: March 24, 2022
- 7 minute read
- Corticon
- Version 6.3
- Documentation
Deploying a Decision Service that accesses a database
As an integration developer, you are responsible for deploying a Ruleflow as a Decision Service on Corticon Server. During deployment, if your Decision Services will access a database, you need to configure database access settings. Once that is done, the deployed Decision Service will automatically access the database.
In this section of the tutorial, you will deploy the Ruleflow (named Test_Ruleflow) that is part of the Scenario2 folder in the Connecting_EDC rule project.
There are different ways to deploy a Ruleflow as a Decision Service on Corticon Server. The recommended way is to package the Ruleflow into an EDS file and then deploy the EDS file on Corticon Server using its Corticon Web Console. You configure deployment settings (including database access settings) in the Web Console.
Packaging the Ruleflow into an EDS file
Let’s start by packaging the Ruleflow in Corticon Studio. Open the Test_Ruleflow.erf file.

The Ruleflow has just one Rulesheet—Aircraft_addRecord—which you used in the previous section.
Let’s package this Ruleflow into an EDS file. When we do this, the Ruleflow, the Rulesheet that it contains, and the Vocabulary all get compiled into a package that can be deployed on Corticon Server.
To package the Ruleflow, select Project > Package and Deploy Decision Services.

In the Deployment Target window, choose Package and save for later deployment and click Next.

In the Package Ruleflows screen:
- Select Test_Ruleflow.
- Choose Read/Update in the Database Mode drop-down.
- Choose a location to save the EDS file by clicking the Browse button.(It is always good practice to save it in the same folder as the Ruleflow.)
- Click Finish.

You see a message indicating that the Ruleflow was successfully compiled into an EDS file and saved in the location you specified.

Exporting the Datasource configuration file
As part of deploying the Ruleflow as a Decision Service, you need to supply a configuration file containing information about the database connection. The best way to create the file is to export the properties from Corticon Studio and modify them for your production environment.
Export the database properties by opening the Cargo.ecore Vocabulary in the Scenario2 folder and selecting Vocabulary > Datasource Configuration File > Export.

In the Save As dialog box, select a location where you want to save the XML file, give it a name such as Scenario2_Datasource.xml. (It is always good practice to save it in the same folder as the Decision Service file. Click Save.
In this tutorial, you will use the same SQL Server database to simulate the production environment, so you do not need to modify the database connection properties in the properties file.
Installing Corticon Server
You’ll install Corticon Server for Java so that you can deploy the Decision Service to it. We’ll use the Corticon Web Console to do the deployment so you will install that component as well.
- Download PROGRESS_CORTICON_6.x_SERVER_WIN_64.exe
- Double-click the installer executable. The installation wizard opens.
- On the Introduction page of the installation wizard, click Next.
- On the License Agreement page, read, understand , and agree to the terms, then select I accept the terms of the License Agreement, and then click Next.
- On the Corticon Server Install and Work Directory, retain the default settings,and then click Next
- On the Choose Server Components page, select Corticon Server for
Java and Corticon Web Console, and then click Next
- On the Corticon Server Instance and Port Numbers page, accept the default settings, and then click Next.
- On the Pre-Installation Summary page, click Install.
- Wait for a few minutes for the installation to complete. Then, on the Install Complete page, click Done.
Starting Corticon Server
On the Start menu, choose Progress > Corticon 6.x Server.
This launches a command console. Corticon Server takes a few minutes to start the first time. When it is running, you are informed of Server startup:

Deploying the Decision Service using the Web Console
The Corticon Web Console lets you deploy and then monitor your Decision Services.
Launch the Web Console by selecting Start Progress > Corticon 6.x Web Console.

The Web Console Home page opens. Click on Manage Decision Services.

On the Decision Services page, click + Add Decision Service.


On the Add Decision Service dialog box:
- In the Name field, enter Test_Ruleflow as the name for the Decision Service.
In the EDS File section, click Choose File. In the window that opens, navigate to the location where you saved the EDS file, Test_Ruleflow_v1.0.eds, and then click Open.
- On the Select Servers pulldown, choose local server.
- Click the DataSource tab. Do the following:
-
In the Datasource Configuration File section, click Choose File.
-
In the window that opens, navigate to the location where you saved the EDS file, Scenario2_Datasource.xml, and then click Open.
-
In the EDC Access Mode section, click Read/Update.
-
- Click Save and Deploy.

Testing
Finally, let’s test the deployed Decision Service. One way to test it is to use a Ruletest in Corticon Studio and select the Decision Service as its Test Subject.
Recall that the Decision Service has just one Rulesheet—Aircraft_addRecord.ers—which checks an Aircraft entity instance’s aircraftType, assigns a value to the instance’s maxCargoWeight attribute, and then adds the instance as a new Aircraft record if a new primary key value is supplied in the tailNumber attribute.
To begin with, let’s look at the existing Aircraft records. In SQL Server Management Studio, right-click dbo.Plane in the Scenario2 database and select Select Top 1000 Rows. As you can see there is just one record:

By running the Ruletest, you will verify that when you supply input data with a different primary key value to the Decision Service, a new record is added to this table.
In Corticon Studio, create a new Ruletest named Test_DecisionService as follows:
- Right-click the Scenario2 folder and select
File > New > Ruletest:

- In the Create New Ruletest wizard, enter Test_DecisionService in the File name field, and then click Next.

- On the Select Test Subject page:
- Select the Run against Server tab.
- Select the Corticon Server URL (http://localhost:8850/axis) from the Server URL drop-down.
- Click the Refresh button next to Decision Services.
- Select Test_Ruleflow in the Decision Services section.
- Click Next.

- On the Select Vocabulary page, ensure that
Cargo.ecore in the Scenario2
folder is selected,and then click Finish.

The Ruletest is now configured. The Test Subject in the Ruletest (highlighted in the image below) should point to the Test_Ruleflow Decision Service. Drag and drop an Aircraft entity instance from the Rule Vocabulary view to the Input pane and define the following values:
- aircraftType = 777
- tailNumber = N222B (which is unique)

Since this Ruletest invokes a Decision Service on Corticon Server, you do not need to configure its database access setting.

Let’s verify that a new record has been added to the dbo.Plane table based on the Output of this Ruletest. In SQL Server Management Studio, right-click dbo.Plane in the Scenario2 database and select Select Top 1000 Rows. You see the new row was added to the database table:

Our Decision Service running on the Corticon Server accessed and wrote to the database.
Congratulations! You have now mapped a Vocabulary to a database and deployed a Ruleflow as a Decision Service on Corticon Server that can read and write to a database.