Instrumenting the business process using Java Methods

After designing the BTM model, the business processes must be instrumented.

This example shows how to instrument a simple process. In this case, it is a database query that is exposed as a web service. The process is monitored on both entry and exit using the TrueSight Middleware and Transaction Monitor transaction pathway shown below.

To instrument the business process

For each monitoring point in the business process (Sample BTM Model figure below), insert a Java Method.

  1. Enter the parameter values. The Java Method configuration is listed in the following table.

    Parameter

    Value

    Name

    As required.

    Description

    As required.

    Java Global Instance

    The BTM Java Global Instance

    Library

    The BTM Alias Library

    Class

    com.mqsoftware.BTM.mbean.helper.BTMGlobalHelper

    Method

    monitorActivity(…)

    Sample BTM Model



    BTM Instrumentation

  2. Assign the input parameters for the method invocation.

    BTM Instrumentation Method Inputs




    These method parameter values can be static, as shown for most parameters in Java Method Signature below. Parameters can be dynamically populated at runtime, as shown for Parameter3 (the transaction ID), which is populated with the ProcessId from the BusinessWorks process context data.

    The full range of transformation tools are available through the XPath formula builder to populate the parameter values allowing reuse of monitored components within different processes, provided sufficient runtime context is available in the process data to discriminate the components role at runtime.

    The java method signature is shown below. Where parameters are not used, an empty string can be statically declared in the method invocation.

    Java Method Signature
    public void monitorActivity(
    String modelName,
    String applicationName,
    String transactionId,
    String instanceId,
    String resourceId,
    String returnCode,
    String aliases,
    String payloadNames,
    String payloadValues,
    String payloadLabels);

    The Java method API specification is provided in the table below.
  3. Repeat for each instrumentation point in all of the business processes in the project.

    Parameter

    Value

    Required

    modelName

    The transaction pathway model to which the transaction being monitored belongs. The value specified for this parameter must be the same as the name of a model created using the TrueSight Middleware and Transaction Monitor BTM modeler.

    Yes

    applicationName

    The name specified for the applicationName must match the regular expression used as the extension detail.

    Yes

    transactionId

    The transaction ID for the current transaction. The transaction ID must be unique with respect to the transaction pathway to which the transaction belongs and must not change during the lifetime of the transaction within the specified transaction pathway.

    Yes

    instanceId

    The instance ID for the current transaction. If the same activity processes the transaction more than once (e.g. a loop), each time it processes the transaction it must have a unique instance ID.

    Optional

    resourceId

    The resource identifier for the current transaction. This should match the resource identifier specified for the activity in the transaction pathway model. Specify this by selecting the activity in the model and entering the resource identifier in either the Input ID or Output ID fields in the Input Associations or Output Associations tables respectively.

    Yes

    returnCode

    The result of the current transaction segment. TrueSight Middleware and Transaction Monitor uses this value to determine if the activity succeeded and what message to display.

    Yes

    aliases

    Specifies an identifier for a transaction used in addition to the transaction ID, and is associated with the transaction ID.

    Optional

    payloadNames

    A comma separated list of payload names. This name appears on the Payload Data tab of the Activity properties. Payload data is optional.

    Optional

    payloadValues

    A comma separated list of payload values. The number of payload values must match the number of payload names.

    Optional, unless payload names are specified.

    payloadLabels

    A comma separated list of payload labels. Labels are used to classify your data. Each piece of data can have its own label assigned to it. Labels are used in the physical tree as a component of the SLA metric. Labels are optional.

    Yes

Was this page helpful? Yes No Submitting... Thank you

Comments