Tug’s Blog

My journey in Big Data, Hadoop, NoSQL and MapR

BPEL in Cluster: In Which Node My Process Is Working

| Comments

I was helping a customer with his BPEL in cluster and we needed to follow the flow and on which machine the instance was running.

I simply use a bpel:exec activity with the following code:

1
2
3
4
5
6
7
8
9
java.net.InetAddress addr = null;

try {
  addr = java.net.InetAddress.getLocalHost();
}
catch (Exception e) {
  System.out.println("EXCEPTION :"+ e);
}
setVariableData("HostNameVariable", addr.getCanonicalHostName());

This code is just an example of what could be done. Here I am using java.net code API and put the result in a BPEL global variable using the setVariableData method. Obviously you will use appropriate code to differenciate the different nodes for example the name of the OC4J instance, hostname, … or any interesting value.

Comments