Providing a runtime for our process

Process definitions are not considered standalone components in the KIE Workbench, but part of a project instead. These projects contain all the configurations to provide a runtime environment for our processes, and in order to get the most out of the KIE Workbench, we need to know how to configure a runtime for them. To do so, we need to edit certain properties of the project, deploy it, and decide in what manner we are going to run our processes.

The project editor

From the Tools option in the action toolbar of the Project Authoring perspective, we have one of the tools we can use to configure our runtime in the KIE Workbench—the Project Editor tool. In it, we can define through user-friendly tools all the KIE Module and Maven project-related components, such as project dependencies and knowledge base and session configuration.

From a process runtime point of view, this is where we should start working to check that our processes will have all the extra components they will need to work inside the KIE Workbench directly, such as Work Item handler configurations, dependencies where rules or other processes might be defined that our process definition needs to run properly, whether it should run with persistence or not, and so on.

The full extent of this configuration exceeds the scope of this book. To get a full explanation of this editor, visit the jBPM6 documentation.

Build and deploy

Once all the components in our project are ready to be compiled, all the required dependencies are defined, and all knowledge configurations have been settled, we need to create a compiled unit with the project assets. In our project, where we only have a process definition with a very basic data model (which doesn't define extra classes), we have reached said state, so we're ready to compile the project. For that, the project editor comes with its own toolbar with a Build & Deploy button:

Build and deploy

Upon clicking on this button, the project editor will try to compile all the project assets into a JAR file and deploy it to the local Maven repository. From then onwards, we are just one configuration away from having a running environment for our process definition.

Configuring the deployment unit

Once the KIE Module project is compiled and installed in the Maven repository, we can define an environment for it to run in a standardized way. This environment will be available from the Deploy | Deployments perspective in the KIE Workbench, and it is called Deployment Unit.

A deployment unit is a specific configuration based on a KIE Module that will define one KIE base, one KIE session, and one runtime manager type to define a way to run process instances. A project might define multiple KIE bases or KIE sessions. Even if it defines just one of each, you still might want to create different configurations whether you share statuses between different process instances or not. Deployment units allow you to configure these components to define the exact configuration in which specific instances will run later on.

To configure a deployment unit, you need four things: a KIE Module, identified by a Maven release ID, composed of group, artifact, and version, that can be defined in the project editor seen in the previous chapter, a specific KIE base name (can be default), a specific KIE session name (can also be default), and a runtime manager type (can be singleton, by process or by request). We'll look at runtime managers in more detail in Chapter 7, Defining Your Environment with the Runtime Manager.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset