Get Context ID of a flow

Does anybody knows how to get the Context ID of a flow in run time?

I would like to return the Context ID to the client that invokes the service. How can I do this ?


João Caseiro


Use the webMethods JavaAPI reference(
and diff TContext() methods to accompish this task.

In the Developer tool under Help menu see the Java API Reference section.


I am trying to do the same thing… I have looked at the documentation for the Context and TContext classes and cannot find any reference to the “ContextId” property.

thanks in advance

Sorry for the repeat post… but does anyone know how to do this? It seems like a reasonable thing to want to do.

We want the context id so that we can include a link to the monitor application in our error notifications. This would allow support to immediately see the full details of the service that failed, and possibly to resubmit after corrective action has been taken.

The “Context” classes in the API seem like they are for invoking services… not for querying the current context.

Any ideas?


InvokeState is = InvokeState.getCurrentState();
IAuditRuntime ar = is.getAuditRuntime();
String context = ar.getContextStack();

IDataCursor pipelineCursor = pipeline.getCursor();
IDataUtil.put(pipelineCursor,“context”, context);

This returns a string list of context IDs. One problem with this is that the string of context ids are not necessarily in order. I would like a way to explicitly take the context ID that I want (i.e. root/parent/current). Can anyone make this happen?