WebSphere WebSphere Enterprise Service Bus, Version 6.0.1 Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Adding property descriptions to an event definition

A property description is an instance of the class PropertyDescription.

Why and when to perform this task

To add a property description to an event definition, you must first create a new property description and then set the values of its fields. You can then add the property description to the event definition.

Steps for this task

  1. To create a new property description, create an instance of PropertyDescription, specifying the name and path of the property.
    PropertyDescription propDesc = new PropertyDescription(name, path);
    The parameters of this constructor are as follows:
    name
    The name of the property. This must be the name of a simple property either of the CommonBaseEvent element or one of its children.
    path
    An XPath location path specifying the path to the property. For a top-level property of CommonBaseEvent (such as severity or priority), path should be null.
    The returned object is a new PropertyDescription object.
  2. Populate the fields of the property description. The PropertyDescription class provides a setter method for each of the fields in a property description. Refer to the Javadoc API documentation for complete information about these methods. For example, to specify that a property is required, you would set the required property to true using the setRequired(boolean) method:
    propDesc.setRequired(true);
  3. Add the property description to the event definition using the EventDefinition.addPropertyDescription() method.
    definition.addPropertyDescription(propDesc);
    If the event definition already includes another property description with the same name and path, a DescriptionExistsException exception is thrown.

Example

The following code fragment creates a new property description, populates it with data, and adds it to an event definition.
PropertyDescription propDesc = new PropertyDescription("severity",null);
propDesc.setRequired(true);
propDesc.setMinValue('30');

// definition is a valid event definition
definition.addPropertyDescription(propDesc);

Task topic

Terms of Use | Rate this page

Timestamp iconLast updated: 13 Dec 2005
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.websphere.wesb.doc\doc\tcei_admin_addPropertyDescription.html

(C) Copyright IBM Corporation 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)