OSB cloning and customizing templates using the OSB’s API

Screen Shot 2013-02-21 at 14.38.39

Use Case :

We want to create dynamically ressources like Proxy Services and Business Services from a template previously created and customized them !

OSB provides some public APIs in order to do this properly.
http://docs.oracle.com/middleware/1213/osb/java-api/toc.htm

Tool operations :

DeleteProject
Transpose customizationFile
Clone & Customize Proxy and Business

all these operations are included in an ant build.xml file who call three WLST scripts named :
deleteProject.py
transposeCustomFile.py
parameterize.py

Implementation steps :

1 – Create an OSB template project (Proxy Service and Business Service Template)
2 – Deploy the template project
3 – Create a customization file Template
4 – Clone and Customize OSB ressources

1 – Create an OSB Template project :

The template is the skeleton that represent the ressources that will be cloned each time needed.

For this, create a new OSB project and add a proxy service and business service :


Deploy this project in your OSB domain.

2 – Deploy and generate the customization file :

When your template project is deployed, generate a customization file only for the template project.




3 – Create a customization file template :

Create a WLST project and add your ALSBCustomizationFile.xml previously created.

Copy the ALSBCustomizationFile and then rename the file to « ALSBCustomization.template »

Replace all the parameters of the ALSBCustomization.template you want to personalize during the customization like for example 
<tux:network-address>@NETWORK_ADDRESS@</tux:network-address>. 
 
All of these parameters should be added in a custom.properties file like :
NETWORK_ADDRESS=//localhost:7001


Then realize the transposeCustomFile.py WLST script in order to replace all the @parameters@ .


This script will generate the customizationFile needed to personalize the new projects.


4 – Clone & Customize  :

Now you have to design the parameterize.py script and a custom.properties which contained all the parameters needed in order to create our new OSB ressources.

The parameterize.py script will clone the Proxy and Business services in a new project. The new ressources created will then be customized with the ALSBCustomizationFile.xml previously created with the transposeCustomFile.py script.

For this you will have to use the ALSBConfigurationMBEAN that offers usefull methods like : 

findService()
createProject()
clone()
customize()
importfile()

At the end your WLST project should look like this :



Note : To be SOA Suite compliant the CustomizationFile is now called « Configuration Plan » under the OSB 12c version.

The EnvValueCustomizationType is deprecated in OSB 12c.

See the EnvValueActionCustomizationType new type.

The EnvValueTypes class contains all the public Environment Value type names.
A new EnvValueAction public class has been added

See the new Configuration Plan resources (owner, ownerQuery, refsToSearch)


Example :

To select all Split & Join and Business Services in the « myProject » projet.

<ownerQuery>
<resourceTypes>FLOW</resourceTypes>
<resourceTypes>Business Service</resourceTypes>
<refsToSearch>
              <type>Project</type>
              <path>myProject</path>
       </refsToSearch>
</ownerQuery>

 

5 Comments on “OSB cloning and customizing templates using the OSB’s API

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *