Thursday, July 3, 2008

more on BPELProcessHandle class

In one of my previous blogs on invoking BPEL from java using RMI I had mentioned the different classes used to connect to the BPEL process.

As you know Locator class helps you to connect to bpel domain. Once you have the Locator instance the BPELProcess instance can be accessed using the lookup service method by giving the bpel process Id.

For example I created a BPElProcess named SensorTest and deployed it.

// code on how to create a locator instance have been explained in my previous blog on RMI

IBPELProcessHandle bpelProcess = locator.lookupProcess("SensorTest");

IBPELProcessHandle is the reference which will represent the process.

To view what all sensors are associated with the particular process- in this case SensorTest

System.out.println("sensors:\n" + bpelProcess.getSensorDefinitions());

System.out.println("sensor actions:\n" + bpelProcess.getSensorActionDefinitions());

Output will look like following


<sensors xmlns="">

<sensor sensorName="sensor_recieve" classname="" kind="activity" target="receiveInput" xmlns:client="" xmlns:pc="" xmlns:tns=" SensorTest ">

<activityConfig evalTime="activation"/>


<sensor sensorName="VariableSensor_1" classname="" kind="variable" target="$outputVariable/payload/client:SensorTestProcessResponse/client:result" xmlns:client=" SensorTest " xmlns:pc="" xmlns:tns="">

<variableConfig outputDataType="string" outputNamespace=""/>



sensor actions:

<actions xmlns="">

<action name="reply_sensor" publishName="" publishType="Custom" enabled="true" filter="" publishTarget="com.geo.SensorLogger" xmlns:pc="" xmlns:tns=" SensorTest ">





To view SOAP location of the particular process-

System.out.println("SOAPLocation:\n" + bpelProcess.getSOAPLocation());

To view the list of errrors

System.out.println("errors:\n" + bpelProcess.getErrors());

Try out and see for yourself :)

No comments: