Java code in Event Analytics rules

To add custom Java code to a Drools rule in Event Analytics in the Infor Grid:

  1. Write your Java code, compile it, and archive it to a JAR file:
    // javac thibaud\
    // jar cvf HelloWorld.jar thibaud\HelloWorld.class
    package thibaud;
    public class HelloWorld {
        public static String hello(String CUNO) {
            return "Hello, " + CUNO;

  2. Find the host of Event Analytics as explained here, copy/paste the JAR file to the application’s lib folder in the Infor Grid, and restart the application to load the JAR file:

  3. Write the Drools Rule that makes use of your Java code, reload the rules, and test:

Thank you.

Published by


ex- M3 Technical Consultant

5 thoughts on “Java code in Event Analytics rules”

  1. Hello Thibaud. Interesting post. Trying to figure out how it works but i am confused. I set up a rule (MPLIND, create record during PPS300) in analytics to post an event if PUOS=50 only.
    If i put a system.out.println(event.getElementValue(“PUOS”)) in the rule, i see the debug line only for PO receipt in MPLIND status 50.

    Then i set up MEC as a suscriber in the partner admin (M3:MPLIND:C::P2).

    As a result, MEC receives 100% of events, regardless the status of the line added in MPLIND. If i do a receipt for a PO with direct put-away (status 75 immediately), an xml file is sent to MEC.

    Where am i wrong ? How can we setup MEC to receive only events filtered by analytics ?

    Thank you!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s