IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing monitor models > What are monitor models? > Monitor XML schema definition (monitor.xsd)

Relative path context roots

An XML Path Language (XPath) expression is used in an instance document to refer from one element to another element or from an element to a metric (for example, a metric value expression). When the XPath expression refers to a metric, use a relative path.

The xsd:string data type is used wherever a reference from one element to another is required in an XML instance document.

For example, consider the following XML schema snippet that defines the required structure for a counter:

<xsd:complexType name="CounterType" >
  <xsd:complexContent>
    <xsd:extension base="mon:BaseMetricType">
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
        <xsd:element name="incrementedWhen" type="mon:ReferenceType" 
              minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element name="decrementedWhen" type="mon:ReferenceType" 
              minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element name="setToZeroWhen" type="mon:ReferenceType" 
              minOccurs="0" maxOccurs="unbounded"/>
      </xsd:choice>		
    </xsd:extension>
  </xsd:complexContent>
</xsd:complexType>

<xsd:complexType name="ReferenceType">
   <xsd:attribute name="ref" type="xsd:string" use="required" />
</xsd:complexType>

The following XML snippet defines a counter according to the previous structure:

<counter displayName="Counter" id="Counter" type="xsd:integer">
  	<incrementedWhen ref="/SimpleClaim/MDM/RootMonitoringContext/ExpressClaimActivity/ActivityStartedTransition"/>
	<incrementedWhen ref="ActivityForceRetriedTransition"/>
</counter>

Each of the <incrementedWhen> elements of the <counter> contains a ref attribute with an XPath expression that can be resolved to a particular trigger that is defined in the XML document. In this XML schema, absolute path expressions (those starting with a forward slash ("/") can be interpreted as a path of ID values starting at the root of the document.

The uniqueness constraints imposed on the ID attributes (see ID uniqueness constraints) guarantee that path expressions resolve to only one target object.

Notice the difference between the use of an XPath expression to reference another part of the monitor model, such as described in the previous paragraph, and the use of an XPath expression referencing a metric, for example, within a metric value expression. Absolute paths are supported in the first case but not in the second case. Relative paths must be used in the second case, which includes expressions in any of the following places:

Monitor XML schema definition (monitor.xsd)