Open ESB Tip: OpenDS Template based BPEL Document Generator

Following on from my previous blog entry (Template Based BPEL Document Generation) which described the Template Based BPEL Documentation Generator and briefly mention how it could be extended. This entry will take you through the steps of building a Simple OpenDS based document writer that will retrieve the process and activity information from a specified OpenDS Directory. Although this is a simple example it should, hopefully, show you how to write your own Documentation Writer by extending the existing functionality. As I gen the chance I hope to add additional Writers to the basic jar to leverage a variety of possible Data Stores (e.g. the Adjoovo Spaces REgiSTry, WebService Calls).

Document Generator Trail
  1. Template Based BPEL Document Generation.
  2. NetBeans Plugin For Template Based BPEL Documentation.
  3. Extending the Template Based BPEL Document Generator.

Building the LdapWriter


Minimum Requirements

Before we start to build the Ldap Writer we will need to two additional Objects with our OpenDS Instance and a number of associated Attributes (see below). These are used to store specific information about your BPEL Modules and the Activities within them. The information below should be imported into your OpenDS instance as an LDIF file.

#
# Defines the BPEL Objects and Activities used within the To BPEL Document Generator
#
dn: cn=schema
changetype: modify
add: attributeTypes
# Service Attributes
attributeTypes: ( 1.3.6.1.4.1.42.2.210.666.3.1 NAME 'bpelModuleImportsDesc' DESC 'Imports Documentation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
attributeTypes: ( 1.3.6.1.4.1.42.2.210.666.3.2 NAME 'bpelModuleOverviewDesc' DESC 'Overview Documentation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
attributeTypes: ( 1.3.6.1.4.1.42.2.210.666.3.3 NAME 'bpelModulePartnerLinksDesc' DESC 'Partner Links Documentation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
attributeTypes: ( 1.3.6.1.4.1.42.2.210.666.3.4 NAME 'bpelModuleSummaryDesc' DESC 'Summary Documentation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
attributeTypes: ( 1.3.6.1.4.1.42.2.210.666.3.5 NAME 'bpelModuleTechnicalInfoDesc' DESC 'Technical Info Documentation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
attributeTypes: ( 1.3.6.1.4.1.42.2.210.666.3.6 NAME 'bpelModuleVariablesDesc' DESC 'Variable Documentation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
attributeTypes: ( 1.3.6.1.4.1.42.2.210.666.3.7 NAME 'bpelActivitiesDesc' DESC 'Activities Section Documentation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
attributeTypes: ( 1.3.6.1.4.1.42.2.210.666.3.8 NAME 'bpelActivityDesc' DESC 'Activity Documentation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
-
add: objectClasses
objectClasses: ( 1.3.6.1.4.1.42.2.210.666.2.1 NAME 'bpelModule' DESC 'A BPEL Module' STRUCTURAL MUST (cn ) MAY ( bpelActivitiesDesc $ bpelModuleImportsDesc $ bpelModuleOverviewDesc $ bpelModulePartnerLinksDesc $ bpelModuleSummaryDesc $ bpelModuleTechnicalInfoDesc $ bpelModuleVariablesDesc ) )
objectClasses: ( 1.3.6.1.4.1.42.2.210.666.2.2 NAME 'bpelActivity' DESC 'A BPEL Activity' STRUCTURAL MUST (cn ) MAY ( bpelActivityDesc ) )


This is a very simplistic Object structure and I am assuming the contents of the description attributes is simple text. All information associated with the processes will be stored within the appropriate attribute and accessed using the cn=<BPEL Process Name>. An example of the structure can be seen in the image below.

In addition to this I created a new properties file, opendsConnection.properties to specify the connection information.

# OpenDS Connection Properties
ldap.username=cn=Directory Manager
ldap.password=adminadmin
ldap.authentication=simple
ldap.url=ldap://opends.tox.com:2389
ldap.driver.class=com.sun.jndi.ldap.LdapCtxFactory
ldap.search.base.dn=ou=Modules,dc=doc,dc=bpel,dc=tox,dc=com


In addition I modified the config.properties to add two additional properties.

# Specify the document writer
#document.writer.class = com.tox.doc.gen.oo.SimpleBpelWriterDocumentGenerator
#document.writer.class = com.tox.doc.gen.oo.JdbcBpelWriterDocumentGenerator
document.writer.class = com.tox.doc.gen.oo.LdapBpelWriterDocumentGenerator
# External Connection properties file
#connection.properties.filename = C:/Development/NetBeansModules/BPELDocumentationSuite/BpelDocumentGenerator/src/mysqlConnection.properties
connection.properties.filename = C:/Development/NetBeansModules/BPELDocumentationSuite/BpelDocumentGenerator/src/opendsConnection.properties
# Used to indicate if the inline documentation should be displayed in addition to that obtained external.
# It is up to the implementation classes to use this value.
include.inline.documentation = true

Finally I, obviously, added the OpenDS jars file to my classpath.

Methods

As mention briefly in the blog entry "Template Based BPEL Document Generation" to enhance the documentation we need to override the following methods:
  • protected String getBPELModuleOverviewText(TProcess process)
  • protected String getBPELModuleImportsText(TProcess process)
  • protected String getBPELModulePartnerLinksText(TProcess process)
  • protected String getBPELModuleActivitiesText(TProcess process)
  • protected String getBPELModuleVariablesText(TProcess process)
  • protected String getBPELModuleTechnicalInformationText(TProcess process)
  • protected String getActivityDescription(TProcess process, TActivity activity)
  • public Properties getConnectionPropertyNames()
  • public boolean connect()
  • public boolean connect(Properties connectionProps)
  • public boolean isConnected()
  • public boolean disconnect()
  • public boolean reconnect()
  • public boolean reconnect(Properties connectionProps)
As you can see from the code below the connection methods simply manage the connection to the OpenDS Directory whilst the getBPELModule.....Text methods perform essentially that same action. If we take the getBPELModuleOverviewText as the example (line 142) you can see that we first check that the process has been passed and then extract its name. Once we have the name we can build a very simple LDAP Query to extract the attributes associated with the Process. Once we have the resulting Enumeration we can scan this for the Appropriate Attribute and then retrieve its value.

The resulting string is appended to a StringBuffer before we check if the in-line Documentation is to be displayed as well, i.e. that added to the bpel file, if this is the case then it is extracted and appended to the StringBuffer before it is returned. The resulting string will then be processed by the underlying Abstract class and inserted into the OpenOffice Document at the appropriate bookmark.

Hopefully this short blog shows how simple it is to add you own concrete implementations that access you information about the BPEL Components from alternative locations.

Code





Pdf Example

The pdf generated below is based on the simple addition of a bpelModule Object and a number of bpelActivity Objects to my OpenDS instance.

Database




Comments:

Post a Comment:
Comments are closed for this entry.
About

As a member of the Oracle A-Team we specialise in enabling and supporting the Oracle Fusion Middleware communities.

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today