Topic
  • 2 replies
  • Latest Post - ‏2015-11-19T18:09:03Z by Bowser
Schouten
Schouten
2 Posts

Pinned topic Invoke publish channel using automation script

‏2013-10-24T14:12:18Z |

Hi,

I'm trying to use a Jython automation script in Maximo 7.5  to invoke a predefined publish channel but i am struggling with the syntax.

MXServer server = MXServer.getMXServer();
UserInfo userInfo = this.getRunasUserInfo();
((MicServiceRemote)server.lookup("MIC")).exportData("PUBLISH CHANNEL", "MY_EXTSYS", whereClause, userInfo, 5000);

I found above Java syntax on this forum, but how can I use it in Jython?

Thanks in advance

Updated on 2013-10-24T14:12:45Z at 2013-10-24T14:12:45Z by Schouten
  • 12912912912129
    12912912912129
    1 Post

    Re: Invoke publish channel using automation script

    ‏2015-11-18T11:48:27Z  

    You can try somthing like that..

    from psdi.app.common import DateUtility
    from java.util import Date
    from psdi.mbo import SqlFormat
    from psdi.mbo import MboConstants

    from org.python.core.util import *
     
    from psdi.util.logging import MXLoggerFactory
    from psdi.util.logging import MXLogger
    from psdi.iface.mic  import MicUtil
    from psdi.server import MXServer
    from psdi.mbo import *
    from java.util import Date
    from java.text import SimpleDateFormat
    from psdi.app.system import SystemService

    LOGPREFIX = "AutomationScript CALL PUBLISH CHANNEL "
    mxServer = MXServer.getMXServer()
    systemService = SystemService(mxServer)
    from psdi.iface.mic import MicService
    from psdi.util import MXSession

    from psdi.iface.mic import EndPointCache
    from psdi.iface.router import Router
    from psdi.server import MXServer

     


    server = MXServer.getMXServer()
    systemService = SystemService(mxServer)
    micService = MicService(mxServer)
    micService.init()
    userInfo = micService.getNewUserInfo()
    whereClause = "ticketid ='"+mbo.getString("TICKETID")
    server.lookup("MIC").exportData("PUBLISH CHANNEL", "MXINCIDENT", whereClause, userInfo, 5000);

  • Bowser
    Bowser
    97 Posts

    Re: Invoke publish channel using automation script

    ‏2015-11-19T18:09:03Z  

    Assuming your script will be running from a Launch Point, the code you supplied could be translated as follows:

     

    
    from psdi.server import MXServer
    server = MXServer.getMXServer()
    userInfo = mbo.getUserInfo()
    whereClause = "1=1"
    server.lookup("MIC").exportData("PUBLISH CHANNEL", "MY_EXTSYS", whereClause, userInfo, 5000)