Collecting Process, Activity, and Transition Statistics

In this sample, use the tibco.bw.sample.application.execution.event.subscribe sample to collect statistics for process instances, activity instances, and transitions in the tibco.bw.sample.palette.http.RequestResponse sample project.

When working this sample, any of the following application statistics can be collected.

Process Instance Statistics

Statistic Description
Application Name Name of the application.
Application Version Version of the application.
Module Name Name of the TIBCO ActiveMatrix BusinessWorks™ module.
Module Version Version of the ActiveMatrix BusinessWorks™ module.
Component Process Name Name of process configured to a component. If the process is a non in-lined sub process, this could be empty.
Job ID Job ID of the process.
Parent Process Name If the process is an in-lined sub process, the name of the parent process.
Parent Process ID If the process is an in-lined sub process, the instance ID of the parent process.
Process Name Name fo the process.
Process Instance ID Instance ID of the process.
Start Time Process instance start time.
End Time Process instance end time.
Elapsed Time Elapsed time of an activity is the time difference (in milliseconds) between start time and end time of the activity. Between the start and end time, control may get switched with other activities from the other jobs. This is the time taken to execute an activity plus all the delays in acquiring resources like engine threads, JDBC connections, network, and so on.

The elapsed time includes the execution time plus time taken for evaluating all the forward transitions from that particular activity and getting the next activity ready to execute, which includes executing its input mapping if all dependencies are met.

Eval Time The Eval Time for an activity is the actual time (in milliseconds) used by the activity itself to complete while using the engine thread. Asynchronous activities may use other threads not included in this time.
Status Status of process instance, for example: Completed or Faulted.

Activity Instance Statistics

Statistic Description
Application Name Name of the application.
Application Version Version of the application.
Module Name Name of the ActiveMatrix BusinessWorks module.
Module Version Version of the ActiveMatrix BusinessWorks module.
Activity Name Name of the activity.
Process Name Name of the process.
Process Instance ID Instance ID of the process.
Start Time When the activity instance started.
End Time When the activity instance ended.
Eval Time The time between the beginning and end of the evaluation period for the activity. If the activity completes in one step, the evalTime and elapsedTime would be the same. However, some activities, such as Request, Reply, or Wait for... activities typically do not complete in one step.
Elapsed Time Elapsed time of an activity is the time difference (in milliseconds) between start time and end time of the activity. Between the start and end time, control may get switched with other activities from other jobs.

This is the time taken to execute an activity plus all the delays in acquiring resources like engine threads, JDBC connections, network, and so on.

The elapsed time is Eval Time plus the time taken for evaluating all the forward transitions from that particular activity.

Status Status of activity, for example: Completed, Faulted or Canceled.

Transition Statistics

Statistic Description
Application Name Name of the application.
Application Version Version of the application.
Module Name Name of the ActiveMatrix BusinessWorks module.
Module Version Version of the ActiveMatrix BusinessWorks module.
Transition Name Name of the transition
Process Name Name of the process.
Process Instance ID Instance ID of the process.
Component Process Name

Name of process configured to a component . If the process is a non in-lined subprocess, this could be empty.

Target Activity Name Name of the activity the transition targets.

Procedure

  1. Import the sample into TIBCO Business Studio™ for BusinessWorks™ by right-clicking in the Project Explorer pane, and selecting Import > Existing Studio Projects into Workspace.
  2. In the Import Projects window, ensure the option Select root director field is selected, and specify the location of the tibco.bw.sample.application.execution.event.subscribe sample. The sample is located at BW_HOME/samples/source/event-subscriber/tibco.bw.sample.application.execution.event.subscriber.
  3. Click Finish to import the sample project.
  4. In the samples directory, select palette > http > RequestResponse and double-click tibco.bw.sample.palette.http.RequestResponse.zip. For more information, see Accessing Samples .
  5. In Project Explorer expand the tibco.bw.sample.palette.http.RequestResponse project.
  6. Fully expand the Processes directory and double-click HTTP_Request_Response_Example.bwp.
  7. Click Run > Debug Configurations.
  8. At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
  9. Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the check box next to tibco.bw.sample.palette.http.RequestResponse.application.
  10. Click the Bundles tab and ensure the following bundles in your workspace are selected:
    • tibco.bw.sample.application.execution.event.subscriber (1.0.0.qualifer)
    • tibco.bw.sample.palette.http.RequestResponse (1.0.0.qualifer)
    • tibco.bw.sample.palette.http.RequestResponse.application (1.0.0.qualifer)
  11. Click Debug.
    This runs the sample in Debug mode.
  12. Run lendpoints at the prompt in the Console tab to obtain the endpoint for the application.
  13. Copy the endpoint URL of the application.
  14. Open a browser window, and paste the endpoint URL into the address bar.
  15. Click the Terminate icon to stop the process.

Result

Details about process instances, activity instances, and transitions in tibco.bw.sample.palette.http.RequestResponse are displayed on the Console tab in TIBCO Business Studio for BusinessWorks.
<>@BWEclipseAppNode> 
ProcessInstance Auditing Event {
	Application Name:tibco.bw.sample.palette.http.RequestResponse.application
	Application Version:1.0
	Module Name:tibco.bw.sample.palette.http.RequestResponse
	Module Version:1.0.0.qualifier
	ProcessInstanceId:bw0a100
	Process Name:tibco.bw.sample.palette.http.requestresponse.HTTP_Request_Response_Example
	State:SCHEDULED
}

ProcessInstance Auditing Event {
	Application Name:tibco.bw.sample.palette.http.RequestResponse.application
	Application Version:1.0
	Module Name:tibco.bw.sample.palette.http.RequestResponse
	Module Version:1.0.0.qualifier
	ProcessInstanceId:bw0a100
	Process Name:tibco.bw.sample.palette.http.requestresponse.HTTP_Request_Response_Example
	State:STARTED
}

Activity Auditing Event {
	Application Name:tibco.bw.sample.palette.http.RequestResponse.application
	Application Version:1.0
	Module Name:tibco.bw.sample.palette.http.RequestResponse
	Module Version:1.0.0.qualifier
	ProcessInstanceId:bw0a100
	Process Name:tibco.bw.sample.palette.http.requestresponse.HTTP_Request_Response_Example
	Activity Name:Incoming_HTTP_Request
	State:STARTED
}

Transition Auditing Event {
	Application Name:tibco.bw.sample.palette.http.RequestResponse.application
	Application Version:1.0
	Module Name:tibco.bw.sample.palette.http.RequestResponse
	Module Version:1.0.0.qualifier
	ProcessInstanceId:bw0a100
	Process Name:tibco.bw.sample.palette.http.requestresponse.HTTP_Request_Response_Example
	

Activity Auditing Event {
	Application Name:tibco.bw.sample.palette.http.RequestResponse.application
	Application Version:1.0
	Module Name:tibco.bw.sample.palette.http.RequestResponse
	Module Version:1.0.0.qualifier
	ProcessInstanceId:bw0a100
	Process Name:tibco.bw.sample.palette.http.requestresponse.HTTP_Request_Response_Example
	Activity Name:Incoming_HTTP_Request
	State:COMPLETED
}

Activity Auditing Event {
	Application Name:tibco.bw.sample.palette.http.RequestResponse.application
	Application Version:1.0
	Module Name:tibco.bw.sample.palette.http.RequestResponse
	Module Version:1.0.0.qualifier
	ProcessInstanceId:bw0a100
	Process Name:tibco.bw.sample.palette.http.requestresponse.HTTP_Request_Response_Example
	Activity Name:Log1
	State:STARTED
}
22:25:19.463 INFO  [bwEngThread:In-Memory Process Worker-1] c.t.b.p.g.L.t.b.s.p.h.R.Log1 - No matching 'NEWS' source found.

Activity Auditing Event {
	Application Name:tibco.bw.sample.palette.http.RequestResponse.application
	Application Version:1.0
	Module Name:tibco.bw.sample.palette.http.RequestResponse
	Module Version:1.0.0.qualifier
	ProcessInstanceId:bw0a100
	Process Name:tibco.bw.sample.palette.http.requestresponse.HTTP_Request_Response_Example
	Activity Name:Log1
	State:COMPLETED
}

ProcessInstance Auditing Event {
	Application Name:tibco.bw.sample.palette.http.RequestResponse.application
	Application Version:1.0
	Module Name:tibco.bw.sample.palette.http.RequestResponse
	Module Version:1.0.0.qualifier
	ProcessInstanceId:bw0a100
	Process Name:tibco.bw.sample.palette.http.requestresponse.HTTP_Request_Response_Example
	State:COMPLETED
Tip: You can use this sample to build your own application statistics collection tool. Follow these steps to do this:
  1. From the Project Explorer tab, select tibco.bw.sample.application.execution.event.subscriber > src > tibco.bw.sample.application.execution.event.subscriber > BWEventSubscriber.java.
  2. Update handleEvent(Event event) method based on your use case.
  3. Save your changes to the project.
  4. Export the project as a plug-in by right-clicking on tibco.bw.sample.application.execution.event.subscriber and selecting export > Export > Plug-in Development > Deployable plug-ins and fragments.
  5. In the Export wizard, ensure the tibco.bw.sample.application.execution.event.subscriber project is selected, and specify a location to export the plug-in.
  6. After the project has been exported as a JAR file to the location you specified , locate the JAR file in the plugins folder, and copy and paste it to the shared folder at BW_HOME/system/hotfix/shared.
  7. To load this plug-in into runtime, restart any running AppNodes.

Your application statistics collection tool has been added to your runtime environment.