IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

How to get the context Id?

  • 1.  How to get the context Id?

    Posted Wed June 16, 2004 10:50 AM

    Hi,

    I would like to improve the monitoring of my integration. To do this, I need to get the contextID used in monitoring tables, from the IS service. I don’t find which methods I must use to get It. The Idea is to use the ContextID as a key to join my specific logging table with the webMethods one.

    Do you have some idea to do this?

    [IS 6.1 on windows]

    Thanks a lot for your help

    R�


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 2.  RE: How to get the context Id?

    Posted Thu June 17, 2004 01:27 AM

    Hi,
    you cam try WmMonitor/wm.monitor.instance:getInstance from the WmMonitor-Package.
    You need the InstanceID and you can get the ContextID
    Hope that helps!

    Ralf


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 3.  RE: How to get the context Id?

    Posted Thu June 17, 2004 02:05 AM

    Hi,

    Thank you for your answer.

    It’s true if I use the modeler, I can get the instanceID as an input of my service.

    But unfortunately, I don’t use the process modeling approach. So I don’t know how to find the instanceID or contextID when I’m in the service.

    R�


    #webMethods-General
    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: How to get the context Id?

    Posted Sat June 19, 2004 02:50 AM

    Well, you can try this “unsupported” code:

    String contextstack = InvokeState.getCurrentState().getAuditRuntime().getContextStack();

    What you get is a stack containing 3 elements, rootcontext, parentcontext and contextid. Sometimes, the stack contains only 2 elements or 1 element:

    • rootcontext+prentcontextid in which case contextid=parentcontextid
    • or rootcontextid only, in which case, contextid=parentcontextid=rootcontextid, I think…

    I am still wondering why these type of info are not yet public due to their usefullness…


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 5.  RE: How to get the context Id?

    Posted Mon June 21, 2004 02:22 AM

    Hi,

    It works well!

    Thanks for your help.

    R�


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 6.  RE: How to get the context Id?

    Posted Wed October 27, 2004 02:39 PM

    What is the requiremnet for the above code ? Which classes does it require ?


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 7.  RE: How to get the context Id?

    Posted Thu March 17, 2005 12:44 AM

    I am really surprised why the API for getting the ContextID is not public. Considering , most of the services in the WmMonitor package require contextId as the input parameter. Unless one has the conntextID, there is no way one can use these services.

    webMethods should make this API public ASAP.


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 8.  RE: How to get the context Id?

    Posted Fri May 12, 2006 06:52 AM

    HI

    I am using the EventManager to subscribe all exception events and the mail will be sent with the error.But i need the Service context id which has generated the error so tha it can be easy for republishing.

    So for the above scenario how can i get the Context id?

    Thanks
    Srinivas


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 9.  RE: How to get the context Id?

    Posted Tue May 23, 2006 02:19 PM

    Please run the following query in TOAD with the required Connection name and password

    SELECT contextid, servicename,status FROM wmservice
    WHERE servicename LIKE ‘%%’

    Include the ServiceName between ‘%%’ .

    This will look like ‘%Service_Name%’

    So,if you know the Service Name ,then you can get the contextid.


    #webMethods
    #webMethods-General
    #Integration-Server-and-ESB


  • 10.  RE: How to get the context Id?

    Posted Fri July 27, 2007 01:13 PM

    Of course that will not work if the service has had errors before or has had multiple errors because you will get many context ids and not the one for the specific event that you are dealing with.

    There seems to be no way to get the context id of the event using EventManager.


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 11.  RE: How to get the context Id?

    Posted Tue April 08, 2008 07:43 AM

    To enable effective searching of logged Services we need to Modify the Context ID and add transaction specific data to it, so that it becomes easy to search based on the Context ID and resubmit the right service from myWebMethods.

    Can someone tell me how the same is done in webMethods 7.1


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-General


  • 12.  RE: How to get the context Id?

    Posted Thu November 07, 2013 06:30 AM

    I have written a java service to get the Caller Service context id and i am able to get it when running the calling service directly.

    But ,when the same java service is mapped in the Event Manager for Exception Event handling it is not getting invoked for some reasons … Any idea?


    #webMethods-General
    #webMethods
    #Integration-Server-and-ESB