Searching Your Code Base (in IBM BPM using Notepad++)

You only need to spend an hour using something like Visual Studio or IntelliJ to realize just how developer-unfriendly the Process Designer for IBM BPM can be. Refactoring assistance (e.g. http://www.jetbrains.com/idea/features/refactoring.html) is just a pipe-dream when you don't even have the ability to search for text across the entire code base.

I have found that the "Find in Files" functionality in Notepad++ works particularly well with the export files that IBM BPM generates and that, used together, they can offer some compensation for the lack of functionality in Process Designer.

NOTE: Other text editors can be probably be used as well. On Windows, my text editor of choice is Sublime, but it doesn't present the results from "Find in Files" quite as well (it's more work to track down the artifact name matching the search criteria).

Here's a worked example:

I have noticed a spelling mistake in a variable name and I want to correct it, ensuring that all usage is updated. The variable is called "tw.local.myVariable.myDaata" and should be called "tw.local.myVariable.myData".

Step 1. Create a Snapshot


Step 2. Create an Export

2.1. Find your snapshot in the Process Center view of Process Designer and click on "Export".


2.2. Select "IBM BPM export (.twx)" (it can take a few seconds for this dialog to appear).
2.3. Save the resultant file to you local file system.

Step 3. Unpack the Files

3.1. Rename the *.twx file as *.zip and open it up.

3.2. Grab the "objects" folder and copy it to your file system. This folder contains the files we want to search...

Step 4. Search the Files

4.1. Open Notepad++ and select "Find in Files" from the "Search" menu.


Step 5. Identify the Artefacts

Each "file" corresponds to an IBM BPM artefact.


5.1. Double clicking on matching text will open the file and scrolling to the top will give you the artefact name...


For complicated artefacts, it might help to take a closer look at the XML to help point you in the right direction as to where in the artifact the matching text can be found.



Here are a few examples of things that you might want to search for...

defaultValue>"
This will give you a list of all the Services that have default values (that are Strings).

log.error
This will tell you where in your code the out-the-box logging functions are used (I would recommend that you wrap these in you own Service rather than calling them directly).

"ANY LITERAL VALUE"
We've all been there. You need to tidy up the use of literals in the code base...


comments powered by Disqus