Showing posts with label publish channel. Show all posts
Showing posts with label publish channel. Show all posts

Sunday, 17 May 2020

Invoke/Call a Publish Channel Conditionally - Automation Script | Maximo


Normally trigger point for the Publish channels is Event Listener, which is save/update any record. 

Question: Can we send the data using publish channel with a custom trigger point /condition ??

Answer: Yes you can. by using Maximo Automation Script. 
Below is the simple tricks to call a publish channel 

server = MXServer.getMXServer()
userInfo = mbo.getUserInfo()
whereClause = <CONDITION>
server.lookup("MIC").exportData("<Publish Channel Name>", "<External System Name>", whereClause, userInfo, 1000)
---------------------------------
Another example:
micSrv = MXServer.getMXServer().lookup("MIC")
server.lookup("MIC").exportData("MXPO", "LegecyApp", " ponum='"+vPONum+"' and revisionnum="+vREVNUM , micSrv.getNewUserInfo() , 1)


Note:

Mic is old service name for MIF, but still the same name


Tuesday, 18 February 2020

Check Budget with Oracle ERP Through Publish channel and set flag 1 or 0 on PR and PO.

Check Budget with Oracle ERP Through Publish channel and set flag 1 or 0 on PR and PO.

Create End point for publish channel that needs to be used for Publish channel with ERP.

Publish Channel Endpoinnt = MEP

Define external system and publish channel for outbound transactions and Enterprise Service for inboaund transactions

Publish channel  = BDGT_CHECKINTERFACE
Enterprise Service = BDGTCHK_POINTERFACE

once everything is done for integeration side
Send request to ERP through automataion below.


create script with action launch point.
object = 'PO' , object = 'PR' in launch points.


import sys
from psdi.util.logging import MXLoggerFactory
from psdi.mbo import MboConstants
from psdi.util.logging import MXLogger
from psdi.iface.mic import MicService
from psdi.server import MXServer
from psdi.mbo import *
from psdi.webclient.system.session import WebClientSession
from time import sleep
from psdi.security import UserInfo
from psdi.server import MXServer