Getting started with decision services
Abstract
Preface
As a business rules developer, you can use Business Central in Red Hat Decision Manager to design a variety of decision services. Red Hat Decision Manager provides example projects with example decisions directly in Business Central as a reference. This document describes how to create and test a new project in Business Central for an example traffic violations decision service based on a Decision Model and Notation (DMN) model.
For more information about the DMN components and implementation in Red Hat Decision Manager, see Designing a decision service using DMN models.
Prerequisites
- Red Hat JBoss Enterprise Application Platform 7.2 is installed. For installation information, see Red Hat JBoss Enterprise Application Platform 7.2 Installation Guide.
- Red Hat Decision Manager is installed and configured with Decision Server. For more information, see Installing and configuring Red Hat Decision Manager on Red Hat JBoss EAP 7.2.
-
Red Hat Decision Manager is running and you can log in to Business Central with the
developer
role. For more information, see Planning a Red Hat Decision Manager installation.
Chapter 1. Creating the traffic violations project
For this example, create a new project called traffic-violation
. A project is a container for assets such as data objects, DMN assets, and test scenarios.
Procedure
- Log in to Business Central.
Go to Menu → Design → Projects.
Red Hat Decision Manager provides a default space called MySpace, as shown in the following image. You can use the default space to create and test example projects.
Figure 1.1. Default space
- Click Add Project.
-
Enter
traffic-violation
in the Name field. Click Show Advanced Options to expand the GAV fields and enter the following values:
-
Group ID:
org.kie.example.traffic
-
Artifact ID:
traffic-violation
-
Version:
1.0.0
-
Group ID:
Click Add.
Figure 1.2. Add Project window with expanded Advanced Options
The Assets view of the project opens.
Chapter 2. Decision Model and Notation (DMN)
Decision Model and Notation (DMN) is a standard established by the Object Management Group (OMG) for describing and modeling operational decisions. DMN defines an XML schema that enables DMN models to be shared between DMN-compliant platforms and across organizations so that business analysts and business rules developers can collaborate in designing and implementing DMN decision services. The DMN standard is similar to and can be used together with the Business Process Model and Notation (BPMN) standard for designing and modeling business processes.
For more information about the background and applications of DMN, see the OMG Decision Model and Notation specification.
2.1. Creating the traffic violations DMN decision requirements diagram (DRD)
A decision requirements diagram (DRD) is a visual representation of your DMN model. Use the DMN designer in Business Central to design the DRD for the traffic violations project and to define the decision logic of the DRD components.
Figure 2.1. DRD for the Traffic Violations example
Prerequisite
- You have created the traffic violations project in Business Central.
Procedure
- On the traffic-violation project’s home screen, click Add Asset to open the Add Asset screen.
Click DMN to open the Create new DMN dialog.
-
Enter
Traffic Violation
in the Name field. -
From the Package list, select
org.kie.example.traffic.traffic_violations
. - Click Ok to open the DMN asset in the DMN designer.
-
Enter
-
In the DMN designer canvas, drag two input nodes to the canvas. Double-click the input nodes and rename them as
Driver
andViolation
. -
Drag a decision node to the canvas. Double-click and rename it as
Fine
. -
Click the Violation input node and select the
Create DMN Information Requirement
option to connect to theFine
decision node. -
Drag another decision node to the canvas and double-click and rename it as
Should the driver be suspended?
. -
Click the Driver input node and select the
Create DMN Information Requirement
option to connect to theShould the driver be suspended?
decision node. -
Click the Fine decision node and select the
Create DMN Information Requirement
option to connect to theShould the driver be suspended?
decision node. - Click Save to open the Confirm Save dialog box and click Save again.
2.2. Creating the traffic violations DMN custom data types
DMN data types determine the structure of the data that you use within a table, column, or field in a DMN boxed expression for defining decision logic. You can use default DMN data types (such as string, number, or boolean) or you can create custom data types to specify additional fields and constraints that you want to implement for the boxed expression values. Use the DMN designer’s Data Types tab in Business Central to define the custom data types for the traffic violations project.
Figure 2.2. The custom data types tab
Alternately, you can also access the Data Types tab from the Diagram properties tab on the right. From the Diagram properties tab, click Manage from Output data types under Information item.
Figure 2.3. Diagram properties tab
The following tables list the Violation
, Driver
, and Fine
custom data types that you will create for this project.
Name | Type |
---|---|
tDriver | Structure |
Name | string |
Age | number |
State | string |
City | string |
Points | number |
Name | Type |
---|---|
tViolation | Structure |
Code | string |
Date | date |
Type | string |
Speed Limit | number |
Actual Speed | number |
Name | Type |
---|---|
tFine | Structure |
Amount | number |
Points | number |
Prerequisite
- You have created the traffic violations DMN decision requirements diagram (DRDs) in Business Central.
Procedure
- From the Data Types tab, click Add.
First, create the tDriver custom data type. Enter
tDriver
as the Name and selectStructure
as the Type. Click Save for each data type that you add.Figure 2.4. The tDriver custom data type
Next to the tDriver data type, click the three vertical dots, select Insert nested field, and add the following nested data types. Click Save for each data type that you add.
- Name (string)
- Age (number)
- State (string)
- City (string)
- Points (number)
Next, create the tViolation data type. From the Data Types tab, click Add.
Figure 2.5. The tViolation custom data type
-
Enter
tViolation
as the Name and selectStructure
as the Type. Click Save to save the data type. Next to the tViolation data type, click the three vertical dots, select Insert nested field, and add the following nested data types. Click Save for each data type that you add.
- Code (string)
- Date (date)
- Type (string)
- Speed Limit (number)
- Actual Speed (number)
For the nested
Type
data type that you created, click Edit → Constraints → Enumeration and add the following constraints. Click the check icon to save each enumeration constraint that you add.-
"speed"
-
"parking"
-
"Driving under the influence?"
-
Finally, create the tFine data type. From the Data Types tab, click Add.
Figure 2.6. The tFine custom data type
-
Enter
tFine
as the Name and selectStructure
as the Type. Click Save to save the data type. Next to the tFine data type, click the three vertical dots, select Insert nested field, and add the following nested data types. Click Save for each data type that you add.
- Amount (number)
- Points (number)
- Once all the three custom data types are created, click Save to open the Confirm Save dialog box and click Save again.
2.3. Assigning custom data types to the DRD input and decision nodes
After you create the DMN custom data types, assign them to the appropriate DMN Input Data and DMN Decision nodes in the traffic violations DRD.
Prerequisite
- You have created the traffic violations DMN custom data types in Business Central.
Procedure
- Click the Model tab on the DMN designer and click Diagram properties in the top-right corner of the DMN designer to expose the DRD properties.
-
In the DRD, select the Driver input data node and in the Diagram properties panel, set Output data type to
tDriver
. -
Select the Violation input data node and set the Output data type to
tViolation
. -
Select the Fine input data node and set the Output data type to
tFine
. Select the Should the driver be suspended? decision node and set the following properties:
-
Output data type:
string
-
Question:
Should the driver be suspended due to points on his driver license?
-
Allowed Answers:
"Yes","No"
-
Output data type:
- Click Save to open the Confirm Save dialog box and click Save again.
You have assigned the custom data types to your DRD’s input and decision nodes.
2.4. Defining the traffic violations DMN decision logic
To calculate the fine and to decide whether the driver is to be suspended or not, you can define the traffic violations DMN decision logic using a DMN decision table and context boxed expression.
Figure 2.7. Fine decision table
Figure 2.8. Should the driver be suspended? context boxed expression
Prerequisite
- You have assigned the DMN custom data types to the appropriate decision and input nodes in the traffic violations DRD in Business Central.
Procedure
- To calculate fine, in the DMN designer canvas, select the Fine decision node and click the Edit icon to open the DMN boxed expression designer.
- Click Select expression → Decision Table.
- For the Violation.Date, Violation.Code, and Violation.Speed Limit parameter fields, right-click and select Delete Input Clause for each field.
-
Click the Violation.Actual Speed column header and enter the expression
Violation.Actual Speed - Violation.Speed Limit
in the Name field. -
Right-click the Fine parameter field and select either
Insert Output Clause left
orInsert Output Clause right
. -
Click the output-2 column sub-header, enter
Amount
in the Name field, and selectnumber
from the Data Type field. -
Similarly, click the output-1 column sub-header, enter
Points
in the Name field, and selectnumber
from the Data Type field. Next, enter the following values in the first row of the decision table:
-
Violation.Type:
"speed"
-
Violation.Actual Speed - Violation.Speed Limit:
[10..30]
-
Amount:
500
Points:
3
Right-click the first row and select
Insert rule below
to add another row.
-
Violation.Type:
Enter the following values in the second row of the decision table:
-
Violation.Type:
"speed"
-
Violation.Actual Speed - Violation.Speed Limit:
> 30
-
Amount:
1000
Points:
7
Right-click the second row and select
Insert rule below
to add another row.
-
Violation.Type:
Enter the following values in the third row of the decision table:
-
Violation.Type:
"parking"
-
Violation.Actual Speed - Violation.Speed Limit:
-
-
Amount:
100
Points:
1
Right-click the third row and select
Insert rule below
to add another row.
-
Violation.Type:
Enter the following values in the fourth row of the decision table:
-
Violation.Type:
"driving under the influence"
-
Violation.Actual Speed - Violation.Speed Limit:
-
-
Amount:
1000
-
Points:
5
-
Violation.Type:
- Click Save to open the Confirm Save dialog box and click Save again.
- To define the driver suspension rule, return to the DMN designer canvas, select the Should the driver be suspended? decision node, and click the Edit icon to open the DMN boxed expression designer.
- Click Select expression → Context.
-
Click ContextEntry-1, enter
Total Points
as the Name, and selectnumber
as the Data Type. -
Click the cell next to Total Points, select
Literal Expression
from the context menu, and enterDriver.Points + Fine.Points
as the expression. -
In the cell below Driver.Points + Fine.Points, select
Literal Expression
from the context menu, and enterif Total Points >= 20 then "Yes" else "No"
. Click Save to open the Confirm Save dialog box and click Save again.
You have defined how to calculate the fine and the context for deciding when to suspend the driver. You can navigate to the traffic-violation project page and click Build to build the example project and address any errors noted in the Alerts panel.
Chapter 3. Test scenarios
Test scenarios in Red Hat Decision Manager enable you to validate the functionality of business rules and business rule data (for rules-based test scenarios) or the DMN models (for DMN-based test scenarios) before deploying them into a production environment. With a test scenario, you use data from your project to set given conditions and expected results based on one or more defined business rules. When you run the scenario, the expected results and actual results of the rule instance are compared. If the expected results match the actual results, the test is successful. If the expected results do not match the actual results, then the test fails.
With the Test Scenarios designer, you execute all scenarios from the .scesim
file at one time, whereas with the Test Scenarios (Legacy) designer, you can execute test scenarios one at a time or as a group. The group execution contains all the scenarios from one package. Test scenarios are independent, so one scenario cannot affect or modify the other. You can run test scenarios at any time during project development in Business Central. You do not have to compile or deploy your decision service to run test scenarios.
You can import data objects from different packages to the same project package as the test scenario. Assets in the same package are imported by default. After you create the necessary data objects and the test scenario, you can use the Data Objects tab of the test scenarios designer to verify that all required data objects are listed or to import other existing data objects by adding a New item.
3.1. Testing the traffic violations using test scenarios
Use the test scenarios designer in Business Central to test the DMN decision requirements diagrams (DRDs) and define decision logic for the traffic violations project.
Figure 3.1. Test scenario for the traffic violations example
Prerequisite
- You have successfully build the traffic violations project in Business Central.
Procedure
- On the traffic-violation project’s home screen, click Add Asset to open the Add Asset screen.
Click Test Scenario to open the Create new Test Scenario dialog.
-
Enter
Violation Scenarios
in the Test Scenario field. -
From the Package list, select
org.kie.example.traffic.traffic_violations
. -
Select
DMN
as the Source type. - From the Choose a DMN asset list, select the path to the DMN asset.
- Click Ok to open the Violation Scenarios test scenario in the Test Scenarios designer.
-
Enter
- Under Driver column sub-header, right-click the State, City, Age, and Name value cells and select Delete column from the context menu options to remove them.
- Under Violation column sub-header, right-click the Date and Code value cells and select Delete column to remove them.
Enter the following information in the first row of the test scenarios:
-
Scenario description:
Above speed limit: 10km/h and 30 km/h
-
Points (under Given column header):
10
-
Type:
"speed"
-
Speed Limit:
100
-
Actual Speed:
120
-
Points (under Expect column header):
3
-
Amount:
500
Should the driver be suspended?:
"No"
Right-click the first row and select Insert row below to add another row.
-
Scenario description:
Enter the following information in the second row of the test scenarios:
-
Scenario description:
Above speed limit: more than 30 km/h
-
Points (under Given column header):
10
-
Type:
"speed"
-
Speed Limit:
100
-
Actual Speed:
150
-
Points (under Expect column header):
7
-
Amount:
1000
Should the driver be suspended?:
"No"
Right-click the second row and select Insert row below to add another row.
-
Scenario description:
Enter the following information in the third row of the test scenarios:
-
Scenario description:
Parking violation
-
Points (under Given column header):
10
-
Type:
"parking"
-
Speed Limit:
-
-
Actual Speed:
-
-
Points (under Expect column header):
1
-
Amount:
100
Should the driver be suspended?:
"No"
Right-click the third row and select Insert row below to add another row.
-
Scenario description:
Enter the following information in the fourth row of the test scenarios:
-
Scenario description:
DUI violation
-
Points (under Given column header):
10
-
Type:
"driving under the influence"
- Speed Limit: leave blank
- Actual Speed: leave blank
-
Points (under Expect column header):
5
-
Amount:
1000
Should the driver be suspended?:
"No"
Right-click the fourth row and select Insert row below to add another row.
-
Scenario description:
Enter the following information in the fifth row of the test scenarios:
-
Scenario description:
Driver suspended
-
Points (under Given column header):
15
-
Type:
"speed"
-
Speed Limit:
100
-
Actual Speed:
140
-
Points (under Expect column header):
7
-
Amount:
1000
-
Should the driver be suspended?:
"Yes"
-
Scenario description:
- Click Save to open the Confirm Save dialog box and click Save again.
Click the play button to check whether the test scenarios pass or fail.
Figure 3.2. Test scenario execution result for the traffic violations example
In case of failure, correct the errors and run the test scenarios again.
Chapter 4. DMN model execution
You can create or import DMN files in your Red Hat Decision Manager project using Business Central or package the DMN files as part of your project knowledge JAR (KJAR) file without Business Central. After you implement your DMN files in your Red Hat Decision Manager project, you can execute the DMN decision service by deploying the KIE container that contains it to Decision Server for remote access and interacting with the container using the Decision Server REST API.
For information about including external DMN assets with your project packaging and deployment method, see Packaging and deploying a Red Hat Decision Manager project.
4.1. Executing a DMN service using the Decision Server REST API
Directly interacting with the REST endpoints of Decision Server provides the most separation between the calling code and the decision logic definition. The calling code is completely free of direct dependencies, and you can implement it in an entirely different development platform such as node.js
or .net
. The examples in this section demonstrate Nix-style curl commands but provide relevant information to adapt to any REST client.
For more information about the Decision Server REST API, see Interacting with Red Hat Decision Manager using KIE APIs.
Prerequisites
-
Decision Server is installed and configured, including a known user name and credentials for a user with the
kie-server
role. For installation options, see Planning a Red Hat Decision Manager installation. A KIE container is deployed in Decision Server in the form of a KJAR that includes the DMN model, ideally compiled as an executable model for more efficient execution:
mvn clean install -DgenerateDMNModel=yes
For more information about project packaging and deployment and executable models, see Packaging and deploying a Red Hat Decision Manager project.
- You have the container ID of the KIE container containing the DMN model. If more than one model is present, you must also know the model namespace and model name of the relevant model.
Procedure
Determine the base URL for accessing the Decision Server REST API endpoints. This requires knowing the following values (with the default local deployment values as an example):
-
Host (
localhost
) -
Port (
8080
) -
Root context (
kie-server
) -
Base REST path (
services/rest/
)
Example base URL in local deployment for the traffic violations project:
http://localhost:8080/kie-server/services/rest/server/containers/Traffic-Violation_1.0.0
-
Host (
Determine user authentication requirements.
When users are defined directly in the Decision Server configuration, HTTP Basic authentication is used and requires the user name and password. Successful requests require that the user have the
kie-server
role.The following example demonstrates how to add credentials to a curl request:
curl -u username:password <request>
If Decision Server is configured with Red Hat Single Sign-On, the request must include a bearer token:
curl -H "Authorization: bearer $TOKEN" <request>
Specify the format of the request and response. The REST API endpoints work with both JSON and XML formats and are set using request headers:
JSON
curl -H "accept: application/json" -H "content-type: application/json"
XML
curl -H "accept: application/xml" -H "content-type: application/xml"
(Optional) Query the container for a list of deployed decision models:
[GET]
server/containers/{containerId}/dmn
Example curl request:
curl -u wbadmin:wbadmin -H "accept: application/xml" -X GET "http://localhost:8080/kie-server/services/rest/server/containers/Traffic-Violation_1.0.0/dmn"
Sample XML output:
<?XML VERSION="1.0" ENCODING="UTF-8" STANDALONE="YES"?> <RESPONSE TYPE="SUCCESS" MSG="OK MODELS SUCCESSFULLY RETRIEVED FROM CONTAINER 'TRAFFIC-VIOLATION_1.0.0'"> <DMN-MODEL-INFO-LIST> <MODEL> <MODEL-NAMESPACE>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</MODEL-NAMESPACE> <MODEL-NAME>TRAFFIC VIOLATION</MODEL-NAME> <MODEL-ID>_2CD7D1AA-BD84-4B43-AD21-B0342ADE655A</MODEL-ID> <DECISIONS> <DMN-DECISION-INFO> <DECISION-ID>_23428EE8-DC8B-4067-8E67-9D7C53EC975F</DECISION-ID> <DECISION-NAME>FINE</DECISION-NAME> </DMN-DECISION-INFO> <DMN-DECISION-INFO> <DECISION-ID>_B5EEE2B1-915C-44DC-BE43-C244DC066FD8</DECISION-ID> <DECISION-NAME>SHOULD THE DRIVER BE SUSPENDED?</DECISION-NAME> </DMN-DECISION-INFO> </DECISIONS> <INPUTS> <DMN-INPUTDATA-INFO> <INPUTDATA-ID>_CEB959CD-3638-4A87-93BA-03CD0FB63AE3</INPUTDATA-ID> <INPUTDATA-NAME>VIOLATION</INPUTDATA-NAME> <INPUTDATA-TYPEREF> <NAMESPACE-URI>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</NAMESPACE-URI> <LOCAL-PART>TVIOLATION</LOCAL-PART> <PREFIX></PREFIX> </INPUTDATA-TYPEREF> </DMN-INPUTDATA-INFO> <DMN-INPUTDATA-INFO> <INPUTDATA-ID>_B0E810E6-7596-430A-B5CF-67CE16863B6C</INPUTDATA-ID> <INPUTDATA-NAME>DRIVER</INPUTDATA-NAME> <INPUTDATA-TYPEREF> <NAMESPACE-URI>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</NAMESPACE-URI> <LOCAL-PART>TDRIVER</LOCAL-PART> <PREFIX></PREFIX> </INPUTDATA-TYPEREF> </DMN-INPUTDATA-INFO> </INPUTS> <ITEMDEFINITIONS> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_9C758F4A-7D72-4D0F-B63F-2F5B8405980E</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>TVIOLATION</ITEMDEFINITION-NAME> <ITEMDEFINITION-ITEMCOMPONENT> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_0B6FF1E2-ACE9-4FB3-876B-5BB30B88009B</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>CODE</ITEMDEFINITION-NAME> <ITEMDEFINITION-TYPEREF> <NAMESPACE-URI>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</NAMESPACE-URI> <LOCAL-PART>STRING</LOCAL-PART> <PREFIX></PREFIX> </ITEMDEFINITION-TYPEREF> <ITEMDEFINITION-ITEMCOMPONENT/> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_27A5DA18-3CA7-4C06-81B7-CF7F2F050E29</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>DATE</ITEMDEFINITION-NAME> <ITEMDEFINITION-TYPEREF> <NAMESPACE-URI>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</NAMESPACE-URI> <LOCAL-PART>DATE</LOCAL-PART> <PREFIX></PREFIX> </ITEMDEFINITION-TYPEREF> <ITEMDEFINITION-ITEMCOMPONENT/> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_8961969A-8A80-4F12-B568-346920C0F038</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>TYPE</ITEMDEFINITION-NAME> <ITEMDEFINITION-TYPEREF> <NAMESPACE-URI>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</NAMESPACE-URI> <LOCAL-PART>STRING</LOCAL-PART> <PREFIX></PREFIX> </ITEMDEFINITION-TYPEREF> <ITEMDEFINITION-ITEMCOMPONENT/> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_7450F12A-3E95-4D5E-8DCE-2CB1FAC2BDD4</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>SPEED LIMIT</ITEMDEFINITION-NAME> <ITEMDEFINITION-TYPEREF> <NAMESPACE-URI>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</NAMESPACE-URI> <LOCAL-PART>NUMBER</LOCAL-PART> <PREFIX></PREFIX> </ITEMDEFINITION-TYPEREF> <ITEMDEFINITION-ITEMCOMPONENT/> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_0A9A6F26-6C14-414D-A9BF-765E5850429A</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>ACTUAL SPEED</ITEMDEFINITION-NAME> <ITEMDEFINITION-TYPEREF> <NAMESPACE-URI>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</NAMESPACE-URI> <LOCAL-PART>NUMBER</LOCAL-PART> <PREFIX></PREFIX> </ITEMDEFINITION-TYPEREF> <ITEMDEFINITION-ITEMCOMPONENT/> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> </ITEMDEFINITION-ITEMCOMPONENT> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_13C7EFD8-B85C-43BF-94D3-14FABE39A4A0</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>TDRIVER</ITEMDEFINITION-NAME> <ITEMDEFINITION-ITEMCOMPONENT> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_EC11744C-4160-4549-9610-2C757F40DFE8</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>NAME</ITEMDEFINITION-NAME> <ITEMDEFINITION-TYPEREF> <NAMESPACE-URI>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</NAMESPACE-URI> <LOCAL-PART>STRING</LOCAL-PART> <PREFIX></PREFIX> </ITEMDEFINITION-TYPEREF> <ITEMDEFINITION-ITEMCOMPONENT/> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_E95BE3DB-4A51-4658-A166-02493EAAC9D2</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>AGE</ITEMDEFINITION-NAME> <ITEMDEFINITION-TYPEREF> <NAMESPACE-URI>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</NAMESPACE-URI> <LOCAL-PART>NUMBER</LOCAL-PART> <PREFIX></PREFIX> </ITEMDEFINITION-TYPEREF> <ITEMDEFINITION-ITEMCOMPONENT/> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_7B3023E2-BC44-4BF3-BF7E-773C240FB9AD</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>STATE</ITEMDEFINITION-NAME> <ITEMDEFINITION-TYPEREF> <NAMESPACE-URI>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</NAMESPACE-URI> <LOCAL-PART>STRING</LOCAL-PART> <PREFIX></PREFIX> </ITEMDEFINITION-TYPEREF> <ITEMDEFINITION-ITEMCOMPONENT/> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_3D4B49DD-700C-4925-99A7-3B2B873F7800</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>CITY</ITEMDEFINITION-NAME> <ITEMDEFINITION-TYPEREF> <NAMESPACE-URI>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</NAMESPACE-URI> <LOCAL-PART>STRING</LOCAL-PART> <PREFIX></PREFIX> </ITEMDEFINITION-TYPEREF> <ITEMDEFINITION-ITEMCOMPONENT/> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_B37C49E8-B0D9-4B20-9DC6-D655BB1CA7B1</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>POINTS</ITEMDEFINITION-NAME> <ITEMDEFINITION-TYPEREF> <NAMESPACE-URI>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</NAMESPACE-URI> <LOCAL-PART>NUMBER</LOCAL-PART> <PREFIX></PREFIX> </ITEMDEFINITION-TYPEREF> <ITEMDEFINITION-ITEMCOMPONENT/> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> </ITEMDEFINITION-ITEMCOMPONENT> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_A4077C7E-B57A-4DEE-9C65-7769636316F3</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>TFINE</ITEMDEFINITION-NAME> <ITEMDEFINITION-ITEMCOMPONENT> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_79B152A8-DE83-4001-B88B-52DFF0D73B2D</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>AMOUNT</ITEMDEFINITION-NAME> <ITEMDEFINITION-TYPEREF> <NAMESPACE-URI>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</NAMESPACE-URI> <LOCAL-PART>NUMBER</LOCAL-PART> <PREFIX></PREFIX> </ITEMDEFINITION-TYPEREF> <ITEMDEFINITION-ITEMCOMPONENT/> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> <DMN-ITEMDEFINITION-INFO> <ITEMDEFINITION-ID>_D7CB5F9C-9D55-48C2-83EE-D47045EC90D0</ITEMDEFINITION-ID> <ITEMDEFINITION-NAME>POINTS</ITEMDEFINITION-NAME> <ITEMDEFINITION-TYPEREF> <NAMESPACE-URI>HTTPS://GITHUB.COM/KIEGROUP/DROOLS/KIE-DMN/_60B01F4D-E407-43F7-848E-258723B5FAC8</NAMESPACE-URI> <LOCAL-PART>NUMBER</LOCAL-PART> <PREFIX></PREFIX> </ITEMDEFINITION-TYPEREF> <ITEMDEFINITION-ITEMCOMPONENT/> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> </ITEMDEFINITION-ITEMCOMPONENT> <ITEMDEFINITION-ISCOLLECTION>FALSE</ITEMDEFINITION-ISCOLLECTION> </DMN-ITEMDEFINITION-INFO> </ITEMDEFINITIONS> <DECISIONSERVICES/> </MODEL> </DMN-MODEL-INFO-LIST> </RESPONSE>
Sample JSON output:
{ "type" : "SUCCESS", "msg" : "OK models successfully retrieved from container 'Traffic-Violation_1.0.0'", "result" : { "dmn-model-info-list" : { "models" : [ { "model-namespace" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "model-name" : "Traffic Violation", "model-id" : "_2CD7D1AA-BD84-4B43-AD21-B0342ADE655A", "decisions" : [ { "decision-id" : "_23428EE8-DC8B-4067-8E67-9D7C53EC975F", "decision-name" : "Fine" }, { "decision-id" : "_B5EEE2B1-915C-44DC-BE43-C244DC066FD8", "decision-name" : "Should the driver be suspended?" } ], "inputs" : [ { "inputdata-id" : "_CEB959CD-3638-4A87-93BA-03CD0FB63AE3", "inputdata-name" : "Violation", "inputdata-typeRef" : { "namespace-uri" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "local-part" : "tViolation", "prefix" : "" } }, { "inputdata-id" : "_B0E810E6-7596-430A-B5CF-67CE16863B6C", "inputdata-name" : "Driver", "inputdata-typeRef" : { "namespace-uri" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "local-part" : "tDriver", "prefix" : "" } } ], "itemDefinitions" : [ { "itemdefinition-id" : "_13C7EFD8-B85C-43BF-94D3-14FABE39A4A0", "itemdefinition-name" : "tDriver", "itemdefinition-typeRef" : null, "itemdefinition-itemComponent" : [ { "itemdefinition-id" : "_EC11744C-4160-4549-9610-2C757F40DFE8", "itemdefinition-name" : "Name", "itemdefinition-typeRef" : { "namespace-uri" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "local-part" : "string", "prefix" : "" }, "itemdefinition-itemComponent" : [ ], "itemdefinition-isCollection" : false }, { "itemdefinition-id" : "_E95BE3DB-4A51-4658-A166-02493EAAC9D2", "itemdefinition-name" : "Age", "itemdefinition-typeRef" : { "namespace-uri" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "local-part" : "number", "prefix" : "" }, "itemdefinition-itemComponent" : [ ], "itemdefinition-isCollection" : false }, { "itemdefinition-id" : "_7B3023E2-BC44-4BF3-BF7E-773C240FB9AD", "itemdefinition-name" : "State", "itemdefinition-typeRef" : { "namespace-uri" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "local-part" : "string", "prefix" : "" }, "itemdefinition-itemComponent" : [ ], "itemdefinition-isCollection" : false }, { "itemdefinition-id" : "_3D4B49DD-700C-4925-99A7-3B2B873F7800", "itemdefinition-name" : "City", "itemdefinition-typeRef" : { "namespace-uri" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "local-part" : "string", "prefix" : "" }, "itemdefinition-itemComponent" : [ ], "itemdefinition-isCollection" : false }, { "itemdefinition-id" : "_B37C49E8-B0D9-4B20-9DC6-D655BB1CA7B1", "itemdefinition-name" : "Points", "itemdefinition-typeRef" : { "namespace-uri" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "local-part" : "number", "prefix" : "" }, "itemdefinition-itemComponent" : [ ], "itemdefinition-isCollection" : false } ], "itemdefinition-isCollection" : false }, { "itemdefinition-id" : "_A4077C7E-B57A-4DEE-9C65-7769636316F3", "itemdefinition-name" : "tFine", "itemdefinition-typeRef" : null, "itemdefinition-itemComponent" : [ { "itemdefinition-id" : "_79B152A8-DE83-4001-B88B-52DFF0D73B2D", "itemdefinition-name" : "Amount", "itemdefinition-typeRef" : { "namespace-uri" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "local-part" : "number", "prefix" : "" }, "itemdefinition-itemComponent" : [ ], "itemdefinition-isCollection" : false }, { "itemdefinition-id" : "_D7CB5F9C-9D55-48C2-83EE-D47045EC90D0", "itemdefinition-name" : "Points", "itemdefinition-typeRef" : { "namespace-uri" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "local-part" : "number", "prefix" : "" }, "itemdefinition-itemComponent" : [ ], "itemdefinition-isCollection" : false } ], "itemdefinition-isCollection" : false }, { "itemdefinition-id" : "_9C758F4A-7D72-4D0F-B63F-2F5B8405980E", "itemdefinition-name" : "tViolation", "itemdefinition-typeRef" : null, "itemdefinition-itemComponent" : [ { "itemdefinition-id" : "_0B6FF1E2-ACE9-4FB3-876B-5BB30B88009B", "itemdefinition-name" : "Code", "itemdefinition-typeRef" : { "namespace-uri" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "local-part" : "string", "prefix" : "" }, "itemdefinition-itemComponent" : [ ], "itemdefinition-isCollection" : false }, { "itemdefinition-id" : "_27A5DA18-3CA7-4C06-81B7-CF7F2F050E29", "itemdefinition-name" : "Date", "itemdefinition-typeRef" : { "namespace-uri" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "local-part" : "date", "prefix" : "" }, "itemdefinition-itemComponent" : [ ], "itemdefinition-isCollection" : false }, { "itemdefinition-id" : "_8961969A-8A80-4F12-B568-346920C0F038", "itemdefinition-name" : "Type", "itemdefinition-typeRef" : { "namespace-uri" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "local-part" : "string", "prefix" : "" }, "itemdefinition-itemComponent" : [ ], "itemdefinition-isCollection" : false }, { "itemdefinition-id" : "_7450F12A-3E95-4D5E-8DCE-2CB1FAC2BDD4", "itemdefinition-name" : "Speed Limit", "itemdefinition-typeRef" : { "namespace-uri" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "local-part" : "number", "prefix" : "" }, "itemdefinition-itemComponent" : [ ], "itemdefinition-isCollection" : false }, { "itemdefinition-id" : "_0A9A6F26-6C14-414D-A9BF-765E5850429A", "itemdefinition-name" : "Actual Speed", "itemdefinition-typeRef" : { "namespace-uri" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "local-part" : "number", "prefix" : "" }, "itemdefinition-itemComponent" : [ ], "itemdefinition-isCollection" : false } ], "itemdefinition-isCollection" : false } ], "decisionServices" : [ ] } ] } } }
Execute the model:
[POST]
server/containers/{containerId}/dmn
NoteThe attribute
model-namespace
is automatically generated and is different for every user. Ensure that themodel-namespace
andmodel-name
attributes that you use match those of the deployed model.Example curl request:
curl -u wbadmin:wbadmin -H "accept: application/json" -H "content-type: application/json" -X POST "http://localhost:8080/kie-server/services/rest/server/containers/Traffic-Violation_1.0.0/dmn" -d "{ \"model-namespace\" : \"https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8\", \"model-name\" : \"Traffic Violation\", \"dmn-context\" : {\"Driver\" : {\"Points\" : 15}, \"Violation\" : {\"Type\" : \"speed\", \"Actual Speed\" : 135, \"Speed Limit\" : 100}}}"
Example JSON request:
{ "model-namespace" : "https://github.com/kiegroup/drools/kie-dmn/_60B01F4D-E407-43F7-848E-258723B5FAC8", "model-name" : "Traffic Violation", "dmn-context" : { "Driver" : { "Points" : 15 }, "Violation" : { "Type" : "speed", "Actual Speed" : 135, "Speed Limit" : 100 } } }
Example XML request (JAXB format):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <dmn-evaluation-context> <dmn-context xsi:type="jaxbListWrapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <type>MAP</type> <element xsi:type="jaxbStringObjectPair" key="Violation"> <value xsi:type="jaxbListWrapper"> <type>MAP</type> <element xsi:type="jaxbStringObjectPair" key="Type"> <value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema">speed</value> </element> <element xsi:type="jaxbStringObjectPair" key="Speed Limit"> <value xsi:type="xs:decimal" xmlns:xs="http://www.w3.org/2001/XMLSchema">100</value> </element> <element xsi:type="jaxbStringObjectPair" key="Actual Speed"> <value xsi:type="xs:decimal" xmlns:xs="http://www.w3.org/2001/XMLSchema">135</value> </element> </value> </element> <element xsi:type="jaxbStringObjectPair" key="Driver"> <value xsi:type="jaxbListWrapper"> <type>MAP</type> <element xsi:type="jaxbStringObjectPair" key="Points"> <value xsi:type="xs:decimal" xmlns:xs="http://www.w3.org/2001/XMLSchema">15</value> </element> </value> </element> </dmn-context> </dmn-evaluation-context>
NoteRegardless of the request format, the request requires the following elements:
- Model namespace
- Model name
- Context object containing input values
Example JSON response:
{ "type": "SUCCESS", "msg": "OK from container 'Traffic-Violation_1.0.0'", "result": { "dmn-evaluation-result": { "messages": [], "model-namespace": "https://github.com/kiegroup/drools/kie-dmn/_7D8116DE-ADF5-4560-A116-FE1A2EAFFF48", "model-name": "Traffic Violation", "decision-name": [], "dmn-context": { "Violation": { "Type": "speed", "Speed Limit": 100, "Actual Speed": 135 }, "Should Driver be Suspended?": "YES", "Driver": { "Points": 15 }, "Fine": { "Points": 7, "Amount": 1000 } }, "decision-results": { "_E1AF5AC2-E259-455C-96E4-596E30D3BC86": { "messages": [], "decision-id": "_E1AF5AC2-E259-455C-96E4-596E30D3BC86", "decision-name": "Should the Driver be Suspended?", "result": "YES", "status": "SUCCEEDED" }, "_D7F02CE0-AF50-4505-AB80-C7D6DE257920": { "messages": [], "decision-id": "_D7F02CE0-AF50-4505-AB80-C7D6DE257920", "decision-name": "Fine", "result": { "Points": 7, "Amount": 1000 }, "status": "SUCCEEDED" } } } } }
Example XML (JAXB format) response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response type="SUCCESS" msg="OK from container 'Traffic_1.0.0-SNAPSHOT'"> <dmn-evaluation-result> <model-namespace>https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF</model-namespace> <model-name>Traffic Violation</model-name> <dmn-context xsi:type="jaxbListWrapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <type>MAP</type> <element xsi:type="jaxbStringObjectPair" key="Violation"> <value xsi:type="jaxbListWrapper"> <type>MAP</type> <element xsi:type="jaxbStringObjectPair" key="Type"> <value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema">speed</value> </element> <element xsi:type="jaxbStringObjectPair" key="Speed Limit"> <value xsi:type="xs:decimal" xmlns:xs="http://www.w3.org/2001/XMLSchema">100</value> </element> <element xsi:type="jaxbStringObjectPair" key="Actual Speed"> <value xsi:type="xs:decimal" xmlns:xs="http://www.w3.org/2001/XMLSchema">135</value> </element> </value> </element> <element xsi:type="jaxbStringObjectPair" key="Driver"> <value xsi:type="jaxbListWrapper"> <type>MAP</type> <element xsi:type="jaxbStringObjectPair" key="Points"> <value xsi:type="xs:decimal" xmlns:xs="http://www.w3.org/2001/XMLSchema">15</value> </element> </value> </element> <element xsi:type="jaxbStringObjectPair" key="Fine"> <value xsi:type="jaxbListWrapper"> <type>MAP</type> <element xsi:type="jaxbStringObjectPair" key="Points"> <value xsi:type="xs:decimal" xmlns:xs="http://www.w3.org/2001/XMLSchema">7</value> </element> <element xsi:type="jaxbStringObjectPair" key="Amount"> <value xsi:type="xs:decimal" xmlns:xs="http://www.w3.org/2001/XMLSchema">1000</value> </element> </value> </element> <element xsi:type="jaxbStringObjectPair" key="Should the driver be suspended?"> <value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema">Yes</value> </element> </dmn-context> <messages/> <decisionResults> <entry> <key>_4055D956-1C47-479C-B3F4-BAEB61F1C929</key> <value> <decision-id>_4055D956-1C47-479C-B3F4-BAEB61F1C929</decision-id> <decision-name>Fine</decision-name> <result xsi:type="jaxbListWrapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <type>MAP</type> <element xsi:type="jaxbStringObjectPair" key="Points"> <value xsi:type="xs:decimal" xmlns:xs="http://www.w3.org/2001/XMLSchema">7</value> </element> <element xsi:type="jaxbStringObjectPair" key="Amount"> <value xsi:type="xs:decimal" xmlns:xs="http://www.w3.org/2001/XMLSchema">1000</value> </element> </result> <messages/> <status>SUCCEEDED</status> </value> </entry> <entry> <key>_8A408366-D8E9-4626-ABF3-5F69AA01F880</key> <value> <decision-id>_8A408366-D8E9-4626-ABF3-5F69AA01F880</decision-id> <decision-name>Should the driver be suspended?</decision-name> <result xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Yes</result> <messages/> <status>SUCCEEDED</status> </value> </entry> </decisionResults> </dmn-evaluation-result> </response>
Chapter 5. Example projects and business assets in Business Central
Business Central contains example projects with example business assets that you can use as a reference for the rules or other assets that you create in your own Red Hat Decision Manager projects. Each sample project is designed differently to demonstrate decision management or business optimization assets and logic in Red Hat Decision Manager.
The following example projects are available in Business Central:
- Mortgages: (Decision management) Example loan approval process using decision assets. Determines loan eligibility based on applicant data and qualifications.
- Employee_Rostering: (Business optimization) Example employee rostering optimization using decision and solver assets. Assigns employees to shifts based on skills.
- OptaCloud: (Business optimization) Example resource allocation optimization using decision and solver assets. Assigns processes to computers with limited resources.
- Course_Scheduling: (Business optimization) Example course scheduling and curriculum decision process. Assigns lectures to rooms and determines a student’s curriculum based on factors, such as course conflicts and class room capacity.
- Dinner_Party: (Business optimization) Guest seating optimization using guided decision tables. Assigns guest seating based on each guest’s job type, political beliefs, and known relationships.
5.1. Accessing example projects and business assets in Business Central
You can use the example projects in Business Central to explore example business assets as a reference for the rules or other assets that you create in your own Red Hat Decision Manager projects.
Prerequisites
- Business Central is installed and running. For installation options, see Planning a Red Hat Decision Manager installation.
Procedure
In Business Central, go to Menu → Design → Projects and click Try Samples.
If a project already exists, click the three vertical dots in the upper-right corner of the Projects page and click Try Samples.
- Review the descriptions for each sample project to determine which project you want to explore. Each sample project is designed differently to demonstrate decision management or business optimization assets and logic in Red Hat Decision Manager.
- Select one or more sample projects and click Ok to add the projects to your space.
- In the Projects page of your space, select one of the new example projects to view the example assets for that project.
- Select each example asset to explore how the project is designed to achieve the specified goal or workflow.
In the upper-right corner of the project Assets page, click Build to build the sample project or Deploy to build the project and then deploy it to Decision Server.
NoteYou can also select the Build & Install option to build the project and publish the KJAR file to the configured Maven repository without deploying to a Decision Server. In a development environment, you can click Deploy to deploy the built KJAR file to a Decision Server without stopping any running instances (if applicable), or click Redeploy to deploy the built KJAR file and stop any running instances. The next time you deploy or redeploy the built KJAR, the previous deployment unit (KIE container) is automatically updated in the same target Decision Server. In a production environment, the Redeploy option is disabled and you can click Deploy only to deploy the built KJAR file to a new deployment unit (KIE container) on a Decision Server.
To configure the Decision Server environment mode, set the
org.kie.server.mode
system property toorg.kie.server.mode=development
ororg.kie.server.mode=production
. To configure the deployment behavior for a corresponding project in Business Central, go to project Settings → General Settings → Version and toggle the Development Mode option. By default, Decision Server and all new projects in Business Central are in development mode. You cannot deploy a project with Development Mode turned on or with a manually addedSNAPSHOT
version suffix to a Decision Server that is in production mode.To review project deployment details (if applicable), go to Menu → Deploy → Execution Servers.
Chapter 6. Additional resources
Appendix A. Versioning information
Documentation last updated on Monday, July 19, 2021.