Debugging Oracle BPM 10Gr3 Studio

Debugging Oracle BPM has been a bit tedious. One would often start setting logmessages which will clutter your logs when running the project in a production environment (and a performance issue when not needed!)
This post contains several ways of debugging;

  1. Debug in BPM Studio
  2. Debug BPM Methods
  3. logMessage(s) with simple types
  4. logMessage(s) with complex types
As a side note; LogMessages are often abused for debugging, you might consider making project variables if you notice you keep looking in the logs.
A clear distinction for me is that all functional values should be accessible through the WorkSpace and exception handling should also be raised through logmessages.

Debug in BPM Studio:

  1. First toggle a breakpoint in your code. (Right mouse click on the left side of your code)
  2. Then click “Open Debug Dialog” in the menu “Run”:
  3. Create a new “BPM Process Debugger” by clicking on “New launch configuration”
  4. Give the configuration a name
  5. Select the project
  6. Click Apply and then Debug button
  7. Run your project until it reaches your breakpoint:

Debug BPM Methods

  1. Select the BPM Script Launcher and click New Launch Configuration
  2. Choose the project
  3. Type the component name
  4. Choose the method
  5. Click Apply and debug
  6. Remember that the method values needs to be initialized.

logMessage(s) with simple types:

You can log simple types by using the logMessage command:

logMessage("<< [" + process.name + "] [" + Activity.name + "] " + "message received but not for this process\nMessage contents: " + message.textValue, severity : Severity.WARNING);

This would result in a warning log statement with message being displayed.

logMessage(s) with complex types:

A quick way to display complex types is through DynamicXml, which will take bpm variables (complex & simple).

logMessage("complexTypeVariable:\n" + DynamicXml.createXmlTextFor(object : complexTypeVariable)

This is an example of the log statement:

complexTypeVariable:
<xobject.Src.Com.Joris.BPM.Types.complexTypeVariable xmlns="http://bea.com/albpm/DynamicXml/version/2.0">
	<firstvalue>123</firstvalue>
	<secondvalue>second</secondvalue>
	<thirdvalue>false</thirdvalue>
</xobject.Src.Com.Joris.BPM.Types.complexTypeVariable>

I’ll expand this post in the future with (Process) Unit tests as well.
Happy debugging!

Tabs are huge in Eclipse on Ubuntu

You might have noticed the tabs are a bit bigger in Eclipse than what you’re used to when running Eclipse in Windows.
(This is a minor annoyance, but more screen real estate is always welcome..!)
This is what it would look like before:

You can solve this by creating a custom gtkrc-2.0 file, which should be in your home folder.
Start up your terminal and execute the bold text:

joris@dipshit:~$ nano ~/.gtkrc-2.0

You’re in nano right now, insert the following text in .gtkrc-2.0:

style "compact-toolbar"
{
        GtkToolbar::internal-padding = 0
        xthickness = 1
        ythickness = 1
}
style "compact-button"
{
        xthickness = 0
        ythickness = 0
}
class "GtkToolbar"                              style "compact-toolbar"
widget_class "*<GtkToolbar>*<GtkButton>"        style "compact-button"

Press “CTRL+x” to close the file and press “Y” to save the edited contents.
Next time you’ll open eclipse, the tabs will look like this:

Black preview in GWT Designer in Eclipse on Ubuntu

Unfortunatly there’s a small snag when you’re using GWT designer on ubuntu with the libwebkit libs. When libwebkitgtk-1.0.so.2 isn’t found, the GWT designer will display a black field when you’re editing gui items, as shown on the example below:

GWT Designer on Ubuntu

You can easily solve this by symbolic linking to the already existing libwebkit library. Only execute the commands which are shown in bold:

joris@dipshit:~$ cd /usr/lib
joris@dipshit:/usr/lib$ ls -lhatr |grep libwebkit
-rw-r--r--   1 root root       19M 2011-04-20 14:52 libwebkitgtk-1.0.so.0.6.0
lrwxrwxrwx   1 root root        25 2011-08-12 19:14 libwebkitgtk-1.0.so.0 -> libwebkitgtk-1.0.so.0.6.0
joris@dipshit:/usr/lib$ sudo ln -s libwebkitgtk-1.0.so.0 libwebkit-1.0.so.2
joris@dipshit:/usr/lib$ ls -lhatr |grep libwebkit
-rw-r--r--   1 root root       19M 2011-04-20 14:52 libwebkitgtk-1.0.so.0.6.0
lrwxrwxrwx   1 root root        25 2011-08-12 19:14 libwebkitgtk-1.0.so.0 -> libwebkitgtk-1.0.so.0.6.0
lrwxrwxrwx   1 root root        21 2011-09-06 23:04 libwebkit-1.0.so.2 -> libwebkitgtk-1.0.so.0
joris@dipshit:/usr/lib$

Remark; This’ll create the symbolic link based on the link which Ubuntu already placed. If we would place it on 0.6.0, there might be a problem when we upgrade libwebkitgtk.
Happy designing!

SWTError with Oracle BPM Studio 10gR3 on Ubuntu

I’ve been busy trying to get my development environment running on Ubuntu 11.04.
The following error pops up while trying to create a presentation for a bpm variable:

XPCOM error -2147467259
org.eclipse.swt.SWTError: XPCOM error -2147467259
at org.eclipse.swt.browser.Mozilla.error(Mozilla.java:1296)
at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:266)
at org.eclipse.swt.browser.Browser.<init>(Browser.java:109)
at fuego.ui.peer.swt.SwtBrowser.createBrowser(SwtBrowser.java:137)
at fuego.ui.peer.swt.SwtBrowser.<init>(SwtBrowser.java:43)
at fuego.ui.peer.swt.SwtFactory.createBrowser(SwtFactory.java:149)
[…]

It seems that studio can’t find xulrunner, (a runtime environment developed by the Mozilla Foundation to provide a common back-end for XUL user interface language applications)
The most common solution I could find through Google, is to install xulrunner through the ubuntu repos. Unfortunatly xulrunner 1.8 isn’t in the Natty repos so I had to download it myself.
You can find the latest 1.8 xulrunner here: Mozilla.org xulrunner-1.8.1.3.en-US.linux-i686-20080128.tar.gz

  • Unpack the contents of xulrunner-1.8.1.3.en-US.linux-i686-20080128.tar.gz
  • Rename the unpacked xulrunner directory to xulrunner-1.8
  • Move the newly created xulrunner-1.8 directory to /usr/bin
  • Fix permissions on the new directory: sudo chmod -R root:root /usr/bin/xulrunner-1.8

Final step is to add the following line to eclipse/eclipse.ini:
-Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib/xulrunner-1.8
After this, you can start your studio and create presentations with no problems!