BPM: Working with AdminTask in BPM

By Neil Kolban Posted March 23, 2018 In Business Process Management
BPM_ Working with AdminTask in BPM

IBM BPM runs on top of IBM's WebSphere Application Server (WAS) which provides a Java EE environment.  There are many options available when configuring WAS and BPM.  Administration of WAS and many aspects of BPM can be performed using different tools.  The primary tool used by an administrator is the browser-based WAS Admin Console.  Other than this there is the command line tool called wsadmin.  The wsadmin tool provides the ability to script command execution.  A schematic of the story is illustrated here:

overview-1-1024x709

The picture shows that WAS/BPM stores information as sets of XML formatted files.  Ideally, we should not be aware of the existence of these files.  These are the mechanical representation of the configuration data that is read and used during operation.  Our model of administration is through the commands on the left.

The wsadmin command is normally executed as a client tool.  What this means is that it executes outside the WAS Java EE environment and performs a network connection to the running WAS server.  The commands submitted by wsadmin are then received by BPM/WAS and executed resulting in the corresponding configuration changes.  The WAS Admin Console is a set of web pages served up from inside WAS.  However, even though the sources of the commands come from different places (for wsadmin they are network requests and for WAS Admin Console they are web pages served up inside WAS), the engine that processes the commands is the same in both cases.  This means that a command requested by wsadmin and a command requested through the browser through WAS Admin Console are processed (at the lowest layer) by the same technology and the source of the command is no longer in the consideration.

Within the WAS runtime, IBM has supplied a class called com.ibm.websphere.management.cmdframework.CommandMgr.  An instance of this class can be used to execute arbitrary WAS administrative commands.  Full documentation is available for the class as well as several great articles illustrating use.  The subject of our story, however, is working with BPM.  When we work with BPM, there are the occasional times when we would like to perform WAS/BPM administration commands from within the context of BPM itself.  While such tasks should be relatively rare, the ability to perform them when needed and having a recipe to hand to achieve such as a useful tool in your tool chest.

IBM BPM can execute arbitrary Java APIs within the context of a service within BPM.  These Java APIs execute within a WAS Java EE environment and can invoke the WAS admin commands.  Armed with this information, we can then produce a wrapperBPM service that allows us to invoke the WAS commands at a high level where the BPM service owns the mechanics of making the calls on our behalf.  This is the topic of the remainder of our story.

We have created such a wrapper and made it available through Github.  The wrapper is composed of two parts.  One part is a Java class that exposes an admin command to be run plus any parameters it needs.  This Java class leverages the WAS exposed admin APIs but is also cognizant of being callable from a BPM service.  The second part is a BPM service that owns making the call to the previously mentioned Java class.  Since this is a BPM service, it can be leveraged from any BPM process or other service.  The interface to the service is exclusively high-level BPM constructs and the underlying mechanics of how the administrative command is performed are hidden.

Having touched on the technical aspects, let us look at some of the commands that can be performed.  A good list of such can be found in the Knowledge Center.  There you will find over one hundred commands that are BPM specific.  Without the technique described here, these could only be executed outside of the context of BPM.  Using the BPM story described here, you now have new opportunities for use. (READ: BPM: Inline User Task)

The source artifacts for this project can be found here:

https://github.com/SalientProcess/BPM-Artifacts/tree/master/bpm_wsadmin

References

 

Video: IBM Digital Business Automation Platform