Kie Workbench

There is one more component we have briefly mentioned before, Kie Workbench. Kie Workbench is a web environment where we can create and test all sorts of Kie assets, such as rules, processes, and data models. It is a very useful tool to include business people with little technical knowledge of the specifics of implementation into the development cycle, because it provides a user-friendly environment for rule writing. Go to chapter-11-workbench-tests, compile it, and run the standalone script from the target/wildfly.8.1.0.Final/bin/ folder to start the environment. After it starts, go to http://localhost:8080/kie-wb on your machine and log in using the "testuser" username and test password to get to the following page:

Kie Workbench

Tip

Note: it will take a few minutes to start, so if you get a 404 from the URL, just give it a few more minutes to load

Once it loads, we will be able to see the options involving authoring Kie Assets if we go to the Authoring | Project Authoring option in the top menu:

Kie Workbench

From the opening perspective, we will have a lot of screens available, where we will be able to create rules, processes, data models, and many more elements using the New Item option. We can also create new projects to group these assets, and they will be internally managed as Maven projects versioned inside (also internally) a Git repository. We have a few predefined projects to start playing with.

We will open the mortgages project editor. To do so, we'll click on the uf-playground option next to the demo organizational unit (in the Project Explorer screen on the left), and then on the mortgages option in the list next to it. Once that is open, click on the button that appears over the listboxes, called Open Project Editor. Then, on the opening editor we can see to the right, we will see a set of options on the top. Clicking on the Build option will display the Build & Deploy option, and clicking on it will deploy the project in an internal Maven repository:

Kie Workbench

We will use this deployed project to test a Kie Execution Server. There is a very large set of tools we could use inside the Kie Workbench, but unfortunately we cannot explain them all within this book. There is a very good set of training sessions for using the Workbench features available online, created by Eric D. Schabell. You can find them at the following URL: http://bpmworkshop-onthe.rhcloud.com/brms6_1/lab01.html.

We will concentrate on the specific components of the Kie Workbench that bind it to the Kie Server we just discussed. Once we have built and deployed a project, it will be available inside the Maven repository exposed by the workbench (for the mortgages project, it can be found at http://localhost:8080/kie-wb/maven2/mortgages/mortgages/0.0.1/mortgages-0.0.1.jar). This JAR will be available with the same credentials used by the Kie Workbench. From there, we can perform deploys through the UI to any Kie Execution Server we have available. To do so, we must go to the top menu option Deploy | Rule Deployments, and click on the Register button:

Kie Workbench

We've already deployed a Kie Execution Server inside the same environment, using the customized WAR we created in the previous section. In order to be able to deploy to it, we must register it with the proper data. The Identifier property must have the base REST endpoint of the Kie Server. For our environment, it will be http://localhost:8080/kie-server/services/rest/server. For the Name property, we will just write some identifying text, such as devguide-server.

Once the Kie Server is created in the Rule Deployments view of the Kie Workbench, we can select it and click on the plus sign visible on the right of the devguide-server line. By clicking on that button, we can see a window with a form to deploy a specific container in the given Kie Server. We will use it to deploy the mortgages project, as shown in the following screenshot:

Kie Workbench

After we deploy the container, we can see its details by clicking on the small arrow to the right of the created container (it will appear right below the plus sign button we clicked before). We can also select it by clicking on the radio button to the left of the created container, and clicking on the Start button on the top left of the Rule Deployment screen. After you deploy and start the container, it can start resolving requests with the rules and processes defined in the given project.

Using these tools can allow non-technical people to write, deploy, and execute rules, without having to write a single line of code in a conventional IDE setup. Everything can be done through the tool. This allows business specialists to be more easily introduced to the realm of rules, and can be a great tool to help them collaborate in the development process of Drools-based projects.

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

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