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!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s