Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Running an event-driven health management business process through a few scenarios: Part 1

 

March 31, 2020
Maurizio Carioli
Related topics:
Event-DrivenJava
Related products:
Developer Tools

Share:

    In the previous series of articles, Designing an event-driven business process at scale: A health management example (which you need to read to fully understand this one), you designed and implemented an event-driven scalable business process for the population health management use case. Now, you will run this process through a few scenarios. In this way, you will:

    • Gain a solid understanding of how the business process works.
    • Have a chance of validating if your implementation is correct.
    • Learn how to wire the user interface of the business application driven by the business process.

    Ultimately, this series is a demonstration of a population health management solution encompassing several technologies besides business process management (BPM), such as decision management (business rules), streaming data, monitoring and analytics, etc. Future posts will cover how to implement and integrate the various components.

    Prerequisites

    You need to have Java, Git, and Maven installed to follow along with this article. To ensure that you have a compatible version of Java, run the following on the console (either version 8 or 11 will do):

    $ java -version

    You also need to be able to download, install, and run jBPM on your system. In this article, I assume that the directory where jBPM is installed is jbpm-server-7.33.0.Final-dist. However, you should use the actual name you get after you unzip the jBPM single zip distribution.

    Event listeners

    Now, make sure that jBPM is not running. If you started it, just stop it or kill it. You need to clone the Git repositories that contain the projects housing the event listeners that you will use to trace process activity:

    $ git clone git@github.com:mauriziocarioli/Tracing.git
    Cloning into 'Tracing'...
    
    remote: Enumerating objects: 135, done.
    remote: Counting objects: 100% (135/135), done.
    remote: Compressing objects: 100% (61/61), done.
    remote: Total 135 (delta 66), reused 122 (delta 53), pack-reused 0
    Receiving objects: 100% (135/135), 50.28 KiB | 1.03 MiB/s, done.
    Resolving deltas: 100% (66/66), done.
    
    $ git clone git@github.com:mauriziocarioli/PHM-Tracing.git
    Cloning into 'PHM-Tracing'...
    
    remote: Enumerating objects: 58, done.
    remote: Counting objects: 100% (58/58), done.
    remote: Compressing objects: 100% (27/27), done.
    remote: Total 58 (delta 28), reused 53 (delta 23), pack-reused 0
    Receiving objects: 100% (58/58), 21.15 KiB | 21.15 MiB/s, done.
    Resolving deltas: 100% (28/28), done.
    

    Go into the Tracing directory and run:

    $ mvn install
    [INFO] Scanning for projects...
    [INFO]
    
    [INFO] -------------------< com.redhat.batigerteam:tracing >-------------------
    [INFO] Building tracing 1.0.0
    
    [INFO] --------------------------------[ jar ]---------------------------------
    

    Note: The first time you run this, it will download many jar files from the Maven central repository, which can take a long time.

    After the mvn install finishes successfully, copy target/tracing-1.0.0.jar into jbpm-server-7.33.0.Final-dist/standalone/deployments/kie-server.war/WEB-INF/lib.

    Now go up and into the PHM-Tracing directory. Run mvn install again and then copy target/phm-tracing-1.0.0.jar into the same directory as the previous jar file.

    Congratulations, you installed the tracing jars.

    jBPM projects

    Now, start jBPM. For example, on either a Mac or Linux, run:

    $ jbpm-server-7.33.0.Final-dist/bin/standalone.sh -c standalone.xml -b 0.0.0.0

    Or on Windows, run:

    $ jbpm-server-7.33.0.Final-dist/bin/standalone.bat -c standalone.xml -b 0.0.0.0

    If you worked your way through the previous series, you already know how to do what follows. Even so, this information will be useful to you in case you want to restart from scratch without having to redo your implementation.

    There are two scripts in the src/main/sh directory of the project PHM-Processes. If you are on either macOS or Linux, run the script add-users.sh. If you are on Windows (with PowerShell) run add-users.ps1. These scripts create all of the users and groups needed to test these scenarios.

    After jBPM has started, open your browser, go to http://localhost:8080/business-central/kie-wb.jsp, and log in as wbadmin with the password wbadmin.

    Set up your space

    In Business Central (Figure 1), find the Design section and click the projects link. This is where processes are designed and implemented.

    Business Central - Design - projects
    Figure 1: Business Central - Design - projects

    You will find yourself at the spaces level of the Design section. Design artifacts are organized in projects which are found in spaces. It's a basic organizational hierarchy where selective permissions can be applied both at the space and project levels. You need to create a new space named Health-Insurance and then enter this space, so the top path of any design artifacts in the projects within will be com/health_insurance.

    Add the sample projects

    In the space Health-Insurance, click the Add Project drop-down list and select Import Project as shown in Figure 2.

    Add Project - Import Project
    Figure 2: Add Project - Import Project

    Then, enter the GitHub link to the Git project repository containing the data model as shown in Figure 3.

    Import Project - Repository URL
    Figure 3: Import Project - Repository URL

    Click Import to continue. Now, repeat the project import this time with the Git repository containing the business process and subprocesses.

    You now have two projects in the Health-Insurance space (Figure 4).

    Business Central - Projects
    Figure 4: Business Central - Projects.
    Figure 4: One space containing multiple projects.

    Deploy the projects and servers

    Go into the PHM-Model project, wait for indexing to complete, and then click the Deploy button as shown in Figure 5.

    Business Central - Deploy project
    Figure 5: Business Central - Deploy project.
    Figure 5: Deploy the PHM-Model project.

    Deploy the PHM-Processes project in the same manner. Then, go to Business Central's, find the Deploy section, and click servers (Figure 6).

    Business Central - Deploy - servers
    Figure 6: Business Central - Deploy - servers.

    You should see the two deployment units shown in Figure 7. These are custom jar files (kjar files) containing the executable artifacts of each project deployed to the process server (or KIE server).

    Business Central - Server configurations and deployment units
    Figure 7: Business Central - Server configurations and deployment units.

    Figure 7: View the deployment units that this server is running.

    Clone the Get the Data repository

    You are almost done with setting everything up. You just need to clone the Get the Data service REST API's Git repository (described in the previous series), install the dependencies, and start the service on Node.js:

    4> git clone https://github.com/mauriziocarioli/PHM-API.git
    Cloning into 'PHM-API'...
    remote: Enumerating objects: 17, done.
    remote: Counting objects: 100% (17/17), done.
    remote: Compressing objects: 100% (13/13), done.
    remote: Total 17 (delta 6), reused 15 (delta 4), pack-reused 0
    Unpacking objects: 100% (17/17), done.
    [ec2-user@ip-172-31-33-184.ec2.internal/~/Demos]
    5> cd PHM-API
    [ec2-user@ip-172-31-33-184.ec2.internal/~/Demos/PHM-API]
    6> ls -al
    total 44
    drwxrwxr-x.  3 ec2-user ec2-user   127 Feb  5 15:23 .
    drwxrwxr-x. 10 ec2-user ec2-user   236 Feb  5 15:23 ..
    -rw-rw-r--.  1 ec2-user ec2-user  3636 Feb  5 15:23 app.js
    drwxrwxr-x.  8 ec2-user ec2-user   163 Feb  5 15:23 .git
    -rw-rw-r--.  1 ec2-user ec2-user   256 Feb  5 15:23 .gitignore
    -rw-rw-r--.  1 ec2-user ec2-user 11357 Feb  5 15:23 LICENSE
    -rw-rw-r--.  1 ec2-user ec2-user   360 Feb  5 15:23 package.json
    -rw-rw-r--.  1 ec2-user ec2-user 14282 Feb  5 15:23 package-lock.json
    -rw-rw-r--.  1 ec2-user ec2-user   595 Feb  5 15:23 README.md
    [ec2-user@ip-172-31-33-184.ec2.internal/~/Demos/PHM-API]
    7> npm install
    npm WARN phmapi@1.0.0 No repository field.
    
    added 50 packages from 37 contributors and audited 158 packages in 0.781s
    found 0 vulnerabilities
    
    [ec2-user@ip-172-31-33-184.ec2.internal/~/Demos/PHM-API]
    8> npm start
    
    > phmapi@1.0.0 start /home/ec2-user/Demos/PHM-API
    > node app.js
    
    running at port 3200
    

    Conclusions

    Before you could run some scenarios of this Population Health Management application you needed to install and configure several components.

    • The event listeners, which are very important to monitor as well as react to the activities in the process.
    • The jBPM projects themselves.
    • The Node.js REST service that is used to provide the data needed by the jBPM processes to execute.

    Now you are ready to go through the scenarios in the next post.

    Last updated: February 6, 2024

    Recent Posts

    • Assessing AI for OpenShift operations: Advanced configurations

    • OpenShift Lightspeed: Assessing AI for OpenShift operations

    • OpenShift Data Foundation and HashiCorp Vault securing data

    • Axolotl meets LLM Compressor: Fast, sparse, open

    • What’s new for developers in Red Hat OpenShift 4.19

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue