Oh ALBPM, why you gotta go and load images like ‘dat?
Howdy all. Hope the nice weather is finding happy, healthy, and allergy free. As we were doing spring ALBPM house-keeping with a client the other day, we stumbled upon a bit of a problem with the way that BPM loads some images. This led us to go digging into how the ALBPM->Portal integration works. And anytime I get a reason to dig into the guts of software, it usually ends up as a blog post….hope you enjoy.
- The BPM->Portal integration makes use of the old Plumtree OpenControls libraries
- Out of the box, the OpenControls libraries in use with the BPM->Portal integration are configured to go all the way back to the BPM container to load static files (images, js, css, etc) on every request to the portlet-ized BPM workspace.
- There are a bunch of static files that get loaded every time you hit the BPM workspace. The net result is that the BPM portlets are slower to render than they should be.
- There’s a servlet filter configured in the BPM workspace web.xml to cache static files on the client, but it doesn’t seem to work.
- You can force Open Controls to load images from a webserver of your choice (i.e. the portal image server where you presumably having caching set up) by adding the following entry to $BPM_HOME/enterprise/webapps/workspace/WEB-INF/web.xml
<context-param>
<param-name>com.bea.opencontrols.IMAGESERVER_URI</param-name><param-value>http://your.imageserver.url/bpmContext</param-value>
</context-param>
- You’ll also need to copy the following directory into your bpmContext folder of your imageserver:
$BPM_HOME/enterprise/webapps/workspace/opencontrols/plumtree
- Bounce the BPM workspace after making the changes above and you should see a marked improvement in workspace performance
- Did you know that the BPM->Portal integration was originally written by Plumtree way back when as a way to bolt Fuego BPM into the Plumtree Portal? This original codebase is still more or less intact, and is still used for the integration today.
- Did you know that the BPM->Portal integration is built in Java and uses Java Server Faces (JSF)?
- Did you know that the BPM->Portal integration also makes use of the somewhat dated Plumtree OpenControls libraries?
- Did you know that the code for the standalone BPM web-based client is a lot cleaner than the BPM->Portal integration?
- Did you know that there are servlet filters configured on the BPM Workspace that should do neato stuff like caching and compression auto-magically?

- Is this something I’ve seen before?
- Is this something that somebody else has seen before?
- Is it going to be more painful to open a support ticket on this than to just figure it out myself?
- What do I know about the inputs and outputs of the black box?
- What do I know about how the application is built?
- How can I tear the application apart to learn something useful?
- Input -> HTTP Request to a web page that loads mu
ltiple static files and some dynamic content - Desired output -> Cached static content
- Actual output -> Non-cached static content
- Java
- Web application
- JSF
- Look at the inputs (i.e. look at the URLs being requested)
- Look at the web.xml and other configuration files of the application to see how everything is glued together
- Decompile the source to see what the hell is going on
https://portal.foo.com/gateway_noise/bpm_portlet_server:123/workspace/jsf/menu/WebResource.resource?r=/a/path/to/an/image.gif
bpm_portlet_server:123/workspace/jsf/menu/WebResource?r=/a/path/to/an/image.gif
bpm_portlet_server:123/workspace/jsf/menu/WebResource?r=/a/path/to/an/image.gif



http://bpm_portlet_server:123/workspace/jsf/menu/WebResource?r=/a/path/to/an/image.gif

<cd $BPM_HOME/webapps/workspace/jsf/>
<Look around at a million different files that aren’t very insteresting>
<Stumble upon …/workspace/jsf/view/viewPresentationNormal.xhtml>
<Open viewTableCell.xhtml> n>
fn:getImage(‘ATTACHMENT_ICON’)
OK, so we’ve finally managed to dive down to the where the app is making calls to get images. <Quick timeout to pat myself on back and IM friends a steady stream of profanities about how ridiculously ALBPM is built>. Now, that fn: prefix is a tag libarary. Let’s see what taglib is being used. Obviously that stupid taglib isn’t included in hasAttachments.xhtml, that would be too simple. So backtrace through the xhtml files until we get to viewPresentationPanel.xhtml which includes that line:
xmlns:fn=”http://bea.com/bpmWorkspace/functionsLibrary
Now to find where the actual code for this taglib lives…BACK to web.xml

/WEB-INF/facelets/bpmWorkspace.taglib.xml
fuego.workspace.jsfcomponents.FacletsFunctionLibrary
jar -xvf fuego.jsfcomponents.jar
oc:someMethod
So let’s see what the oc: tag library is all about. ViewPresentationNormal.xhtml was nice enough to include the line:
xmlns:oc=”http://bea.com/opencontrols”
Back to our old friend web.xml.

jar -xvf opencontrols.jar
jar -xvf fuego.workspace.jar
jad workspace/jsfcomponents/WorkspaceTableRender.class
grep -i image WorkspaceTableRender.jad
grep -i img WorskpaceTableRender.jad

String urlBase = “/plumtree/common/private/opencontrols/image/table”;
jad com/bea/opencontrols/XPResourceRequest


<context-param>
<param-name>com.bea.opencontrols.IMAGESERVER_URI</param-name>
<param-value>http://your.imageserver.url/bpmContext</param-value>
</context-param>

You’ll may have noticed that I referred to “we” several times in the text above. No, I haven’t started referring to myself in the royal third. I actually had a partner in crime for some of this debugging exercise. Some of you may know him as Howard, some of you might refer to him as Ross, but I just call him HRoss. In any case, he’s one of the best portal consultants still working directly for Oracle. So if you’re still shelling out the big bucks for an Oracle consultant (rather than a more reasonably priced alternative *cough* Function1 *cough*), ask for him by name.