Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  Call setClientHost() and setClientAddr() from UserInfo()

    Posted 04/25/24 05:37 AM

    Hi,

    Anybody knows how to call setClientHost() and setClientAddr() methods from UserInfo()? In automation script I am trying to get userInfo and then calling these set methods but it says "mbo.getUserInfo().setClientHost is not a function". Any pointers on how to call these setter methods from userInfo()?



    ------------------------------
    Suhas Joshi
    Pune
    ------------------------------


  • 2.  RE: Call setClientHost() and setClientAddr() from UserInfo()

    Posted 04/26/24 01:28 AM

    setClientHost() and setClientAddr() are not "public" methods from UserInfo class.

    You can use MXSession class for these methods.

    from psdi.util import MXSession
    session = MXSession.getSession()

    clientAddr = request.getHeader("X-Forwarded-For")

    session .setClientHost(clientAddr)

    session .setClientAddr(clientAddr)

    Regards,

    Srikanth Narala



    ------------------------------
    [Srikanth][Narala]
    [Maximo Specialist]
    [Melbourne]
    [Australia]
    ------------------------------



  • 3.  RE: Call setClientHost() and setClientAddr() from UserInfo()

    Posted 05/14/24 07:52 AM

    Thanks Srikanth for the inputs. This code can be written at OSCL class level or any integration class/script level as you are using "request" variable. What if I want to get this at object level? Object level we do not have "request".



    ------------------------------
    Suhas Joshi
    Pune
    ------------------------------