Eric D. Schabell: December 2014

Wednesday, December 31, 2014

2014 in review - JBoss Integration & BPM in the wild

My last article for 2014... the year in review where I meander through the highlights of my work, play, cycling, writing, and travels for the past year.

This year marks the third year in my current role at Red Hat as a JBoss Technology Evangelist, covering the Integration & BPM technology products. This was the first time I got to focus on just two products, JBoss BRMS & BPM Suite as we expanded the team with a few new additions in May.

A major event this year was the release of JBoss BRMS 6 and JBoss BPM Suite 6 with three minor releases following within 2014.

I spent a lot of time traveling to talk about these products and to also preach on the topics of PaaS with OpenShift, but I must admit that there too I was mostly focusing on how to get started with JBoss BPM and rules technologies.

Not to be forgotten, the jbpmmigration project continued to evolve and was officially added into the product. Always nice to be able to contribute something to our efforts to help customers.

Another fun fact, I was inducted into the OpenShift Accelerator Program this year.

We also welcomed a Japanese translator Hisao Furuichi to this blog and you might have noticed the links to his work as they appear on the posts he translates for the local community in Japan.

Writing

Aside from the articles here (135), content published on DZone (82) and my continuing side writing for the Red Sox fan site RedSoxLife.com (94), I also found time to publish an e-book. This was a follow up to the original OpenShift Primer I put out last year, with an update and more content added to flush out the book. It is available online at all the major e-book outlets.


On top of this writing I also published various video tutorials on Vimeo and Youtube. Along with these tutorials you will find many new demo projects that were migrated to JBoss Demo Central on github, your one stop shopping for all things related to JBoss Integration & BPM products.

Travel

The places I went and the people I met are what make the efforts we put into JBoss worth the time and jet-lag. I wish I would be able to list everyone and every place but that is just not possible. I enjoyed the chats, the beers, the hanging out, the presentations, the workshops, the dinners, lunches and meetings with each and every one of you.

Here are some of the 32 cities I visited in 9 countries this year, just to give an impression of the spaces we covered while I told stories around JBoss, BPM, Rules, Events, PaaS, xPaaS and OpenShift.
  • Singapore
  • Tokyo
  • Boston (4x)
  • Chicago
  • Toronto
  • Amsterdam
  • San Francisco (2x)
  • Portland
  • Seattle
  • London
  • Krakow
  • Washington, DC (2x)
  • Munich
  • Antwerp
  • Dallas
  • Raleigh (2x)
  • Paris
  • Farnborough 
  • Berlin
This was all to facilitate various conferences, Java User Groups (JUG's), partner events, customer workshops and JBoss User Groups (JBug's).

Online workshops

One of the major items worth mentioning is an online workshop series that I released here on this blog over the course of 17 articles. It is a full blown walk through showing you how to build a project from scratch for both JBoss BRMS and then JBoss BPM Suite.

There has been a massive response to this and after feedback it has evolved into the version you see now that has been presented at various partners, customers and JUG's around the world.



Thanks again

I certainly hope you enjoyed what we were able to bring to you in 2014 and I want to thank you personally for attending any of the webinars, conference sessions, workshops, JUG's, and JBug's were our paths might have crossed or for just taking the time to read a published article.


We have a lot planned for more fun and excitement in 2015 so please join us for the ride!

Monday, December 29, 2014

Overview of Governance Integration with JBoss BPM Suite (video)

Back in the summer I got the chance to work with Kurt Stam, one of the founders of S-RAMP, where we put together a JBoss BPM Suite demo that integrated the existing governance tooling.

The details around how to install and run through the various aspects of building, deploying and promoting a real life BPM project artifact through DEV - QA - STAGED - PROD environments has now been captured for you in this 10 minute video.



Enjoy!

Tuesday, December 23, 2014

3 Reasons You Need The New JBoss Travel Agency

(Article guest authored together with Niraj Patel and Shepherd Chengeta, both Inside Solution Architects working in Red Hat EMEA)

This week we are bringing you a new project release for the JBoss BPM Suite Travel Agency project.

It was released in October this year and showed us how to excite the travel industry with a demo project that could demonstrate the following aspects in a bookings process:
  • custom task forms built with forms modeler
  • a sub-process example 
  • two separate service tasks
    • hotel availability service
    • flight availability service
  • rules integration
    • DRL rules
    • decision table
    • diverse guided rules
  • multiple testing scenarios
    Main travel agency process.
The process was a simple bookings process where a user submits a request to travel from one city to another between certain dates. After that the process would kick off two services, one to gather hotel rooms based on availability and another to gather flight information for the given dates. Rules were used to determine the pricing, after which the data gathered was presented in a task form for an agency user to evaluate as complete or needing review by a manager.

The following three features are what makes the JBoss Travel Agency project a must have for your BPM demo arsenal.

Book holiday process with compensation.

1. BPM compensation

The part missing in this story was the actual payment for the approved travel request by the submitting customer.

The team dug into this problem and came up with an extension to the original process that called a new sub-process called Book Holiday.

The original task form presented to the travel agent now was adjusted to ask for credit card information from the customer if the booking is approved. This information will be passed to the new sub-process for billing the fees involved with the flights and hotel rooms being booked by the customer.
Successful path (grey) where no compensation took place.

This new sub-process node calls a process called CompensateService where we see two separate services, one used to facilitate charging the customer for the flights and another for the hotel rooms chosen in the final booking.

Attached to these services are compensation nodes, that are triggered if there is a problem detected at the final gateway, where we then trigger the compensation to take place.

The trick here is that we create a use case where any credit card entered that starts with the numbers 1234... will be considered to belong to a list of fraudulent cards and require a roll back of the booked flights and rooms.
Compensation took place (grey), rolled back credit charges.

This is the compensation path (marked with red nodes) and triggers the compensation paths (marked with pink nodes) before ending the process.

When compensation takes place then the sub-process is ended, returning back to the main process which then also ends.

2. External UI to start process

Compensation was not the only addition to this project, there are a few more new interesting bits to share.

First off, there is an external UI form created to start the Travel Agency process outside of the JBoss BPM Suite generated forms.

This form can be found deployed with the demo project at http://localhost:8080/external-client-ui-form-1.0 if deployed at the default localhost location.

External UI based on RestAPI to start process instances.
The code for this web form can be found under the directory projects/external-client-ui-form-1.0 for your inspection. This project is built by default and deployed into the JBoss BPM Suite server when the demo project is installed using the provided instruction.

3. JSON base process client

The final item is that for the first time we have an incubation project added into the projects directory at projects/instance-generator. This was created by EMEA Senior Solution Architect, Andrea Ubbiali and is a twist on the standard Java class that wrapped the RestAPI to start a series of process instances at once for demo purposes.

See the readme file in this project for how to build by hand and what the details are around the JSON implementation to start new process instances.

Get started today

To get started we provide a quick set of instructions to help you get the Travel Agency demo project up and running with a minimum of fuss:
  1. Add products to installs directory. For example download and add BPMS installer jar into the installs directory.
  2. Run 'init.sh' or 'init.bat' file. 'init.bat' must be run with Administrative privileges.
  3. Start JBoss BPMS Server by running 'standalone.sh' or 'standalone.bat' in the /target/jboss-eap-6.1/bin directory.
  4. Login to http://localhost:8080/business-central
    - login for admin and other roles (u:erics / p:bpmsuite1!)

Tuesday, December 16, 2014

Jump Start Your Rules, Events, Planning and BPM Today

If you are looking to get started with rules, events, planning and BPM projects we have posted here on this site a myriad of examples to get you going.

There are both a JBoss BRMS starter kit and a JBoss BPM Suite starer kit which ties these projects together in a sensible order for you to get going.

This article is to present the work being done the last few weeks on these projects. It is ongoing and focuses on better support for the windows user experience when installing these projects.

Below are the currently updated and tagged projects that have been polished up for windows users based on the product split on functionality of rules, events, planning and BPM.

Rules, events and planning

The following projects have been updated to include improved windows installation support in the init.bat script used to install them:


Rules, events, planning and BPM

The following projects have been updated to include improved windows installation support in the init.bat script used to install them:

Integration projects

These projects are examples of the integration possibilities when looking to leverage multiple products from the JBoss middleware stack in your solutions:
Most this is but a start, more will follow and you can monitor our progress on Twitter as we move forward on these projects.

A bit thanks goes out to our specialist in the windows user experience, Andrew Block, so please give him a shout out on Twitter to thank him for his efforts!


Friday, December 12, 2014

2 Creative JBoss Must Have Items We Love

JBoss stickers have arrived!
Just a short time ago we showcased the historical JBoss BPM Suite & JBoss BRMS stickers along with a few new ones around xPaaS that you can use to liven up your laptops, coffee mugs and just about any surface you want.

Since then we have not sat still, not with the year end holidays just around the corner!

Not only have the new stickers that were ordered arrived, but there are a few last year end events where you can score some really cool JBoss BPM Suite items.

These are the must have items from the 2015 BPM conference season and you can't buy them in stores near you.

The perfect room key.
To obtain one of these amazing keepsakes you will need to locate them in the wild, track down an elusive JBoss BPM Evangelist or Product Manager.

1. Key card

This card is used right now in Las Vegas at the Gartner BPM Conference as your room key. It features the JBoss BPM Suite sponsored slogan of Do Not Disturb

That sure beats the usual hanging sign on a hotel room door, doesn't it?

Nothing quite like that out there compares to this original card that will most likely mean you won't be turning in your hotel room key when you leave.

Rest assured with BPM!

2. Neck pillow

This item is something every BPM traveler should have, a neck pillow. It will get you through the train, bus or plane rides as you make your way to work every day.

Where else can you find such an interesting and useful item related to JBoss and BPM?

We wish you happy hunting as you try to track these items down in the coming months.

You have to admit... JBoss BRMS & BPM Suite have the coolest swag!

Tuesday, December 9, 2014

3 Must See Sessions For Red Hat Summit & DevNation 2015

This years Red Hat Summit conference and co-located DevNation event is being held in Boston, Massachusetts on June 23-26th.

The call for papers is open until 7 Jan 2015, but no time like the present right?

The following are the three must see sessions we are proposing for either Red Hat Summit or DevNation conferences.

There and back with JBoss - the developers journey

As members of the developer fellowship using JBoss, similar to the epic story from Tolkien, we too embark on a journey that takes us from the humble beginnings of projects to the solid towers of products. This session will immerse you in the story of how a project is born, how the developer engages in her first contact with the JBoss community, the discovery of the technology and how this process evolves to something bigger. The journey winds through the JBoss ecosystem and leads to possibilities, often unknown to the user, that bring order, trust and solid enterprise solutions to their daily lives.

Join us for an hour of story telling, epic discoveries, long lost love for the art of solving complex problems with open technology and the warm glow of understanding the big picture of how JBoss ties it all together to support you on each journey to embark upon.

(session: co-submitted with Markus Eisele to DevNation)

Planning not to fail with JBoss Business Resource Optimizer

The saying goes, failing to plan is planing to fail. We don't want to fail, but with the need to accelerate our integration and BPM projects we often have issues with complex resource planning. A roster needs to be planned, beds assigned to patients, a logistics route optimized, cloud instance resource planning to optimize usage of our workloads or even packing solutions for sub-optimal spaces. All these and more will be yours to solve with the help of the Business Resource Optimizer component included with Red Hat JBoss BRMS & BPM Suite products. 

Join us for a few hours, roll up your sleeves and get dirty as we create solutions that plan, organize and optimize.

(lab: co-submitted with Keith Lynch to Red Hat Summit)

Racing Camel with BPM and JBoss Fuse

Do challenges have you wrestling with integration in your business? Are you aware that you can easily merge your enterprise Camel integration with your business processes? 

This lab will guide you through the creation of a customer care project containing several BPM processes that integrate seamlessly with JBoss Fuse, Camel routes, provide full BAM reporting abilities and manage it all wtih Fuse Fabric. Get ready for a few hours of fun and adventure as you kick the tires, because after all, a Camel has no purpose until there is a process.

(lab: co-submitted with Christina Lin to Red Hat Summit)

See you in Boston in June 2015!

Friday, December 5, 2014

2 Ways Of Ensuring You Keep Rocking All JBoss Integration & BPM Demos

As you might have noticed, all of the JBoss BRMS & JBoss BPM Suite demo projects you have come to enjoy were to be migrated into a new organizational group known as JBoss Demo Central.

If you follow me on twitter you would have seen quite a bit of activity over the last week as no less than 35 projects were migrated to JBoss Demo Central.


A nice thing to realize is that all of the original links from the original locations are forwarded to the new JBoss Demo Central locations.

This means your various cloned projects are still functioning just fine, but if you want to be able to just pull in future changes you will have one of two options to get in sync with your projects new home.

1. Search and destroy

This option is the most drastic and is fine if you have a good Internet connection. Just go to JBoss Demo Central, find the project you need to update, throw away your local copy and clone a new copy.

For example:
  1. want to update the JBoss BPM Suite Travel Agency Demo.
  2. locate project in JBoss Demo Central by searching for Travel (or just follow the link in step 1).
  3. remove this locally on our machine:
    • $ rm -rf bpms-travel-agency-demo
  4. clone to our local machine:
    • $ git clone 
Now you are ready to continue to pull updates as they are made available and push any improvements you might have to the project.


2. Modify in place

This option is for you should you not really want to re-clone an entire repository. We will just modify the link in the projects git configuration file to point to the new repo location.

For example:
  1. want to update the JBoss BPM Suite Travel Agency Demo.
  2. locate project in JBoss Demo Central by searching for Travel (or just follow the link in step 1).
  3. copy the HTTPS clone URL:
    • git@github.com:jbossdemocentral/bpms-travel-agency-demo.git
  4. edit the existing local git configuration entry that contains reference to eschabell as follows:
    • edit bpms-travel-agency-demo/.git/config

# The origin entry in your git configuration file for the project
# before moving it to JBoss Demo Central.
#
[remote "origin"]
	url = git@github.com:eschabell/bpms-travel-agency-demo.git
	fetch = +refs/heads/*:refs/remotes/origin/*

We update this link to point to JBoss Demo Central and do a fresh git pull.

# The new origin entry that points to the correct new demo location.
#
#   $ git pull  (to refresh)
#
[remote "origin"]
	url = git@github.com:jbossdemocentral/bpms-travel-agency-demo.git
	fetch = +refs/heads/*:refs/remotes/origin/*

You can also adjust the url for origin by using a git command:

  • $ git remote set-url origin git@github.com:jbossdemocentral/bpms-travel-agency-demo.git 

That's it, now you are ready to continue using any JBoss Integration & BPM demo project you find need updating to their new home in JBoss Demo Central.

Thursday, December 4, 2014

Quick Guide: Dissecting JBoss BPM Cross Process Communication

(Article guest authored together with Jey Paulraj, Senior Solution Architect at Red Hat in North America)

The weeks tips & tricks article will dive in JBoss BPM Suite and specifically a question around how to communicate between two processes. Before we get into the solution details, let us first constrain the use case we will be talking about.

There could be many interpretations around what communication is between two processes, but we will start here with a simple way for one process to call another process. We will also show this simple usage through the provided RestAPI, which we will leverage to provide a deployable artifact that you can leverage as a custom work handler in any BPM process.

The artifact is a class we labeled RestApi.java, it contains the setup and details that make it possible for you to start another process from your existing process.

We provide the class in it's entirety at the end of this article but first we look closer at the various moving parts.

The top of every class includes the various imported objects or classes that will be used, we are most interested in the Knowledge Is Everything (KIE) API components and you will find them listed there along with some objects that represent our healthcare examples domain model.

package org.jboss.demo.heathcare;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

// JBoss BPM Suite API 
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.manager.RuntimeEngine;
import org.kie.api.runtime.process.ProcessInstance;
import org.kie.services.client.api.RemoteRestRuntimeEngineFactory;

// Domain model.
import com.redhat.healthcare.CaseContext;
import com.redhat.healthcare.Doctor;
import com.redhat.healthcare.PatientInfo;
import com.redhat.healthcare.Prescription;
import com.redhat.healthcare.Rxdetail;

Next we will find the actual start of our RestAPI class, where we setup some of the attributes needed to work with the API along with a constructor that will make sure our JBoss BPM Suite server is running. Please note the process deployment ID along with the user and password are fictitious, so any resemblance to actual process data is by chance only.

String deploymentId = "com.redhat.healthcare:patients:1.0";
String bpmUrl = "http://localhost:8080/business-central";
String userId = "admin";
String password = "bpmsuite1!";
URL deploymentUrl;

// Constructor to check for availability of BPM server.
//
public RestApi()  {
   super();
   try {
      this.deploymentUrl = new URL();
   } catch (MalformedURLException e) {
      e.printStackTrace();
   }
}

The URL tested is assuming a basic default local installation, so if your installation is in a different setup you will need to adjust for that.

The next code snippet highlights a core helper method, the one that gets us a reference to the runtime engine. This is the engine that ties us through a RestAPI to a specific deployment, com.redhat.healthcare:patients:1.0 giving us access to start a process in that deployment.

// Get a runtime engine based on RestAPI and our deployment.
//
public RuntimeEngine getRuntimeEngine() {
   RemoteRestRuntimeEngineFactory restSessionFactory 
     = new RemoteRestRuntimeEngineFactory(deploymentId, deploymentUrl, userId, password);

   // create REST request
   RuntimeEngine engine = restSessionFactory.newRuntimeEngine();
   return engine;
}

With a runtime engine we can now access and create our sessions, where we will then be able to start our process instances.

The following method is called to start a process instance and contains for the sake of clarity only, the creation of a collection of data for submission into our process. It should be easy for you to see that this can be abstracted out as needed, for the use of process variables being mapped into your class.

// Setup our session, fill the data needed for process 
// instances and starting our process.
//
public void startProcess() {

   String taskUserId = userId;

   // create REST request.
   RuntimeEngine engine = getRuntimeEngine();
   KieSession ksession = engine.getKieSession();

   // setup data for submission to process instance.
   Doctor doctor = new Doctor();
   doctor.setAddress("3018 winter");
   doctor.setCity("madison");
   doctor.setGender("M");
   doctor.setGroupId("UW1001");
   doctor.setHospital("1001");
   doctor.setName("jey");
   doctor.setState("WI");

   PatientInfo pat = new PatientInfo();
   pat.setAge(12);
   pat.setName("jey");
   pat.setSymbtom("Diabetes Insipidus");
   pat.setType("Diabetes");

   Rxdetail rxdetail = new Rxdetail();
   List<rxdetail> details = new ArrayList<rxdetail>();
   rxdetail.setDrugName("xx");
   rxdetail.setOther("red");
   rxdetail.setQty(11);
   rxdetail.setRxNum(11);
   details.add(rxdetail);

   CaseContext cont = new CaseContext();
   cont.setApprovalReq("N");
   cont.setApprovalReq("Supervisor");
   
   Prescription prescription = new Prescription();
   prescription.setDoctor(doctor);
   prescription.setPatientInfo(pat);
   prescription.setRxdetails(details);

   // collect all data in our map.
   Map<string object=""> params = new HashMap<string object="">();
   params.put("prescription", prescription);
   params.put("caseContext", cont);
   
   // start process.
   ProcessInstance processInstance 
      = ksession.startProcess("healthcare.patientCaseProcess", params);

   // verify process started.
   System.out.println("process id " + processInstance.getProcessId());
   System.out.println("process id " + processInstance.getId());
}

With this method we have setup our doctor, patient and other medical details required by the process, collected them into a map and submitted them to the process instance to kick it all off.

Now we can tie this all together so that the main class that is run when this is called will just setup our RestAPI and start a new process instance each time it is called.

// Start our process by using RestAPI.
//
public static void main(String[] ar) {

   RestApi api = new RestApi();
   api.startProcess();
}

We hope this simple tour through this medical example gives you an idea of how to use the provided JBoss BPM Suite RestAPI to your advantage. In this case we use it for communicating to a specific process in a specific deployment from any other process deployed on our BPM server.

Here is the RestApi class:

package org.jboss.demo.heathcare;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

// JBoss BPM Suite API 
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.manager.RuntimeEngine;
import org.kie.api.runtime.process.ProcessInstance;
import org.kie.services.client.api.RemoteRestRuntimeEngineFactory;

// Domain model.
import com.redhat.healthcare.CaseContext;
import com.redhat.healthcare.Doctor;
import com.redhat.healthcare.PatientInfo;
import com.redhat.healthcare.Prescription;
import com.redhat.healthcare.Rxdetail;

String deploymentId = "com.redhat.healthcare:patients:1.0";
String bpmUrl = "http://localhost:8080/business-central";
String userId = "admin";
String password = "bpmsuite1!";
URL deploymentUrl;

// Constructor to check for availability of BPM server.
//
public RestApi()  {
   super();
   try {
      this.deploymentUrl = new URL();
   } catch (MalformedURLException e) {
      e.printStackTrace();
   }
}

// Get a runtime engine based on RestAPI and our deployment.
//
public RuntimeEngine getRuntimeEngine() {
   RemoteRestRuntimeEngineFactory restSessionFactory 
     = new RemoteRestRuntimeEngineFactory(deploymentId, deploymentUrl, userId, password);

   // create REST request
   RuntimeEngine engine = restSessionFactory.newRuntimeEngine();
   return engine;
}

// Setup our session, fill the data needed for process 
// instances and starting our process.
//
public void startProcess() {

   String taskUserId = userId;

   // create REST request.
   RuntimeEngine engine = getRuntimeEngine();
   KieSession ksession = engine.getKieSession();

   // setup data for submission to process instance.
   Doctor doctor = new Doctor();
   doctor.setAddress("3018 winter");
   doctor.setCity("madison");
   doctor.setGender("M");
   doctor.setGroupId("UW1001");
   doctor.setHospital("1001");
   doctor.setName("jey");
   doctor.setState("WI");

   PatientInfo pat = new PatientInfo();
   pat.setAge(12);
   pat.setName("jey");
   pat.setSymbtom("Diabetes Insipidus");
   pat.setType("Diabetes");

   Rxdetail rxdetail = new Rxdetail();
   List<rxdetail> details = new ArrayList<rxdetail>();
   rxdetail.setDrugName("xx");
   rxdetail.setOther("red");
   rxdetail.setQty(11);
   rxdetail.setRxNum(11);
   details.add(rxdetail);

   CaseContext cont = new CaseContext();
   cont.setApprovalReq("N");
   cont.setApprovalReq("Supervisor");
   
   Prescription prescription = new Prescription();
   prescription.setDoctor(doctor);
   prescription.setPatientInfo(pat);
   prescription.setRxdetails(details);

   // collect all data in our map.
   Map<string object=""> params = new HashMap<string object="">();
   params.put("prescription", prescription);
   params.put("caseContext", cont);
   
   // start process.
   ProcessInstance processInstance 
      = ksession.startProcess("healthcare.patientCaseProcess", params);

   // verify process started.
   System.out.println("process id " + processInstance.getProcessId());
   System.out.println("process id " + processInstance.getId());
}

// Start our process by using RestAPI.
//
public static void main(String[] ar) {

   RestApi api = new RestApi();
   api.startProcess();
}