Following on from my original blog entry "GraphicalBPEL Monitoring and Usage Statistics" I have have update the SVGGeneration jar as part of my "BPELDocumention" functionality. Therefore this short blog entry willtake you through the updates to the interface by building a smalllightweight jsp based monitoring application. This application is by nomeans complete but can be extended to add more functionality althoughwith the upcoming release of the official BPEL Monitor you may want towait for this.

Resources
  • BPELMonitor Web Application.
  • BPELMonitor WAR File.
  • DocumentGenerator Jar File.
Overview


As you can see from the imagesbelow this new version provides all the features seen in the previousrelease just in a slightly difference format. In addition I have addedsome extra preferences that will allow the user to switch the svgorientation and the icon set to be used. You will also notice that thelayout issues that existed in the previous release have bee resolved.This new example also uses the standard BPEL Monitoring API rather thaninterfacing to the underlying table directly for all the information.You will notice that when retrieving the BPEL I need to access theService Unit table but this is done using the standard MonitoringConnection Pool.

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



Monitor











Code Changes


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

Main Jsp

The key lines within the body.jsp below are the
definedbetween 104 and 120. What we can see here is that the jsp page will getthe name of jpg file to be generated from the Session (108-113) orgenerate one if necessary. It will read the layout and the icon source(114-115) from preferences (these will be store in a Cookie) and thenpass the required information to the retriever class to do the work ofgenerating the SVG and jpg files (116). It can be seen from this callthat if a specific bpel instance has been selected the list ofActivities currently processed will also be passed and this will allowthe SVG generator to highlight the completed processes. If only theprocess has been selected then this will be null and all activitieswill be highlighted. The final part of the div simply displays thegenerated jpg file or message if one does not exist.



Java Code

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

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

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






More...