Avoiding recursion filter on Publish Channel

The standard way to send a message from Maximo to an external system is by setting up a Publish Channel and enabling Event Listener. By default, Integration Framework doesn’t re-publish a change if it comes from another inbound interface to prevent recursion on a bi-directional interface. Although I don’t agree with this logic as one-way integration is much more common, but anyway, IBM said it is easy to override that by extending the Event Filter javaclass.

The problem is, with the rise of automation script, no one wants java customization anymore. Of course, for massive systems where performance is critical, it is still the best choice. But, for most medium-sized clients I work with, they’re all moving away from java customization.

Anyway, an approach we can deal with this is not to use Event Listener at all. Instead, we can trigger a publish from an Object Save launch point from automation script using the example python code below:

from psdi.iface.mic import PublishChannelCache
PublishChannelCache.getInstance().getPublishChannel("PUBLISH_CHANNEL_NAME>").publish(mbo, True)
 

 Happy coding!


5 comments:

  1. hi, if i want to use this should i create a JSON Resource?

    ReplyDelete
    Replies
    1. Hi Ace, this has nothing to do with JSON Resource. Standard publish would involve creating OS, Publish Channel, and enabling Event Listener. This is a workaround, we don't enable Event Listener but firing publish event using Automationscript instead

      Delete
  2. Hello, i know this is quite an old post but stumbled across it while trying to configure a script to be run from a CRON task to pick up and send WO's over a publish channel.

    I've tried your method above, using a few of the publish methods with no success. I've also tried the method detailed elsewhere using server.lookup("MIC").exportData but both methods return the same result. The message is not sent.

    I know it picks up one WO but it won't send. I can see in the logs it going through the process rules on the Publish Channel and satisfying every single one.

    My publish channel is on an External system with its listener disabled, channel enabled, ext sys enabled and an end point specified. Nothing.
    If i switch the listener on and touch the WO it sends it quite happily.

    I've tried my code in Nashorn and jython and both are the same. Tried this as seen weird things now and again.

    Any ideas?

    ReplyDelete