Open ESB: The Solution for the Open Minded The Crooked Stick

My Other Crooked Stick (Archery)

Bookmark and Share

Friday Sep 18, 2009

Following on from my original blog entry "Graphical BPEL Monitoring and Usage Statistics" I have have update the SVG Generation jar as part of my "BPEL Documention" functionality. Therefore this short blog entry will take you through the updates to the interface by building a small lightweight jsp based monitoring application. This application is by no means complete but can be extended to add more functionality although with the upcoming release of the official BPEL Monitor you may want to wait for this.

Overview


As you can see from the images below this new version provides all the features seen in the previous release just in a slightly difference format. In addition I have added some extra preferences that will allow the user to switch the svg orientation and the icon set to be used. You will also notice that the layout issues that existed in the previous release have bee resolved. This new example also uses the standard BPEL Monitoring API rather than interfacing to the underlying table directly for all the information. You will notice that when retrieving the BPEL I need to access the Service Unit table but this is done using the standard Monitoring Connection Pool.

The BPEL Process used for the testing of the Monitor looked as follows:

BPEL Process

Monitor


Monitor

Monitor

Monitor

Monitor

Code Changes


As mentioned the new version of the SVG Generator now uses the jar I built for the BPEL Document Generator and can be found linked to that blog entry. Below I have included two pieces of code that will show how we can generate the SVG from the BPEL using the new library and in the case of this simple monitor application convert them to jpg files before displaying them.

Main Jsp

The key lines within the body.jsp below are the <div> defined between 104 and 120. What we can see here is that the jsp page will get the name of jpg file to be generated from the Session (108-113) or generate one if necessary. It will read the layout and the icon source (114-115) from preferences (these will be store in a Cookie) and then pass the required information to the retriever class to do the work of generating the SVG and jpg files (116). It can be seen from this call that if a specific bpel instance has been selected the list of Activities currently processed will also be passed and this will allow the SVG generator to highlight the completed processes. If only the process has been selected then this will be null and all activities will be highlighted. The final part of the div simply displays the generated jpg file or message if one does not exist.



Java Code

The BpelSvgRetriever class does the majority of the work interfacing to the new SVG Generation classes and this can be seen in the generateBpelAsJpg method (158-205). The first requirement is to retrieve the BPEL file as a String and then Unmarshal it using the updated JAXB interface (167). We then need to create a DocumentFactory (168) and a LayoutManager (169). These will  be used by the Generator during the generation of the SVG.

The Factory is then configured with the default Opacity and specified Icon Source (171-173) which will be overridden if an activity list is passed (185-196) which will occur if a specific Bpel Instance is selected.

Once the Factory is configured we specify the orientation of the generated SVG to the Layout Manager (175-179) and then finally call the SVG Generator (197-199). The SVG File is deleted at the end because we are only interested in the saved jpg for display purposes.




Bookmark and Share
Comments:

Great to hear that there is an official bpel console coming out, is there a page for this project or any updates on it's progress?

I haven't been able to get this monitor working, i've had a look in my bpelseDB as usr2 and my serviceunit table is empty even though i have deployed composite apps (which i can invoke by hand) available in the admin console. I can see the bpel instances in the database too, do you have any suggestions for how to fix this?

Posted by Ben on October 07, 2009 at 01:16 AM GMT #

My understanding is that the official bpel console will be part of the GlassFish ESB offering and hence not a free add-on to Open ESB. As far as your issue is concerned did yo turn Monitoring on after the SU were deployed if so try redeploying them with Monitoring turned on. This appears to be some peculiarity with the BPEL monitoring rather than the war.

Posted by Andrew on October 07, 2009 at 11:48 AM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed