Reusing Your Workflow and Assets on Red Hat Process Automation Manager
Sometimes you want to reuse the assets which you are already creating, and “import” it on multiple other projects. We can use that on RHPAM (or its opensource version, which is jBPM) because the output of it is actually a kjar (knowledge jar) file, which is just a jar library where you can import it by using a simple maven.
For this example im creating two different project, Project 01 and Project 02. Where Project 01 have a workflow that will import a Decision Table which is created on Project 02. It is basically a simple calculator to measure how wealthy someone is, based on one’s salary.
Lets start with Project02 first, and as always we start with a simple Java bean
We will use that decision table in a very simple workflow,
Next is the unique part, where we need to create a KIE base for Project02
“Default” option should be un-check for KIE bases and KIE session on Project02.
The last step for Project02 is to build, and install it.
Next is how to import Project02 into Project01. First thing that we need to do is to import Project02 on Project01’s dependency.
Create a workflow, and put a “Reusable Sub-Process” referring to our Project02 workflow.
And finally, create a KIE base for Project01
Make sure you check “Default” option for KIE bases and KIE session on Project01.
Build, Install and Deploy Project01 to KIE server, and we can test by using a simple CURL REST API command or by using Postman
For complete code, can be accessed here.
https://github.com/edwin/Project01 https://github.com/edwin/Project02
No Comments