Using IBM BPM in a Headless Solution
owenc 1000003T00 Comments (2) Visits (6907)
What is Headless BPM?
Headless BPM is the concept where you use only the IBM BPM Process Server to execute process flows without any User Interface Coach forms.
Why Do It?
There are good architectural reasons why someone would consider a headless BPM solution"
Headless BPM Patterns
Use Coaches Programmatically
This pattern means that you do nothing special in your BPM application. In this pattern you add User tasks with Coaches as you normally would.
This allows you to have a Coach UI in the BPM application in case some users will work with the coach forms from within the BPM process Portal.
But, this pattern also allows you to progress through the BPM process application programmatically too from an external User Interface or application.
This is because the BPM REST API allows one to claim a User Task (Assign Task), modify A User Task's output variables (Set Data) and, finally complete the task (Finish Task).
Take this BPM process application for example:
And, here are the process application variables:
And, here is the Headless BPM User Task:
And, here is the Headless BPM User Task variables:
First, we start an instance of the Headless BPM process application. And, the process instance blocks on the Headless BPM User Task where the Task ID is 207.
Next, using the BPM REST API Tester, we claim the task (Assign Task to Me or the admin user):
Next, we check the Process Inspector to verify that the Headless BPM User Task is assigned now to the admin user:
Next, we will issue a Get Data command to check the value of the output variable. If there were more output variables, we could set all of them in one Get Data command. Notice that the output variable is NULL.
Next, we will issue a Set Data command to change the value of the output variable. If there were more output variables, we could set all of them in one Set Data command.
Next, we will issue a Finish Task command (and set the output variable).
After the Finish Task call, the task (and the process instance) completes.
Use External Implementations
You can provide an External Implementation for User and System Tasks. Think of them as breakpoints in your process flow. And, yes, they can have input and output variables which you can externally access and set using the BPM REST API commands seen above. The User and System Tasks are handled the same way that the User task implemented with coaches was above. You still have to claim them (Assign Task), change the variables and then complete them (Finish Task).
Here we create an External Implementation:
And, here we assign the newly created External Implementation to a System Task (and it could have been a User Task with no coaches):
This is a hybrid solution where you have both a User Task with coaches and a User Task implemented as an External Implementation. In front of them, you have a Gateway to test a boolean variable that routes to one of the two.
There can be good requirements where you will need to model headless BPM process applications.
You can use several patterns depending on your particular business requirements like:
You can consider several patterns: