Red Hat Process Automation Manager logo

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.

Three-part hexagon showing the three primary steps to installing RHPAM - Setup, Explore, Experience
Figure 1.1: Setup, Explore, Experience

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:

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.

  1. Clone the Red Hat Process Automation Manager 7 Installation Demo git repository
    $ git clone https://github.com/jbossdemocentral/rhpam7-install-demo.git
  2. Copy the four zip files that you’ve just downloaded to the installs directory of the rhpam7-install-demo directory. 
  3. Run 'init.sh' or 'init.bat' file. NOTE: 'init.bat' must be run with Administrative privileges.
  4. 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

  1. Access Business Central by navigating to http://localhost:8080/business-central.
  2. Login with the following credentials
    • User: pamAdmin
    • Password: redhatdm1!
  3. Click Design then Create and modify projects and pages (see Figure 1). 
Access Business Central by navigating to http://localhost:8080/business-central. Login with the following credentials. User: pamAdmin Password: redhatdm1! Click on Design then Create and modify projects and pages. 
Figure 1: Select Design then Create and modify projects and pages

 

Select MySpace, then Import Project (see Figure 2).

Click on create MySpace then Import Projects
Figure 2: Select MySpace then Import Projects

 

  1. Use this repository: https://github.com/jbossdemocentral/rhpam7-order-management-demo-repo.git
  2. Click Import (see Figure 3).
Use https://github.com/jbossdemocentral/rhpam7-order-management-demo-repo.git select Import.
Figure 3: Input repository and select Import

 

Select the Order-Management project (see Figure 4) and click Ok.

Select the Order-Management project and click Ok
Figure 4: Select order management then Ok

 

Once the project has been imported, notice it has 27 assets (see Figure 5). Click on the filter button All. Select Process.

Once the project has been imported, click the asset filter button All then select Process.
Figure 5: After the import, filter the assets by All, then 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. 

Open the order-management process. It's implemented using the BPMN2 standard. 
Figure 6: Open the order management process

 

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.

A graphic representation of the sub-process called  Place Order in ERP
Figure 7: Place Order in ERP

 

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.

Aggregated process tasks divided into Manager, Purchaser, and Supplier
Figure 8: Aggregated process tasks

 

Close the process modeler. Filter the assets by Decision. You should see a Test Scenario and a DMN model (see Figure 9). 

Close the process modeler. Filter the assets by Decision. You'll see a Test Scenario and a DMN model. 
Figure 9: Test Scenario and a DMN model

 

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. 

Open the order-approval
Figure 10: Open the order-approval

 

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.

Close the decision asset. In your project page, click Deploy. Business Central will trigger a build of this maven project
Figure 11: Click Deploy in Business Central

 

Once the build and deployment have finished, you'll see a successful deployment message. Click on View deployment details (see Figure 12).

Once the build and deployment have finished, you'll receive a successful deployment message. Click on View deployment details.
Figure 12: View successful deployment details

 

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).

Access Business Central. Open Menu. Navigate to Process Definitions.
Figure 13: Access Business Central. Open Menu. Navigate to Process Definitions.

 

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).

Start a new process instance based on the order-management process. Click on the actions kebab, and select Start.
Figure 14: Filter the actions kebab, and select Start

 

 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.

On the form that opens, input Item Name: Laptop Dell XPS 15 and Urgency: Medium
Figure 15: Order management form

 

A new process instance will start in the engine. In order to visualize the current status, click Diagram (see Figure 16). 

A new process instance will start. In order to visualize the current status, click Diagram. 
Figure 16: New process instance

 

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 Request Offer Menu, access Task Inbox.
Figure 17: Access Task Inbox.

 

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).

In the Task Inbox, claim the Request Offer, click on the kebab and select Claim and Work
Figure 18: Select Claim and Work

 

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.

You'll see the task data available for your analysis as a knowledge worker. Input the supplied data and click Complete.
Figure 19. Input the supplied data

 

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).

A new task has been created. While you're still on the task list, claim and work the task Prepare Offer.
Figure 20. Claim and work the task

 

Click Start, fill in any date, and fill in the best offer as 1000. Click Complete (Figure 21).

Click Start, fill in any date, and fill in the best offer as 1000. Click Complete.
Figure 21. Prepare offer task board

 

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).

Confirm an unapproved request by visualizing the process instance. On the kebab, select View Process.
Figure 22. Select View Process

 

You'll be redirected to the list of process instances. Select the process instance id 1, then choose Diagram (Figure 23).

You'll be redirected to the list of process instances. Select the process instance id 1 then choose Diagram:
Figure 23. Select process instance id 1 then choose Diagram

 

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

Comments