To add custom Java code to a Drools rule in Event Analytics in the Infor Grid:
- Write your Java code, compile it, and archive it to a JAR file:
// javac thibaud\HelloWorld.java // jar cvf HelloWorld.jar thibaud\HelloWorld.class package thibaud; public class HelloWorld { public static String hello(String CUNO) { return "Hello, " + CUNO; } }
- 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:
- Write the Drools Rule that makes use of your Java code, reload the rules, and test:
Thank you.
UPDATE: In the section “then”, we can use event.getElementValue(“CUNO”)
LikeLike
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!
LikeLike
Bonjour Maxime. Supposing your Event Analytics rule does
event.postEvent ("Maxime")
, then your MEC you should subscribe toEventAnalytics:Maxime
(not M3:MPLIND) — ThibaudLikeLike
Excellent it works ! Thank you.
LikeLiked by 1 person