Pages

Wednesday, February 27, 2013

OSB Action Visibility in the Message Flow

1. Overview

How many times did you have to re-visit your OSB pipeline, perform a code review in someone else's code or work in collaboration with other developers in the same code?

One of the most annoying limitations in the Oracle Service Bus plugin for Eclipse refers to the absence of displaying the action context in an optimal way in the message flow

To understand it better, look at the following fragment of a message flow, which contains 3 Assign actions in a row.

I'm using Assign action to illustrate, however the same approach can be taken for any Action.


A) We can see 3 Assign labels, but we cannot see what values are being assigned to what variables.





B) The Tooltip default value is not helpful, as it just displays the word "Assign".





C) Then if you click in the Assign, you will be able to see the properties as follows:




2. Issue

As you can see, if you have a message flow and you want to navigate and have a picture of what is being assigned, you will have to click on each action to see the Variable name and the value which is being assigned to it.

I would say this is not a very productive approach, and you might find yourself frustrated if you use the tool regularly.


3. What I'm trying to achieve

I decided to address this issue, and evaluated different approaches. The main goal is to make some properties visible in the pipeline for specific actions.

In the initial version, I'm focusing on the most common actions: Assign, Replace and Service Callout.


4. Approaches

4.1.  Changing the behaviour of the tool

In order to address the issue described in the Overview section, I decided to create an Extension to the OSB Plugin.

The extension will change the message flow behaviour. Whenever you position the mouse cursor over a set of defined actions, it will display relevant information in the Tooltip.

This approach doesn't change any metadata, and it does not affect anything at runtime, it's only at design time. I strongly recommend opting for this approach.

You can see in the following picture that when you position your mouse cursor over the Assign action, it shows automatically to which variable the result of the action is being assigned.

Just download and install the Extension described in item 5 of this article.

You can still use comments whenever you need to, in order to add useful information, and they will be shown in the tooltip as well.



4.2.  Using comments

If you use the property comment section, you will achieve the same result as in 4.1, but in a manual way.

I've been using this approach for a while. It's hard to convince developers to do it. It's also error-prone.

You might rename the variable and forget to update the comments.

You can automate the generation of comments in your automated build by inspecting the metadata and updating the comments, however you have to be careful otherwise useful comments will be lost.



4.3.  One Action per stage


This is another approach, where you have only one Action per stage and you name the stage with the variable name or relevant information.

I think this is an overkill. It makes sense to group related actions per stage, but having as a rule 'one Action per Stage' is not practical, and it will increase the size of the message flow.

I wouldn't use this approach for Assign and Replace actions.


5. Installing the Eclipse Plugin Extension

  1. Download the following 2 Jars: OSBEclipseExtensionPlugin.jar and asm-all-4.1.jar
  2. Copy the above 2 files to a location in your computer. e.g.: c:/dev/OSBExtension
  3. Locate eclipse.ini used in your Eclipse (assuming you have already installed OEPE)
  4. Add the following 2 lines to eclipse.ini (it assumes that the files are located under c:/dev/OSBExtension. Change the directory values in order to align to your installation). You can add the  following 2 entries in a new line, immediately after -vmargs entry.
    -javaagent:c:/dev/OSBExtension/OSBEclipseExtensionPlugin.jar
    -DOSBEclipseExtensionLibs=c:/dev/OSBExtension/asm-all-4.1.jar,c:/dev/OSBExtension/OSBEclipseExtensionPlugin.jar
  5. Start Eclipse
  6. Open an OSB Proxy Service and you will see a different behaviour as specified in 4.1 whenever highlighting Assign, Replace or Service Callout actions.

6. Conclusion

Opting for the approach "4.1 Changing the behaviour of the tool" is my recommendation to address the issue mentioned in this article, where crucial information is being hidden in the Pipeline.

Additionally, you should use also approach 4.2 on top of it whenever you want to capture valuable information.

Please leave a feedback about the approaches, the tool, if it helpped you somehow or if you want a new functionality available in the Plugin extension.