Error on Get Record Count

Hello,
I have a class that performs a graph and when it is completed I want to retrieve the number of records. My code looks like this:


result = runGraph.executeGraph(graph, runtimeContext);
while (result.isDone()) {;}
Map<String, Node> mapNodes = graph.getNodes();
Node node;
node = mapNodes.get("testNode");
int numRec = node.getInputPort(0).getInputRecordCounter();

but i get a NullPointer exception on loast istruction…What am I doing wrong?

I modified the code in the following way and it’s all ok:


result = runGraph.executeGraph(graph, runtimeContext);
Result resultR;
resultR = result.get();
Map<String, Node> mapNodes = graph.getNodes();
Node node;
node = mapNodes.get("testNode");
int numRec = node.getInputPort(0).getInputRecordCounter();

Probably the most convenient way how to get these type information is to use our JMX interface or for local purpose just call

graph.getWatchdog().getCloverJMX().getGraphTracking()…

CloverJMX is a JMX mbean which easily provides all the tracking information about running graph.

If you decide to use direct the JMX interface, let me know to provide more information about that.

Martin Zatopek