We don't ship the examples in the package jess/examples anymore; the
small number of examples gave users a distorted view of what's
important about Jess, and as a result most Jess code I saw would be
based on these really inappropriate trivial examples. The mention that
you found in the manual is an error that will now be removed.
In any case, I'll paste the file here so you can see it; it's also
still available in the Jess 6.1 distro. It's very simple. It just
shows Jess calling "store" and Java calling "fetch" -- nothing earth
shattering.
---------------------------------------------------------------------------------------------
import jess.*;
import java.awt.Point;
public class Main
{
public static void main(String[] argv)
{
try
{
// *************************************************************
// Create engine; load in some extra functions
Rete rete = new Rete();
// *************************************************************
// Send initial parameters to Jess
rete.store("A", new Value(1, RU.INTEGER));
rete.store("B", new Value(3.14159, RU.FLOAT));
rete.store("C", new Point(10,10));
// *************************************************************
// Define some rules. The first rule fetches the inputs and asserts
// them as facts; the second rule matches those facts and stores
// a result based on the inputs. Note that the rules could just
// as easily have come from a file, but I wanted to make this
// example self-contained.
rete.eval("(defrule startup" +
" =>" +
" (assert (input-1 (fetch A)))" +
" (assert (input-2 (fetch B)))" +
" (assert (input-3 (fetch C))))");
rete.eval("(defrule match-input" +
" (input-1 ?a&:(< ?a 2))" +
" (input-2 ?b)" +
" (input-3 ?c&:(external-addressp ?c))" +
" =>" +
" (store RESULT (+ ?a ?b)))");
// *************************************************************
// Run the rules
rete.reset();
rete.run();
// *************************************************************
// Fetch the result (4.14159) and print it out
System.out.println("The answer is: " + rete.fetch("RESULT"));
}
catch (JessException re)
{
re.printStackTrace();
}
}
}
---------------------------------------------------------------------------------------------
On 12/15/06, Thiele, Klaus <[EMAIL PROTECTED]> wrote:
Hello,
i'm now testing transferring values between Jess an java (Manual 8.2) but
i'm missing
the examples under Jess70/jess/examples/xfer/.
How to get them?
regards
- klaus
--
Klaus Thiele - Personal & Informatik AG
mailto:[EMAIL PROTECTED]
"Ein wichtiger Charakterzug groÃartiger Programmierer ist konstruktive
Faulheit..."
Eric S. Raymond
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------