Re: JESS: Jess Java

2003-08-25 Thread ejfried
I think [EMAIL PROTECTED] wrote:
 I am working with Jess and Java code together, and have
 created a string in Java, with the highly original name string1
 which is defined as foo.
 
 How do I assert, working from Java, a fact in Jess based on the 
 value of the string?  If I was working in Jess, this particular case would
 be equivalent to:
 
 (assert (stringfact foo))


This is an ordered fact. Constructing and asserting them from Java is
covered in JIA on pages 313-314, and in the Jess 6.1 manual in section
4.7.3 .

 
 Thanks in advance.
 
 Ed Wysocki
 


-
Ernest Friedman-Hill  
Distributed Systems ResearchPhone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


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]




RE: JESS: Jess Java

2003-08-25 Thread Jagadeesan,Sivakumar
Hey All:

This is my first Post. I never had any experience with Rules Engine. The
project that I am currently working is using Home Grown Rules Engine. My
Friend Prasath ([EMAIL PROTECTED]) developed the Rules Engine single
handedly. His Rules Engine uses Excel for defining Rules. I was very much
interested in knowing about Rules Engine. After searching in Net , I found
about Jess. So I went to borders (Bookstore in US) and got JIA. It was great
book for beginners like me. It gave a very good introduction about Rules
Engine.I am  half way through the book. So be ready people, I am going to
storm this mailing list with questions. But importantly I will do my best to
help others in this mailing list.

Rgds,
--Siva Jagadeesan
http://java2simple.blog-city.com

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 24, 2003 7:52 PM
To: [EMAIL PROTECTED]
Subject: Re: JESS: Jess  Java


I think [EMAIL PROTECTED] wrote:
 I am working with Jess and Java code together, and have
 created a string in Java, with the highly original name string1
 which is defined as foo.
 
 How do I assert, working from Java, a fact in Jess based on the 
 value of the string?  If I was working in Jess, this particular case would
 be equivalent to:
 
 (assert (stringfact foo))


This is an ordered fact. Constructing and asserting them from Java is
covered in JIA on pages 313-314, and in the Jess 6.1 manual in section
4.7.3 .

 
 Thanks in advance.
 
 Ed Wysocki
 


-
Ernest Friedman-Hill  
Distributed Systems ResearchPhone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


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]



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]




RE: JESS: Jess Java

2003-08-25 Thread James Owen
I am going to storm this mailing list with questions.   Please don't.


RTFM (Read the Fabulous Manual) first.  Got through some old emails.
Hire a tutor.  Anything but a firestorm of newbie questions that have
been answered already.  Look here first for the answer
http://herzberg.ca.sandia.gov/jess/FAQ.shtml .  :-)

SDG
jco
 
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Jagadeesan,Sivakumar
Sent: Monday, August 25, 2003 11:21 AM
To: '[EMAIL PROTECTED]'
Subject: RE: JESS: Jess  Java


Hey All:

This is my first Post. I never had any experience with Rules Engine. The
project that I am currently working is using Home Grown Rules Engine. My
Friend Prasath ([EMAIL PROTECTED]) developed the Rules Engine single
handedly. His Rules Engine uses Excel for defining Rules. I was very
much interested in knowing about Rules Engine. After searching in Net ,
I found about Jess. So I went to borders (Bookstore in US) and got JIA.
It was great book for beginners like me. It gave a very good
introduction about Rules Engine.I am  half way through the book. So be
ready people, I am going to storm this mailing list with questions. But
importantly I will do my best to help others in this mailing list.

Rgds,
--Siva Jagadeesan
http://java2simple.blog-city.com

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 24, 2003 7:52 PM
To: [EMAIL PROTECTED]
Subject: Re: JESS: Jess  Java


I think [EMAIL PROTECTED] wrote:
 I am working with Jess and Java code together, and have created a 
 string in Java, with the highly original name string1 which is defined

 as foo.
 
 How do I assert, working from Java, a fact in Jess based on the
 value of the string?  If I was working in Jess, this particular case
would
 be equivalent to:
 
 (assert (stringfact foo))


This is an ordered fact. Constructing and asserting them from Java is
covered in JIA on pages 313-314, and in the Jess 6.1 manual in section
4.7.3 .

 
 Thanks in advance.
 
 Ed Wysocki
 


-
Ernest Friedman-Hill  
Distributed Systems ResearchPhone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


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]



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]



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]




RE: JESS: Jess Java

2003-08-25 Thread Jagadeesan,Sivakumar
I guess I scared James ...
Don't worry James , I have used mailing list and I will post only the
questions that I am not able to find answers for ...

-Original Message-
From: James Owen [mailto:[EMAIL PROTECTED]
Sent: Monday, August 25, 2003 2:52 PM
To: [EMAIL PROTECTED]
Subject: RE: JESS: Jess  Java


I am going to storm this mailing list with questions.   Please don't.


RTFM (Read the Fabulous Manual) first.  Got through some old emails.
Hire a tutor.  Anything but a firestorm of newbie questions that have
been answered already.  Look here first for the answer
http://herzberg.ca.sandia.gov/jess/FAQ.shtml .  :-)

SDG
jco
 
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Jagadeesan,Sivakumar
Sent: Monday, August 25, 2003 11:21 AM
To: '[EMAIL PROTECTED]'
Subject: RE: JESS: Jess  Java


Hey All:

This is my first Post. I never had any experience with Rules Engine. The
project that I am currently working is using Home Grown Rules Engine. My
Friend Prasath ([EMAIL PROTECTED]) developed the Rules Engine single
handedly. His Rules Engine uses Excel for defining Rules. I was very
much interested in knowing about Rules Engine. After searching in Net ,
I found about Jess. So I went to borders (Bookstore in US) and got JIA.
It was great book for beginners like me. It gave a very good
introduction about Rules Engine.I am  half way through the book. So be
ready people, I am going to storm this mailing list with questions. But
importantly I will do my best to help others in this mailing list.

Rgds,
--Siva Jagadeesan
http://java2simple.blog-city.com

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 24, 2003 7:52 PM
To: [EMAIL PROTECTED]
Subject: Re: JESS: Jess  Java


I think [EMAIL PROTECTED] wrote:
 I am working with Jess and Java code together, and have created a 
 string in Java, with the highly original name string1 which is defined

 as foo.
 
 How do I assert, working from Java, a fact in Jess based on the
 value of the string?  If I was working in Jess, this particular case
would
 be equivalent to:
 
 (assert (stringfact foo))


This is an ordered fact. Constructing and asserting them from Java is
covered in JIA on pages 313-314, and in the Jess 6.1 manual in section
4.7.3 .

 
 Thanks in advance.
 
 Ed Wysocki
 


-
Ernest Friedman-Hill  
Distributed Systems ResearchPhone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


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]



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]



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]



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]




Re: JESS: jess/java question

2001-09-18 Thread Thomas_Barnekow


Hi!

Is there a way
for me to in a jess function(deffunction) pass
something back into my calling java program? Once
I get a rule to fire, I need to be able to get the
information to change the XML back to my java code.
Or somehow be able to change the XML. I am
open to any ideas.

An XML document is a collection/hierarchy of objects (nodes) that are
usually accessible through the standardized DOM (Document Object Model)
API. You can pass object references to Jess (see documentation).

Your options then range from pure Jess script to (almost) pure Java:

1) Within your Jess script you can call a Java object's methods. Thus, you
can also modify your XML document from within a deffunction or directly on
the RHS.
2) You can write Jess Userfunctions (in Java) that perform the necessary
modifications. You'd use these Userfunctions in your script.
3) You can write a normal Java class that performs the modifications. You'd
call its method(s) the usual way.

Greetings, Thomas

+-+
| This message may contain confidential and/or privileged |
| information.  If you are not the addressee or authorized to |
| receive this for the addressee, you must not use, copy, |
| disclose or take any action based on this message or any|
| information herein.  If you have received this message in   |
| error, please advise the sender immediately by reply e-mail |
| and delete this message.  Thank you for your cooperation.   |
+-+


-
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]
-




RE: JESS: jess/java question

2001-09-18 Thread Alan Moore

Bob,

Instead of copying the XML document data into facts, you should definstance
the XML DOM nodes and have your rules pattern match directly on the
node/element/attributes, etc.

The jess (and java) syntax gets a little ugly when working directly with XML
DOM but it is workable. A better approach would be to use JDOM which cuts
down on the node/element/attribute traversals quite a bit...

However, if you don't want to change your current setup, you can simply
assert the XML DOM (or JDOM) nodes as an additional slot in the
facts/instances you are already creating. This slot would presumably be an
external address:

new Value(xmlNode, RU.EXTERNAL_ADDRESS);

and then you can access and manipulate the xml node just like any other java
object in jess:

(defrule augment-empty-accounts
   (account (id ?id) (balance ?balance:( ?balance 0)) (xml-node ?node))
=
   ;; manipulate ?node using jess code (e.g. add attribute nodes, etc.)
)

Good luck!

alan

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Bob Stewart
Sent: Tuesday, September 18, 2001 6:48 AM
To: [EMAIL PROTECTED]
Subject: JESS: jess/java question


Hi,

I am integrating jess into my EJB code. I am
trying to create an XML document enhancement
service. What I am doing is taking in the
XML document as a byte array, turning them into
jess facts, and running the rules against those
facts. Based on the defined rules, I will want
to change fields(change priority, add a comment)
to the XML document.
So far, I am reading in the XML document, and
the rules are firing okay. I am just not sure
how I can update the XML document. Is there a way
for me to in a jess function(deffunction) pass
something back into my calling java program? Once
I get a rule to fire, I need to be able to get the
information to change the XML back to my java code.
Or somehow be able to change the XML. I am
open to any ideas.


Thanks,
Bob Stewart

__
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

-
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]
-



-
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]
-