Process Automation Hello World
This guide shows you how to implement Red Hat Process Automation Manager (RHPAM) to author, deploy, and execute your business automation applications. With three steps, this Hello World (Figure 1.1 ) will guide you from installing your business applications to testing them.
First, we'll install RHPAM locally, and run it on top of Red Hat JBoss EAP (WildFly). Once we have RHPAM up and running, we'll import an existing application to show you an overview of some of RHPAM's capabilities, and we'll also explore the tool and the project itself. Finally, we'll wrap up our installation guide by deploying the project and testing it.
1. Setting up your environment
Pre-requisites
Install Java JDK 11 and GIT client on your machine. If you don't have Java JDK 11 yet, you can download OpenJDK built by Red Hat.
Process Automation Manager can be installed via the graphical installer or via the ZIP distributions. In this Hello World, we'll use the ZIP distributions because it makes automated installations easier. If you'd rather use the graphical installer, you can download it here.
Installing Process Automation Manager in three steps
Download
Let's start by downloading the files we need: JBoss EAP, and the two main components of Process Automation Manager: Business Central and Kie Server:
- Red Hat JBoss EAP 7.3
- RHPAM - Business Central, deployable zip
- RHPAM - KIE Server, deployable zip
- RHPAM Add-ons
The installation is straightforward, so let's get started! In this Hello World, we'll use an installer that can install EAP and RHPAM and configure the environment for us.
- Clone the Red Hat Process Automation Manager 7 Installation Demo git repository:
$ git clone https://github.com/jbossdemocentral/rhpam7-install-demo.git
- Copy the four zip files that you’ve just downloaded to the installs directory of the rhpam7-install-demo directory.
- Run 'init.sh' or 'init.bat' file. NOTE: 'init.bat' must be run with Administrative privileges.
- Once the installation finishes, you should see a success message in your terminal along with environment information.
Start your environment
To start the environment, bootstrap JBoss EAP with the command output in your terminal. Your screen should look something like this.
- For Linux/OSx
/target/jboss-eap-7.3/bin/standalone.sh
- For Windows
\target\jboss-eap-7.3\bin\standalone.sh
2. Explore
Congratulations! You have successfully installed Process Automation Manager. You now have two key components deployed in your EAP right now: Business Central and KIE Server. Business Central is a component that allows you to develop processes and decisions and use those processes to manage, build, and package projects . KIE Server is a lightweight engine capable of executing business assets like processes, cases, and decisions, and can be easily integrated with your services via REST or JMS.
Luckily, Process Automation Manager comes with a number of out-of-the-box templates and example applications that you can use to quickly build and deploy a process microservice.
Accessing Business Central
Let's start by accessing Business Central.
- Access Business Central by navigating to http://localhost:8080/business-central.
- Login with the following credentials
- User: pamAdmin
- Password: redhatdm1!
- Click Design then Create and modify projects and pages (see Figure 1).
Select MySpace, then Import Project (see Figure 2).
- Use this repository: https://github.com/jbossdemocentral/rhpam7-order-management-demo-repo.git
- Click Import (see Figure 3).
Select the Order-Management project (see Figure 4) and click Ok.
Once the project has been imported, notice it has 27 assets (see Figure 5). Click on the filter button All. Select Process.
Open the order-management process. This is the automated process that determines the approval or denial of an order request. As you see in Figure 6, it's implemented using the BPMN2 standard.
The final element of this process is a sub-process, Place Order in ERP (see Figure 7). This subprocess includes advanced bpmn2 modeling concepts like compensation and event-based gateways. Note: RHPAM supports the modeling of advanced flows using the bpmn2 specification.
Notice these process tasks are aggregated into three lanes: Manager, Purchase, and Supplier. The approval decision will be made based on multiple authors, but in this process, we have the support of an automated decision. The automated decision is made on the node Auto Approve Decision (see Figure 8), which references a DMN Model that's also part of this business project.
Close the process modeler. Filter the assets by Decision. You should see a Test Scenario and a DMN model (see Figure 9).
Open the order-approval (see Figure 10). It's a simple decision model that defines the Approve decision based on the data input Order Information and on the Price Tolerance business rules.
Close the decision asset. On your project page, click Deploy as shown in Figure 11. Business Central will trigger a build of this Maven project that will be packaged in a KJAR (the deployment unit which contains the assets) and deployed on the KIE server.
Once the build and deployment have finished, you'll see a successful deployment message. Click on View deployment details (see Figure 12).
The page will show a running “default-kieserver” with the “order-management_1.1-SNAPSHOT” container deployed. Our business project is now available to be consumed by client applications!
Let's have a look at how we can consume this business application.
3. Experience
The KIE Server engine is the service that exposes the business project and is also the service we use when integrating with client applications. KIE Server comes with a Swagger UI that allows us to test the RESTful endpoints of the engine and consume rules deployed on it.
Another way to consume our business project is to use Business Central UI to interact with the engine and test our business assets. For this Hello World, let's use the Business Central process and task management capabilities.
In Business Central, let's open Menu in the top bar and navigate to Process Definitions (see Figure 13).
There are three different process definitions. We'll start a new process instance based on the order-management process. Click Actions, and select Start (see Figure 14).
The form that opens (see Figure 15) is also part of our business process. We can customize it if needed. For now, let's only fill in the data required to start our process instance:
- Item Name: Laptop Dell XPS 15
- Urgency: Medium
Select Submit.
A new process instance will start in the engine. In order to visualize the current status, click Diagram (see Figure 16).
Now we have a Human Task named Request Offer waiting for human intervention. Let's work on this task. In the Menu, access Task Inbox (see Figure 17).
In the Task Inbox, you should see a list of tasks you have permission to see and work on. Let's claim the Request Offer task for our user and start working on it. Click on Actions and select Claim and Work (Figure 18).
You'll see the task data available for your analysis as a knowledge worker (someone responsible for executing the task). Click Start to start working on the task (Figure 19).
Based on this offer, we'll define our reply. Supply the following data:
- Category: optional
- Target Price: $250
- Supplier list: supplier 1
Click Complete.
A new task has been created for the suppliers. The supplier should provide an offer. While you're still on the task list, claim and work the task Prepare Offer (Figure 20).
Click Start, fill in any date, and fill in the best offer as 1000. Click Complete (Figure 21).
Oh no! The automatic approval was already taken, and our request was not automatically approved. You can confirm this by visualizing the process instance. On the kebab, select View Process (Figure 22).
You'll be redirected to the list of process instances. Select the process instance id 1, then choose Diagram (Figure 23).
Great job! You've learned how to manage processes and tasks using Business Central. You've also figured out how to start new process instances, how to interact with the process tasks, and how to complete them.
What about finishing this process on your own? Following the same idea in Business Central, you can reprove the request, reject the order, and reach the end of this process instance.
Conclusion
Congratulations! You've successfully completed our Hello World in Process Automation Manager. In this guide, you installed RHPAM, imported a project directly from GitHub, and checked out both a process definition model and an automation decision. You wrapped up the Hello World by deploying and testing your services using a Business Central UI. If you want to know more about the Order Management demo, we recommend you take a look at the project's instructions.
Last updated: June 17, 2021