I just realized as well that you needed help a few weeks ago with this. My
code example is just an example though. I highly recommend getting the Jess
book off of Amazon and going through the tutorials (note the Jess In Action
book is not the same as the manual on the website, it will teach and give
the basics).  Learning the hows and whys of a rule based expert system will
make your job much more easier.

On Thu, Jan 7, 2010 at 7:12 PM, Socrates Frangis <soc.fran...@gmail.com>wrote:

> Not sure what you're trying to do, but Jess is embedded as any other Java
> object would be. Check the Jess website for the API.
> Just create a rete object, connect a CLP file to it, add facts, and run.
> Here's a not too great example, but it is an example of just embedding Jess
> in a method, which of course will be ran with the method is called. Does
> this help at all?
>
> Example Code:
>
> import jess.*;
>
> public class SomeJavaObject{
>      //whatever code exists in your object
>     //perhaps analyze members within the object with Jess, whatever...
>     private int x;
>     private double y;
>     private String s;
>
>     //Constructor
>     public SomeJavaObject{
>        x = 1;
>        y = 2.1231;
>        s = "Socrates";
>     }
>
>     public static void exampleMethod(){
>         try{
>             //Create the engine
>             Rete engine = new Rete();
>
>             //Assert Facts - add whatever objects you want in the Rete
> Engine for Jess to analyze
>             engine.add(x);
>             engine.add(y);
>             engine.add(s);
>
>             //Batch the CLP file
>             engine.batch("rules.clp");
>
>             //Run Rule Engine
>             engine.run();
>
>             //Either printout results from Jess to the console through
> (printout t ...)
>             //Or add Java Beans from that contain members which Jess might
> change when a rule is triggered (remember to add a property change listener)
>         }
>         catch (JessException e){e.printStackTrace();
>
>         }
>     }
> }
>
>
> On Thu, Jan 7, 2010 at 5:11 AM, Adeyi <olufemioyel...@gmail.com> wrote:
>
>>
>> I want to embed Jess into Java code. The Java code is to be called from an
>> eclipse-based IDE. Can I achieve my aim without the use of the main()
>> method
>> in Java? I need help please!!!
>> --
>> View this message in context:
>> http://old.nabble.com/Is-it-Possible-to-Embed-Jess-Into-Java-Without-the-main%28%29-method--tp27059744p27059744.html
>> Sent from the Jess mailing list archive at Nabble.com.
>>
>>
>>
>> --------------------------------------------------------------------
>> To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
>> in the BODY of a message to majord...@sandia.gov, NOT to the list
>> (use your own address!) List problems? Notify owner-jess-us...@sandia.gov
>> .
>> --------------------------------------------------------------------
>>
>>
>

Reply via email to