Hello,
My jess version : Jess71p2
I have some problem with a rule that triggers and call a java external
Object
My java class constructor ( MyMessage ) take as parameter another java
objet ( TicketPS) ..see below
When i use a String parameter in place of the My TicketPS class it
works nicely ... !! Any hint ?
Thanks
Philippe
----------------------------
1) My Rules.clp:
(import emb.jess.audiphone.model.*)
(import emb.jess.audiphone.*)
(deftemplate TicketPS (declare (from-class TicketPS)))
(deftemplate MyMessage (declare (from-class MyMessage)))
(defrule PS-R1
"Conclure sur Service VoIP OK"
?ticket1 <- (TicketPS { failure == "306-1" || failure == "306-2"
|| failure == "306-3" })
?ticket2 <- (TicketPS { failure == "308-1" || failure == "308-2"
|| failure == "308-3" })
=>
(add (new MyMessage ?ticket1 )))
------------------------------------------------------
2) runtime trace
[java] Demo
[java] Call engine
[java] Jess reported an error in routine new
[java] while executing (new MyMessage ?ticket1)
[java] while executing (add (new MyMessage ?ticket1))
[java] while executing defrule MAIN::PS-R1.
[java] Message: Constructor not found: (new MyMessage ?ticket1).
_________________________________
3) My java code :
import emb.jess.audiphone.model.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
public class MyMessage {
private TicketPS AaudiTicketPS ;
public MyMessage(TicketPS audiTicketPS ) {
System.out.println("TicketPS " + audiTicketPS);
AaudiTicketPS = audiTicketPS;
}
}