You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Maximo发布通道无法识别自定义Event Filter Java类问题咨询

Maximo Publish Channel Event Filter Not Recognized + Code Fixes

Alright, let's tackle your issue from two key angles: first, why Maximo isn't recognizing your event filter class, and second, the critical bugs in your code that would break it even if it was loaded.

1. Troubleshooting Class Recognition in Maximo

Maximo can be picky about class deployment and configuration—here are the steps to verify:

  • Check Deployment Path: Your compiled .class file must match your package structure exactly. Drop it in:
    [MAXIMO_HOME]/applications/maximo/maximouiweb/webmodule/WEB-INF/classes/com/sof/iface/eventfilter/
    If using an EAR/WAR deployment, ensure the class is included in the archive and you’ve done a full redeploy (not just a hot swap).
  • Full Server Restart: Maximo’s classloader often doesn’t pick up new classes with partial restarts. Shut down the application server completely, wait 30 seconds, then start it back up.
  • Validate Publish Channel Setup:
    1. Navigate to Integration > Publish Channels and open your target channel.
    2. On the Event Filter tab, confirm the fully qualified class name is entered correctly: com.sof.iface.eventfilter.VSPPWOCOMPEventFilter
    3. Save the channel and restart the Maximo integration framework (or the entire server) to apply changes.
  • Check Logs for Errors: Look in [MAXIMO_HOME]/logs/maximo.log for ClassNotFoundException or initialization errors. Your logger targets maximo.application.EVENTFILTER, so check that specific log stream too.

2. Critical Bugs in Your Filter Logic

Even if Maximo loads your class, it won’t work as intended due to common Java mistakes:

  • String Comparison with ==: In Java, status == "COMP" checks object references, not string values. Use status.equals("COMP") instead (add null safety with Objects.equals(status, "COMP") if needed).
  • Broken Try/Catch Blocks: Your commented-out try and closing } will cause compilation failures—clean those up.
  • Null Risk: mbo.getString("STATUS") can return null if the attribute is empty, leading to a NullPointerException.

3. Fixed Version of Your Code

package com.sof.iface.eventfilter;

import java.rmi.RemoteException;
import psdi.iface.mic.MaximoEventFilter;
import psdi.iface.mic.PublishInfo;
import psdi.mbo.MboRemote;
import psdi.util.MXException;
import psdi.util.logging.MXLogger;
import psdi.util.logging.MXLoggerFactory;

public class VSPPWOCOMPEventFilter extends MaximoEventFilter {
    private static final String SILMX_ATTRIBUTE_STATUS = "STATUS";
    private static final String STATUS_COMP = "COMP";
    private final MXLogger log = MXLoggerFactory.getLogger("maximo.application.EVENTFILTER");

    /**
     * Constructor
     *
     * @param pubInfo Publish Channel Information
     * @throws MXException Maximo Exception
     */
    public VSPPWOCOMPEventFilter(PublishInfo pubInfo) throws MXException {
        super(pubInfo);
    } // end constructor.

    /**
     * Decide whether to filter out the event before it triggers the
     * Publish Channel or not.
     */
    @Override
    public boolean filterEvent(MboRemote mbo) throws MXException, RemoteException {
        log.debug("######## com.sof.iface.eventfilter.VSPPWOCOMPEventFilter::filterEvent() - Start of Method");
        boolean filter = false;

        try {
            String status = mbo.getString(SILMX_ATTRIBUTE_STATUS);
            log.debug("######## com.sof.iface.eventfilter.VSPPWOCOMPEventFilter::filterEvent() - WO Status " + status);

            // Check if STATUS was modified and equals "COMP" (with safe string comparison)
            if (mbo.isModified(SILMX_ATTRIBUTE_STATUS) && STATUS_COMP.equals(status)) {
                log.debug("######## com.sof.iface.eventfilter.VSPPWOCOMPEventFilter::filterEvent() - Skipping MBO");
                filter = true;
            } else {
                // Delegate to parent class filter logic
                filter = super.filterEvent(mbo);
            }
        } catch (MXException | RemoteException e) {
            log.error("Error executing VSPPWOCOMPEventFilter", e);
            // Re-throw to let Maximo handle the exception properly
            throw e;
        }

        log.debug("######## com.sof.iface.eventfilter.VSPPWOCOMPEventFilter::filterEvent() - End of Method");
        return filter;
    } // end filterEvent.
} // end class.

4. Final Steps to Test

  1. Recompile the class with the fixes above.
  2. Deploy the updated .class file to the correct directory.
  3. Do a full application server restart.
  4. Test by updating a Work Order’s status to COMP and check the logs to confirm the filter is executing and skipping the event as expected.

内容的提问来源于stack exchange,提问作者Kkunnuthara

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 08:45:13