Prev Next
Topic Replies (2)
  1. 1
    idnkx user


    Hi Experts,

    May I know on what basis does the context id will be generated, will it be generated by IS, BROKER, MWS ?
    And what is the relation ship between context id, parent context id, root context id.

    Also will there be any of these 3 common (context id, parent context id, root context id) between source parent service and target parent service.


    idnkx user

    Raj Kumar

    I don't have any knowledge about Context ID, so I did a quick research and found the below information:

    [b]Context ID:[/b]

    Context IDs are Text IDs that enable you to retrieve errors associated with a process instance.
    Context ID’s are required for accessing most of the services in Monitor API's. Unfortunately there are no public flow services provided by webMethods to know the current context ID's. However, webMethods Java library provide some API's to extract the context ID. Following is the code for extracting the context ID. But, remember that Java flow service coded here will have a unique context ID and the caller service will have another one. So, caller services should take the parent ID as its context ID.

    public static final void getContextIDs(IData pipeline) throws ServiceException {

    String[] contextStack;
    String currentContextID = "";
    String currentParentID = "";
    String currentRootID = "";
    contextStack = InvokeState.getCurrentState().getAuditRuntime().getContextStack();
    if(contextStack.length >=3){
    currentRootID = contextStack[0];
    currentParentID = contextStack[1];
    currentContextID = contextStack[2];
    }else if (contextStack.length>=2){
    currentRootID = contextStack[0];
    currentParentID = contextStack[1];
    currentContextID = currentParentID;
    }else if (contextStack.length>=1){
    currentRootID = contextStack[0];
    currentParentID = currentRootID;
    currentContextID = currentRootID;
    }catch(Exception ex){
    ServiceException sx = new ServiceException(ex);
    throw sx;
    // pipeline
    IDataCursor pipelineCursor_1 = pipeline.getCursor();
    IDataUtil.put(pipelineCursor_1, "currentContextID", currentParentID); // Assuming that caller is looking for its context ID. currentContextID extracted is the context ID for the java service, not the caller service.

    Since we are accessing API's to get Context ID's, i feel these will be generated by IS.

    [b]Parent Context ID:[/b]

    The parent context ID is an internal identifier that the Integration Server uses

    [b]Root Context ID:[/b]

    Context ID of the root process instance that called this process instance

Leave a Reply
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.

Let`s Connect