dmn decisions execution scenarios - trisotech.com · to achieve this scenario, first create a...

12
DMN DECISIONS EXECUTION SCENARIOS Author: Simon Ringuette Publication Date: April 3rd, 2019 Version: 1.1 3100 Côte-Vertu, #420 Montréal (Québec) H4R 2J8 514 990-6639 | Trisotech.com

Upload: trinhkhanh

Post on 21-Jun-2019

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DMN Decisions Execution Scenarios - trisotech.com · To achieve this scenario, first create a project in the KIE Workbench and clone the GIT repository associated with that project

DMN DECISIONS EXECUTION SCENARIOS

Author: Simon Ringuette

Publication Date: April 3rd, 2019

Version: 1.1

3100 Côte-Vertu, #420 Montréal (Québec) H4R 2J8

514 990-6639 | Trisotech.com

Page 2: DMN Decisions Execution Scenarios - trisotech.com · To achieve this scenario, first create a project in the KIE Workbench and clone the GIT repository associated with that project

1

Introduction

The Trisotech DMN Modeler contains all the features required to analyze, develop and test decision models. A very common path when working with DMN decisions is to deploy these decisions as decision services in an execution environment to invoke them from external business logic.

Trisotech offers three different scenarios to move from modeling to execution of decision services:

• Trisotech Cloud Execution: a turnkey deployment solution. • Red Hat Connector: an integrated deployment bridge to the Red Hat Decision Manager (KIE Platform). • DMN XML interchange: an open solution based on standards to execute decisions.

This document further explains how to achieve these scenarios as well as their capabilities and constraints.

Page 3: DMN Decisions Execution Scenarios - trisotech.com · To achieve this scenario, first create a project in the KIE Workbench and clone the GIT repository associated with that project

2

Scenario 1: Trisotech Cloud Execution

This scenario does not require any technical setup and is offered through subscription options along with the Trisotech DMN Modeler.

In this scenario, you can publish directly from the DMN Modeler to the Cloud Execution platform. The Service Library can then be used to browse the deployed decision models.

The Trisotech Cloud Execution is a very flexible environment that offers:

• A REST API to invoke decisions using XML, JSON and our smart XML binding that lets you use your own XML documents as input

• An automatically generated web form to invoke and test decisions • A REST API to test decisions following the DMN TCK format • Configurable audit trail of decision execution • The ability to invoke multiple versions of a decision by version number or to always invoke

the latest • Multiple deployment environments (development, test, production, …) secured by an Access Control List (ACL)

to control user rights to the environments • Scalable environments that can adjust to various levels of load • A debugging environment to troubleshoot system integration and decision execution • Open API documentation of the decision invocation endpoint

publish index

Page 4: DMN Decisions Execution Scenarios - trisotech.com · To achieve this scenario, first create a project in the KIE Workbench and clone the GIT repository associated with that project

3

Decisions deployed in the Trisotech Cloud Execution are automatically indexed by the Service Library. The Service Library offers:

• Complete live documentation of the deployed decisions • Search, filter and sorting of your published decisions • Promotion of decisions between environments • Technical documentation to invoke the decisions through REST • User interface for the execution of defined test cases for decisions • Comparison of execution environments • Lifecycle management of the decisions

Page 5: DMN Decisions Execution Scenarios - trisotech.com · To achieve this scenario, first create a project in the KIE Workbench and clone the GIT repository associated with that project

4

Scenario 2: Trisotech Red Hat Connector

The Trisotech Red Hat Connector offers an integration for customers wanting to execute DMN Decisions using their own infrastructure. This scenario has 3 major variants with different levels of complexity, requirements and IT involvement. This connector is offered as a subscription option with the Trisotech DMN Modeler.

All variants begin with being able to directly publish from the DMN Modeler to the Execution Repositories. These repositories are exposed to Red Hat using the Maven Protocol. The Maven Protocol is widely used in software development to manage the versions of published artifacts. Red Hat uses Maven to provision their execution environment. The Trisotech Execution Repositories support multiple environments (development, test, production, …) secured by an Access Control List (ACL) to control user rights to the repositories. This means that you can connect multiple independent Red Hat environments (development, test, production) to the same Trisotech Digital Enterprise Suite.

Variant 1: Simple deployment

In this variant, a single Red Hat KIE Server is deployed and connected directly to an Execution Environment through the Maven Protocol. You need to configure the KIE Server access to the Trisotech Execution Environment, refer to the appendix about Maven Configuration.

Trisotech Digital Enterprise Suite

KIE Server

publish

download

Trisotech Digital Enterprise Suite

Your infrastructure

Page 6: DMN Decisions Execution Scenarios - trisotech.com · To achieve this scenario, first create a project in the KIE Workbench and clone the GIT repository associated with that project

5

To deploy a decision, first publish it in the DMN Modeler using the Red Hat button in the Execution Ribbon. Set a group and artifact identifier as well as a version, those will be re-used after publication to deploy the decision in the KIE Server.

Once a decision is published in the Execution Environment, you can create a KIE Container in the KIE Server with that decision. As an example, you can use the CURL command line to do it:

curl -i -X PUT -H "Authorization: Basic [proper authorization]" -H "Content-Type: application/xml" -d @kiecontainer.txt [kie server url]/services/rest/server/containers/[kie-container-id]

In this command, send the proper authorization (base64 encoded of username:password) and use the proper KIE Server URL (ex: http://localhost:8080/kie-server)

The kieconatiner.txt should contain an XML message to create the KIE Container such as:

<kie-container container-id="[kie-container-id]"> <release-id> <group-id>[group id]</group-id> <artifact-id>[artifact id]</artifact-id> <version>[version]</version> </release-id> </kie-container>

In this XML file, you will need to provide a KIE Container identifier that you will re-use to call decisions through the REST API. You will need to also re-use the group and artifact identifier as well as the version that was used to publish the decision in the Trisotech Execution Environment.

Once the KIE Container is created, you can now use the standard REST API of Red Hat to invoke your decision.

Page 7: DMN Decisions Execution Scenarios - trisotech.com · To achieve this scenario, first create a project in the KIE Workbench and clone the GIT repository associated with that project

6

Variant 2: Flexible deployment

This variant differs from the previous one by introducing the KIE Controller component (part of the KIE Workbench). This controller’s purpose is to manage the KIE Containers deployed on the connected KIE Servers. This adds the benefit of providing scalability as all KIE Servers will be configured identically by the controller.

In this configuration, the KIE Servers still need to be configured to access a Trisotech Execution Environment by referring to the Maven Configuration appendix.

The major difference in this variant is that the KIE Workbench provides a user interface on the KIE Controller to configure the KIE Servers and deploy KIE Containers.

To deploy a decision, first publish it in the DMN Modeler using the Red Hat button in the Execution Ribbon. Set a group and artifact identifier as well as a version, those will be re-used after publication to deploy the decision in the KIE Server.

Once a decision is published in the Execution Environment, you can create a KIE Container by using the Workbench UI under Deploy -> Execution Servers. From this interface, you will see all KIE Servers connected to this controller and be able to add a KIE Container by using the group and artifact identifier as well as the version that was used to publish the decision in the Trisotech Execution Environment.

Each connected KIE Server will then contact the Execution Environment to obtain a copy of the published decision through the Maven Protocol.

Your infrastructure

KIE Server KIE Server

KIE Server

KIE Workbench

(KIE Controller)

publish

configure

download

Trisotech Digital Enterprise Suite

Your infrastructure

Page 8: DMN Decisions Execution Scenarios - trisotech.com · To achieve this scenario, first create a project in the KIE Workbench and clone the GIT repository associated with that project

7

Variant 3: Low management deployment

This variant differs from the previous one by using the Red Hat Connector as a deployment controller instead of the Red Hat KIE Controller. Using the Red Hat Connector, you lose the benefit of closely controlling which version and which artifacts the KIE Server uses but this scenario does not require an additional step to deploy decisions on the KIE Servers.

In this variant, the Red Hat Connector configures the KIE Servers (also viable for a single KIE Server) with the latest version of all published decisions in the execution environment.

To deploy a decision in this scenario, in the DMN Modeler, click on the Red Hat button in the Execution Ribbon. Set a group and artifact identifier as well as a version. If this is a new decision or a later version of an existing decision, it will be deployed automatically using the container name:

groupId:artifactId

Each connected KIE Server will then contact the Execution Environment to obtain a copy of the published decision.

KIE Server(s) will need to be connected to the Red Hat Connector controller using the web socket URL provided in the Red Hat Connector application.

KIE Server KIE Server

KIE Server

publish

download

Trisotech Digital Enterprise Suite

Your infrastructure

Page 9: DMN Decisions Execution Scenarios - trisotech.com · To achieve this scenario, first create a project in the KIE Workbench and clone the GIT repository associated with that project

8

Scenario 3: DMN XML Interchange

This scenario is the most flexible and works through a DMN XML transport. Using this scenario, you can deploy to any execution environment supporting the DMN XML format.

For this scenario, you will need to export your DMN model to XML from the DMN Modeler and then import that XML file in the third-party execution environment.

As an example, if we use Red Hat KIE Workbench as a target execution environment:

Using standard KIE Workbench integration, DMN Models produced from the Trisotech DMN Modeler are transported using DMN XML and pushed in the GIT Repository of the KIE Workbench.

To achieve this scenario, first create a project in the KIE Workbench and clone the GIT repository associated with that project. In the DMN Modeler from Trisotech, export your Decision as a DMN 1.1 XML file and save it to the cloned GIT repository structure. Commit and push your changes to the KIE Workbench. After that, you can follow the normal build pipeline of the KIE Workbench.

This scenario can also be achieved using other DMN Execution vendors if they support the DMN XML standard. A good source for engines support of DMN can be found through the DMN Technology Compatibility Kit (DMN TCK) at: https://dmn-tck.github.io/tck/.

Trisotech Digital Enterprise Suite

Your infrastructure

DMN XML

KIE Server KIE Server

KIE Server

GIT

REPO

export

git push

KIE Workbench

(KIE Controller)

configure

Page 10: DMN Decisions Execution Scenarios - trisotech.com · To achieve this scenario, first create a project in the KIE Workbench and clone the GIT repository associated with that project

9

Appendix: Maven Configuration

To connect a KIE Server to a Trisotech Execution Environment, you will need to follow these few steps.

First, you need to obtain an API Token from the Trisotech Digital Enterprise Suite. As an administrator of the suite, access the Admin tile of your DES instance. Under the Client Apps tab, create a new App.

You need to select the Execution Repositories Read grant.

You can now obtain a token using the token icon (last actions at the end of the row). This will generate an access token for this app as the logged-in user to access the execution repositories. Make sure that you have access to the execution environment that you will want to connect. You can view those settings in the Execution tab of the Admin interface. You can also use the token generation URL as a different user to generate a token for a user that has access to the Execution Environment.

Page 11: DMN Decisions Execution Scenarios - trisotech.com · To achieve this scenario, first create a project in the KIE Workbench and clone the GIT repository associated with that project

10

Once you have obtained a token from the Trisotech DES, you will need to configure the Maven settings of the machine running the KIE Server to connect to the Trisotech Execution Environment. Modify your .m2/settings.xml file located in the home directory of the KIE Server to include the following:

<servers> <server> <id>trisotech</id> <configuration> <httpHeaders> <property> <name>Authorization</name> <value>Bearer [token]</value> </property> </httpHeaders> </configuration> </server> </server> <profiles> <profile> <id>trisotech</id> <repositories> <repository> <id>trisotech</id> <name>Trisotech Execution Environment</name> <url>[instance URL]/maven/[execution environment id]</url> </repository> </repositories> <activation> <activeByDefault>true</activeByDefault> </activation> </profile> </profiles>

You will need to replace

[token] The token obtained in the previous step. If the token is ABC, the value should be: Bearer ABC.

[instance URL] The URL of your Digital Enterprise Suite (DES). Ex: https://mycie.trisotech.com

[execution environment id] The execution environment identifier. Ex: test

Page 12: DMN Decisions Execution Scenarios - trisotech.com · To achieve this scenario, first create a project in the KIE Workbench and clone the GIT repository associated with that project

11

DISCLAIMER

The following is intended to outline Trisotech perspective and general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for Trisotech’s products remains at the sole discretion of Trisotech. The intention of this white paper is to inform on the various execution possibilities of DMN models and should not be considered professional advice. This document presents a selected set of scenarios and Trisotech does not provide any guarantee that these scenarios will still exist in the future. The information is provided as-is, without guarantee nor legal binding. While we make every effort to ensure that all information in this white paper is accurate and up to date, Trisotech should not be held liable for errors and omissions. You should always consult your Customer Success contact for contextualized advice on the best scenario that best applies to your reality and fulfill your constraints.

3100 Côte-Vertu, #420 Montréal (Québec) H4R 2J8

514 990-6639 | Trisotech.com