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

Call a global var within a java service

  • 1.  Call a global var within a java service

    Posted Tue April 26, 2016 06:47 AM

    Hi,

    I need to access a global var from a java service I’ve created. Of course, I can use a workaround (assigning the global var to the pipeline var, or to the input parameters) but does exist any instruction to call this var within my java service please ?

    Regards


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 2.  RE: Call a global var within a java service

    Posted Tue April 26, 2016 01:49 PM


  • 3.  RE: Call a global var within a java service

    Posted Tue April 26, 2016 02:18 PM

    Below is code sample:

    
    import com.wm.app.b2b.server.globalvariables.GlobalVariablesManager;
    import com.wm.util.GlobalVariables.GlobalVariableValue;
    
    public void getGlobalVariableValue(String key)
    { 
    GlobalVariablesManager mgr = GlobalVariablesManager.getInstance();
    GlobalVariables.GlobalVariableValue gvv = mgr.getGlobalVariableValue(key);      
    System.out.println(gvv.getValue());
    System.out.println(Boolean.toString(gvv.isSecure()));
    }

    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 4.  RE: Call a global var within a java service

    Posted Tue April 26, 2016 02:41 PM

    Excellent, that’s great ! :slight_smile:
    Thanks Prasad.

    Regards


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services