AS/400-IBM i RPG to BPM Spotlight



Organizations with aging AS/400-IBM i applications written in RPG have special problems and special opportunities. As owners of such systems are well aware, the pool of RPG programmers has been in steady decline for years. At the same time, by some estimations, IBM has exactly one person working on the RPG compiler. RPG has served well as a great business language but has fallen far behind the rapid development of a great many other languages.

These custom RPG applications, however, often continue to support many businesses. They reliably run day in and day out. However, as is true of all old software that has been modified over many years, the code has become very slow to enhance, and is typically maintained by a very small number of people with highly specific knowledge. The one word that does not apply to this situation at all, is “agile.”
At some point, all organizations are faced with replacing these applications. In some cases this can be accomplished by purchasing packaged or SaaS solutions, but for many organizations there is a strategic need for custom software.

Some organizations have attempted to rewrite their RPG applications in Java or .Net, however, the success stories are limited. The typical result of such efforts is that, before long, it seems like “doing the same thing all over again,” in other words, creating a large pile of code that is difficult to maintain.

So then , what’s the right way to go about re-engineering these custom RPG applications?

Rule #1 – Never start from scratch

As software innovator and author, Joel Spolsky has written, the greatest temptation of all developers is also their greatest downfall: never, ever start from scratch.
In recognition of this principle, vLegaci has developed unique tools and methodologies to recover the most useful knowledge from RPG applications to feed the design process of new, BPM systems. The tools recover three primary types of information that are the foundation of modern BPM systems, but virtually undeclared in RPG systems:

  • Business processes
  • Business rules
  • Database model

Business Process Discovery

In modern applications, it’s the business processes that are the foundational elements. This is entirely appropriate as the core of businesses is what they actually do, which is, of course, their processes. RPG applications have virtually no explicit declaration of processes. Activities within processes are typically scattered across a wide number of programs with no discernible connection other than how the business uses the application.

It is built on this premise, how the business uses the system, that vLegaci has developed its business process discovery toolset, built in the technology of process mining. Here is a short video giving an overview of using process mining with an RPG application to discover business processes:

Business Rule Discovery

Controlling business processes in any modern application is a set of business rules. Again, in RPG applications these are scattered far and wide, with many redundancies and inconsistencies. In a new BPM application these will be packaged as services and consumed as needed for controlling processes and workflow. Recovering existing RPG logic snippets that are de facto rules is a very useful thing to do when re-engineering. Again, do not start from scratch! Through measurements of a number of RPG applications across many industries, a rule of thumb is that for every million lines of RPG code, you will find about 30,000 business rules. Since a great many RPG applications are this size or even greater, the prospect of creating all these rules from scratch, without mistake or omissions, is inconceivable.

By using vLegaci’s business rule extraction tool, a reasonably complete catalog of existing rules can be created to feed the re-engineering process and facilitate process elaboration. What’s more, the recovered rules can be correlated to recovered business processes to minimize the analytical work required of the team.

Data Model Discovery

While RPG application do not truly have a database “model”, at least the definition is reasonably ascertainable. In collaboration with our partners at Apex BPM Consulting, vLegaci provides a set of tools and processes to facilitate the modeling of a new database to be used by the BPM application. In theory it would be possible to simple reuse or port the database, however, like the rest of old applications, the database model has typically become very corrupt and disorderly over the years. A serious rethinking is often called for. The Apex-vLegaci toolset provides an excellent means to make the transition.

RPG to BPM Staff Transition

As noted earlier, some RPG-based organizations have attempted to re-engineer their applications in Java or .Net. One fallout from such efforts is that a large share of RPG developers do not successfully make that transition. As RPG was primarily a business-oriented language, so too have been RPG staffs. Java and .Net languages are much more technical than RPG and many RPG developers were either uninterested or unable to make the transition.

BPM, however, is a different story. And it is a story that fits well with many RPG developers as it is not as technical as Java or .Net and it is more oriented to business processes, the core strength of the RPG language and most of its developers. Working with our Apex BPM Consulting partner, we offer BPM training specially oriented to RPG staffs, with the result that these highly experienced professionals can take their contributions to a new level.