)
Im writing my Master Thesis and I´ve to use the JESS Platform for it. I want to ask a question.
For example I have this Java Class which is named as "Main":
public class Main {
private String user = "Joe";
public String getUser(){ return user; }
public String setUser(String user){ this.user = user;}
public static void main( String[] args ) throws Exception {
Main main = new Main();
Rete rete = new Rete();
rete.store( "main", main );
rete.batch( "two.clp" );
}
}
Now I want to call the clp-file and manipulate the Main-Class-Object and do this:
(printout t "main.user = " ((fetch main) getUser) crlf) ;; I got for this Joe
((fetch main) setUser "Robin")
(printout t "main.user = " ((fetch main) getUser) crlf) ;; For this I got Robin
But now I want to ask you how can I call this manipulated user named "Robin" from a Java code? If I call in Java like this:
public static void main( String[] args ) throws Exception {
Main main = new Main();
Rete rete = new Rete();
rete.store( "main", main );
rete.batch( "two.clp" );
System.out.println(main.getUser());
}
I got as result "Joe" and not "Robin". Can u please tell me how I can get (or call) the manipulated version of the Javaobject? And why it is not manipulated im my Java class when I manipulate the username from Jess to Robin?
I will be thankful for a message. Thanks.
I add the class and the clp.file which I used:
java class:
clp.file:
output:
The first output and the last output are the system.out.println calls from the java class. the second and the third output are the printout calls from the clp.file. Anyone understand why the last call is not the manipulated one? Sorry im really new to this issue. I will be very thankful for help.