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

Global variable - assign value from a flow service

  • 1.  Global variable - assign value from a flow service

    Posted Sat March 14, 2015 02:17 PM

    Is it possible to change the value of a previously defined global variable from a flow service? I have tried a number of different ways to change the value of the global variable, but not sure if global variables are meant to be changed from a flow service (as opposed to being changed from the IS admin screen).

    Thanks


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


  • 2.  RE: Global variable - assign value from a flow service

    Posted Mon March 16, 2015 03:01 AM

    Yes … you may use WmRoot service(s) … check the dsp code where you can add/update GV. it will have an %invoke tag… use that servcie


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


  • 3.  RE: Global variable - assign value from a flow service

    Posted Thu March 19, 2015 05:52 PM

    I would check the java API to Add/update the global variables.

    com.wm.util.GlobalVariables.getInstance().put()


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


  • 4.  RE: Global variable - assign value from a flow service

    Posted Fri March 20, 2015 03:28 AM

    Please check if these services help you for your need.

    wm.server.globalvariables:addGlobalVariable
    wm.server.globalvariables:editGlobalVariable
    wm.server.globalvariables:removeGlobalVariable
    wm.server.globalvariables:listGlobalVariables
    wm.server.globalvariables:getGlobalVariableValue

    Hope this helps.

    -Kishore


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


  • 5.  RE: Global variable - assign value from a flow service

    Posted Fri March 20, 2015 12:22 PM

    I’m a bit curious as to what the use case is. Could you please elaborate?

    In my experience with Global Variables, they are typically used for configuration items, and that being the case, you wouldn’t to change from the application itself.

    If there’s a need to have a variable that can be used/modified across different services, then perhaps using the caching services would be a better option, or even creating your on Java static variables with getter/setter services.

    Percio


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


  • 6.  RE: Global variable - assign value from a flow service

    Posted Fri March 20, 2015 03:55 PM

    Percio ,
    Is getter/setter are the static variables/properties of the class? Can we use it within the java service directly, how?

    I agree with you that Constants should be used to set the config properties. Instead I also would prefer using the Caching services.


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


  • 7.  RE: Global variable - assign value from a flow service

    Posted Tue July 14, 2020 03:58 AM

    I have a similar problem as well. The global variable is a secret value.
    It’s an OAuth access token that expires after 60 minutes and the OAuth refresh token that can be used to issue a new one.
    Both these need to be stored as Global variables(and preferable as a secured secrets). The OAuth access token will be updated fairly frequently.

    As an alternative has anyone had experinance fetching values from the AWS key store for use in webMethods. With AWS we could manage the OAuth token refresh and updating and just have webMethods fetch a value when it needs it. It would be nice if this value could be cached for say 30 minutes yet globally available in webMethods.


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


  • 8.  RE: Global variable - assign value from a flow service

    Posted Tue July 14, 2020 12:53 PM

    Hi Alan,

    might it be possible to cache the services which are generating and returning these tokens via service properties and set the cache expiration time out accordingly?

    In this scenario the tokens will only be cached while they are valid and removed from the cache when they have expired.

    Regards,
    Holger


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


  • 9.  RE: Global variable - assign value from a flow service

    Posted Wed July 15, 2020 10:29 PM

    Alan,
    It may not be a good idea to store an access token in Global variable as it expires. With an expiry time, most of the identity servers will issue the same token back when other clients (Integration servers) requests for the token with same client id, secret, scope - you could cache it in individual IS server in its local cache.

    -Senthil


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


  • 10.  RE: Global variable - assign value from a flow service

    Posted Wed July 22, 2020 01:15 AM

    One alternative way is to call the get token service always , do not use refresh token , then no need to save(or cache) the refresh token .

    Otherwise if you want to save the token , you can service cache with timeout set as expire value of the token .


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