Skip to main content

Creating customized classification systems with WebSphere Service Registry and Repository V6.0.0.1 and higher

A step-by-step guide for administrators to create new classification systems and lifecycles for WebSphere Service Registry and Repository

Ian Shore (ishore@uk.ibm.com), IT Specialist, IBM
Ian Shore is an IT Specialist in the Application and Integration Middleware Software division of the IBM Software Group. For technical questions or comments about the content of this tutorial contact Ian at ishore@uk.ibm.com.

Summary:  The creation of new enterprise-specific classification systems and lifecycles for use within the WebSphere Service Registry and Repository is essential for your users to manage and govern the business data held within WebSphere Service Registry and Repository while using your enterprise's terminology. The default classification systems and lifecycle within the samples are good to understand how WebSphere Service Registry and Repository uses these features, but how do you create your own? This article describes how to quickly create, load, update and use new classification systems and lifecycles within WebSphere Service Registry and Repository V6.0.0.1 and higher without having to use any special tooling.

Date:  28 Mar 2007
Level:  Intermediate
Activity:  502 views

Introduction

This article demonstrates how you can quickly create and install a new classification system from a Web Ontology Language (OWL) file and a new default lifecycle using a State Adaptive Choreography Language (SACL) file and an OWL file for use within IBM® WebSphere® Service Registry and Repository V6.0.0.1 and higher. It enables the WebSphere Service Registry and Repository configuration administrator to exploit an existing hierarchy of categories or a particular lifecycle, which may already exist within their enterprise, within WebSphere Service Registry and Repository. Once configured within WebSphere Service Registry and Repository, it will then be available for other WebSphere Service Registry and Repository users or for a proof of concept without having to spend time loading, learning or using any additional tooling.

The approach taken is to use a simple text editor to create the category hierarchy or lifecycle flow and then use a Java™ application to generate the appropriate OWL or SACL files. You can use this article to extend it to add a GUI front-end to create the text files to feed into the OWL and SACL creator applications.

Create a new classification system for WebSphere Service Registry and Repository

Overview

Your enterprise may already exploit a hierarchy of categories (alias classes) elsewhere within your company that you would like to reuse within WebSphere Service Registry and Repository. For the benefit of this article, we use the following hierarchy, from MadeUpCo Enterprises, as a simple example on how to use this utility.


Figure 1. Hierarchy of classes for MadeUpCo Enterprises
MadeUpCo Hierarchy

This figure shows that any category has at most one parent category. Multiple parents are not supported within a WebSphere Service Registry and Repository classification system.

Creating the input file

The first step is to take this hierarchy of categories and reformat them into a flat text file. Each level of category is defined by having 2 x level spaces at the start of each line, where the top-level category, MadeUpCo Enterprises is level 0 (zero). This will result in a text file (we will call it MadeUpCo.txt) which looks like Listing 1:


Listing 1. MadeUpCo.txt text file
                
          
MadeUpCo Enterprises
  Departments
    Finance
    Human Resources
    Sales
    Development
  Products
    Hardware
      32-bit
      64-bit
      Single core
      Multi-core
    Software
          

If your hierarchy labels have special characters in them (&, <, >, ') the OWL creation class will convert them into escaped text so that they can display correctly from with the UI. Additionally, if there is a double-quote (") in the label it will be converted to a single-quote.

Throughout this text file you can add comment lines by starting the line with a # character. All the comment lines in the text file will be grouped into a comment section at the start of the rdf element within the OWL file.

To uniquely identify the newly created OWL file, you have the ability, within the text file, to specify a namespace for the classifications by having a line that starts with NAMESPACE:. If you do not specify this line here or on the command line, a default namespace will be used: http://www.ibm.com/ontology/system/namespace.

An OWL file should have an Ontology element to describe what the file represents. This label can be defined by having a line starting with ONTOLOGY:. This is the top-level label that you will see in the Browse classifications view within the UI. You can additionally add a comment (using a line starting COMMENT:) describing the ontology for the benefit of others; it will not be displayed in the UI.

The start of your text file should now look like Listing 2 below:


Listing 2. Code for the beginning of the text file
                # MadeUpCo Enterprises
# ---
# General classification system for MadeUpCo Ent.

ONTOLOGY:MadeUpCo Enterprises Hierarchy
COMMENT:This hierarchy was created using an automated OWL creation tool
NAMESPACE:http://www.madeupco.com/classification

# The hierarchy starts here!
          

Creating the OWL file

Now that we have created the input file, we can invoke the utility class to generate the OWL file that can then be read and parsed by WebSphere Service Registry and Repository and used to classify entities within WebSphere Service Registry and Repository.

The syntax of the class available in the resources jar is (Notice that angle brackets and square brackets represent required and optional parameters):

CreateOWL <input filename> [namespace] [output filename]
          

By default, if you do not specify an output filename, the output will be piped to stdout. As alluded to above, the namespace (NAMESPACE:) that you may have specified in the input file can be overridden by specifying one as input to the CreateOWL utility. If one is not specified within the input file or on the command line, then it will use [output filename] if specified, as the namespace; for example, file:///MadeUpCo.txt. Otherwise, it will use http://www.ibm.com/ontology/system/namespace

To convert the input text file into an understandable OWL file, run the following at the command prompt:

java -cp quickStartUtilities.jar
     com.ibm.serviceregistry.quickstart.CreateOWL MadeUpCo.txt MadeUpCo.owl
          

Loading the OWL file into WebSphere Service Registry and Repository

The output file: MadeUpCo.owl, can now be loaded into your WebSphere Service Registry and Repository via the Web UI or via the administration scripts. Within the Web UI, you will be able to browse this new classification system as shown in Figure 2.

To load the OWL file using the WAS administration script, use the following command:

wsadmin -wsadmin_classpath ServiceRegistryClient.jar
        -f loadOntologySystem.jacl /temp MadeUpCo.owl
          

Note that paths to the relevant files will need to be included and the path to the OWL file must, if necessary, use forward slashes.


Figure 2. MadeUpCo Enterprises new classification system within WebSphere Service Registry and Repository.
Hierarchy in WebSphere Service Registry and Repository

Using the new classification system

Entities within WebSphere Service Registry and Repository can now be classified with any of the classifications from MadeUpCo Enterprises Hierarchy.

Then, for example, you can run API queries to retrieve all the entities that have been classified with one of these new classifications. The following query searches for entities that are classified by the Development class or any of its child classes:

/WSRR/WSDLDocument[classifiedByAllOf('http://www.madeupco.com/classificationDevelopment')]
          

Create a new lifecycle for WebSphere Service Registry and Repository

Overview

The first stage of creating a new lifecycle is to model the states and transitions that you wish to represent in WebSphere Service Registry and Repository. For example, Figure 3 is a lifecycle that MadeUpCo Enterprises would like to introduce into WebSphere Service Registry and Repository.


Figure 3. MadeUpCo Enterprises lifecycle state machine
MadeUpCoLifecycle

As WebSphere Service Registry and Repository can only have one lifecycle registered at once, no entities within WebSphere Service Registry and Repository must be governed with an existing lifecycle.

Creating the input file

This section shows you how to create a new WebSphere Service Registry and Repository lifecycle from a text file. For MadeUpCo Enterprises, we will call it MadeUpCoLifecycle.txt. The format for any lifecycle transformation is from an old state via a transition to a new state. The following syntax describes the way this is represented within the text file is:

[old state]--<transition name>--><new state>
          

A new lifecycle initial state within this file is identified by the first line that has an empty [old state]; for example, --Object created-->Created

Now that the lifecycle has been defined, we can create the text file. The lifecycle using the above syntax can be described as in Listing 3 below:


Listing 3. Text file with syntax
                
--Object creation-->Created
Created--Approve-->Planned
Created--Non-conformant-->Inappropriate
Inappropriate--Retry-->Created
Inappropriate--Close-->Closed
Planned--DCUT-->Developed
Planned--Drop-->Dropped
Planned--Defer-->Deferred
Developed--Test-->Tested
Tested--Deploy-->Deployed
Tested--Stage-->Staged
Staged--Deploy-->Deployed
Deployed--Warn for retire-->Retiring soon
Deployed--Retire-->Retired
Retiring soon--Retire-->Retired
Retired--Delete-->Unavailable
          

As with the OWL creation text files, these files can also have comment lines by having a line that starts with a # character.

There are two additional SACL file descriptors that you can include at the top of your text file. They provide the SACL a descriptive label (use LIFECYCLE:) and a namespace for the SACL (use NAMESPACE:). If you do not define the namespace within the file or on the command line the following default namespace will be used: http://www.ibm.com/lifecycle/system/namespace.

A sample text file header, for MadeUpCo Enterprises could look like Listing 4:


Listing 4. Sample text file header for MadeUpCo Enterprises
                
#
# Sample lifecycle for MadeUpCo Enterprises ...
#
LIFECYCLE:MadeUpCo Enterprises Lifecycle
NAMESPACE:http://www.madeupco.com/lifecycle

####
# DEPLOYMENT LIFECYCLE
####
          

Creating the SACL file

Now that we have created the input file, we can invoke the utility class to generate the SACL file that can then be read and parsed by WebSphere Service Registry and Repository and used as the governance lifecycle within WebSphere Service Registry and Repository.

The syntax of the class available in the resources jar is:

CreateSACL <input filename> [namespace] [output filename]
          

By default, if you do not specify an output filename, the output will be piped to stdout. As alluded to above, the namespace (NAMESPACE:) that you may have specified in the input file can be overridden by specifying one as input to the CreateSACL utility. If one is not specified within the input file or on the command line then it will use [output filename] if specified, as the namespace; for example, file:///MadeUpCoLifecycle.txt. Otherwise, it will use http://www.ibm.com/lifecycle/system/namespace

To convert the input text file into an understandable SACL file, run the following at the command prompt:

java -cp quickStartUtilities.jar com.ibm.serviceregistry.quickstart.CreateSACL
     MadeUpCoLifecycle.txt MadeUpCoLifecycle.sacl
          

Create the matching OWL file

SACL files that are going to be loaded into WebSphere Service Registry and Repository need a corresponding OWL file. This is created by using the XSLT file that is included with your WebSphere Service Registry and Repository installation; GenerateLifecycleOntology.xsl. To create the OWL you will need to invoke the following from the command prompt:

java org.apache.xalan.xslt.Process
     -in .\MadeUpCoLifecycle.sacl
     -xsl .\GenerateLifecycleOntology.xsl
     -out .\MadeUpCoLifecycle.owl
          

The output files; MadeUpCoLifecycle.sacl and MadeUpCoLifecycle.owl, can now be loaded into your WebSphere Service Registry and Repository via the administration scripts or, for the owl file, via the WebUI.

Load the new SACL and matching OWL files into WebSphere Service Registry and Repository

Important: For WebSphere Service Registry and Repository V6.0.0.1, only one SACL file should exist within WebSphere Service Registry and Repository at any one time. Therefore, you need to ensure that there are not any entities under lifecycle and governance control within WebSphere Service Registry and Repository before removing your current lifecycle. Otherwise, unpredictable results could occur.

To remove the current SACL configuration file from WebSphere Service Registry and Repository, the following WAS administration command can be used:

wsadmin -wsadmin_classpath ServiceRegistryClient.jar
        -f deleteConfiguration.jacl
        LifecycleDefinition SACL
          

Note that paths to the relevant files will need to be included.

To load the new MadeUpCo Enterprises SACL file, the following command can be used:

wsadmin -wsadmin_classpath ServiceRegistryClient.jar
        -f loadConfiguration.jacl
        /temp MadeUpCoLifecycle.sacl LifecycleDefinition SACL true
          

Note that the path to the SACL file must, if necessary, use forward slashes.

The matching OWL file can be loaded into WebSphere Service Registry and Repository in the same way as loading the hierarchy OWL file is the first part of this article, for example,

wsadmin -wsadmin_classpath ServiceRegistryClient.jar
        -f loadOntologySystem.jacl
        /temp MadeUpCoLifecycle.owl
          

Using the new lifecycle definition

The new lifecycle can now be applied to entities within WebSphere Service Registry and Repository by performing the makeGovernable action either using the API or applying the Default transition to an entity. After applying the default transition you will be able to see, from within the WebUI (Figure 4), that your next transition from Created can be Approve or Non-conformant, as visualized in Figure 3.


Figure 4. Governed entity within WebSphere Service Registry and Repository using MadeUpCo Enterprises new lifecycle.
Lifecycle in WebSphere Service Registry and Repository

Conclusion

In this article, you learned how to quickly create and install a new classification system and a new default lifecycle for use within WebSphere Service Registry and Repository V6.0.0.1, so you can take advantage of the existing hierarchy of categories or a particular lifecycle within WebSphere Service Registry and Repository.



Download

DescriptionNameSizeDownload method
Utility classes to use with this article0703_shore-quickStartUtilities.jar18KBHTTP

Information about download methods


Resources

Learn

Get products and technologies

About the author

Ian Shore is an IT Specialist in the Application and Integration Middleware Software division of the IBM Software Group. For technical questions or comments about the content of this tutorial contact Ian at ishore@uk.ibm.com.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere, Java technology
ArticleID=203989
ArticleTitle=Creating customized classification systems with WebSphere Service Registry and Repository V6.0.0.1 and higher
publish-date=03282007
author1-email=ishore@uk.ibm.com
author1-email-cc=webserv@us.ibm.com

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Rate a product. Write a review.

Special offers