Re: JESS: JESS and J#
Violates the whole point... (kidding). On Dec 20, 2006, at 12:47 PM, Dan Heinze wrote: Has anyone tried compiling the JESS source in MS J#, or had any experience in using JESS in conjunction with MS managed code? Thanks / Dan Daniel Heinze, PhD Chief Technology Officer A-Life Medical, Inc. 6055 Lusk Boulevard, Suite 200, San Diego, CA 92121 Office: 888.224.6300 ext 3006 Fax: 858.812.0952 Email: [EMAIL PROTECTED] Web: www.alifemedical.com Streamlining the Code to Collection Process with Computerized Practice Management and Medical Coding Products and Services. This message is for the sole use of the intended recipient and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you have received this e-mail in error, please destroy it, its attachments and all copies.
Re: JESS: Mixing facts from Java and Jess script
But I think he closes this on the third line. On Dec 18, 2006, at 9:11 PM, Ernest Friedman-Hill wrote: On Dec 18, 2006, at 10:13 PM, Mike Stacey wrote: (defrule TA::Initiates (mon (reading ?r:(= ?r 143)) (tstamp ?t:( ?t 0)) (posLshift (truth_val false))) = (assert posLshift(truth_val 1)) (printout t Initiates: Data ?r bpm, timestamp ?t, Fluent truth count:crlf)) Error is: Jess reported an error in routine Jesp.parsePattern while executing (batch rules/ec-1.clp). Message: No such slot posLshift in template MAIN::mon at token 'posLshift'. There's a missing close-parenthesis on the first line (three open, only two close) so Jess thinks you mean to test the contents of the tstamp and posLshift slots in a mon fact. The JessDE is pretty good at helping you spot this sort of problem. Besides formatting your code so that your errors are more obvious, this kind of error will lead to a train wreck with all sorts of error markers from this point on in the file, giving you a strong hint that something is wrong. If you can't use the JessDE, use the Lisp mode in any programmer's editor -- it will know how to format Jess code to point out this error. - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National LabsFAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com 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 owner-jess- [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: User Function Question Continued
-Object:edu.utah.cdmcc.entities.GlucoseDecision)) Finally, I show the code below that calls Jess: private void fireRulesEngine() { emptyTrace.setText(); SWTTextWriter invisibleTraceWriter = new SWTTextWriter(emptyTrace); Rete r = GlucosePlugin.getDefault().getRete(); r.addOutputRouter(traceOut, invisibleTraceWriter); try { r.reset(); r.setWatchRouter(traceOut); } catch (JessException e1) { displayExceptionInformation(e1); } try { r.add(decision); r.watchAll(); r.run(); r.updateObject(decision); r.undefinstance(decision); System.out.println(decision.getAdviceText()); } catch (JessException e) { displayExceptionInformation(e); } // If no advice resulted from running the inference engine if (decision.getAdviceText().length() == 0) { decision.setAdviceText(No change at this time.); } // Get the rule trace text and stick it into the decision object decision.setRulesFiredText(emptyTrace.getText().toString()); // Fire property change so listeners can act GlucosePlugin.getDefault().fireDecisionChanged(decision); } Thank you for your help with this. - Mike J. Michael Dean, M.D., M.B.A. H.A. and Edna Benning Presidential Professor of Pediatrics Professor of Family and Preventive Medicine Professor of Biomedical Informatics Chief, Division of Pediatric Critical Care Vice Chairman, Department of Pediatrics University of Utah School of Medicine 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 owner-jess- [EMAIL PROTECTED] - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National LabsFAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com 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 owner-jess- [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: User Function Question Continued
So I simply fire a property change from setAdviceText? Do I need to register Jess in some fashion as a listener? Thanks. On Dec 9, 2006, at 1:39 PM, Ernest Friedman-Hill wrote: On Dec 9, 2006, at 2:53 PM, J Michael Dean wrote: The GlucoseDecision.setAdviceText() is a trivial setter. OK, that's all we need to know. The GlucoseDecision class supports PropertyChangeListeners, and Jess takes that as a promise that whenever setX() is called, an X has changed event will come back. Until that event has come, Jess's working memory image of that object is unchanged. Since your setter breaks the contract and doesn't send the event, Jess loses track of the values of your object's slots. So here's the scenario. Imagine that the adviceText slot contains something, we'll call it ?X. You call the equivalent of (modify ?decision (str-cat ?X more advice)) Jess then calls setAdviceText(?X + more advice), and then that's what the object contains. But working memory isn't updated until the change event comes back -- and in this case, it never does. Now working memory and the object are out of sync, and this is bad. Then the next rule fires and it calls (modify ?decision (str-cat ?X even more advice)) and so Jess calls setAdviceText(?X + even more advice). The value of ?X is the same since working memory was never updated. The text more advice is completely lost! That's what's happening here. So there are two different ways to fix this. First, you can explicitly tell Jess to ignore your PropertyChange mechanism, since it's broken. To do this, you could say '(definstance GlucoseDecision ?decision static)' instead of '(add ?decision)'. For static definstances -- those that don't have PropertyChangeListeners -- the 'modify' function changes both working memory and the Java object. The other way would be to fix setAdviceText so that it sends an appropriate event after setting the property value. - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National LabsFAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com 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 owner-jess- [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: WG: JessDE: problems with classpath resolution
Make sure your own code is registered for buddy cooperation with Jess, in your MANIFEST.MF file. Something like Eclipse-RegisterBuddy: jess.core On Dec 1, 2006, at 3:36 AM, Bergner, Olaf (Saxonia) wrote: With Jess 7.0 out the doors, we are starting to use its set of Eclipse plugins. However, the Jess editor complains about not being able to resolve _any_ imported java class. I suspect that this is related to http://www.mail-archive.com/jess-users@sandia.gov/msg08255.html which, unfortunately, was left unanswered. So I would like to repeat the question: is there a workaround for the case when a project's name is not identical to the name of the project folder? Cheers, Olaf -- -- Olaf Bergner Saxonia Systems AG @ Otto office: +49(0)40 6461-5942 mobil:+49(0)170 16 90 143 e-mail: [EMAIL PROTECTED] web: http://www.saxsys.de Die Saxonia Systems AG ist zertifiziert nach DIN EN ISO 9001:2000 -- --
Re: JESS: Dealing WIth User Input
Buy Jess in Action. That book describes this type of application in detail. On Nov 8, 2006, at 7:37 AM, Hysteria86 wrote: Hi I'm looking to write a JESS program that asks the user a series of questions, takes the answers, and if the answer satisfies a certain criteria, moves on to another. Something like: Question - How old are you?: User answer - 25 The program then takes the user's answer and if it is below 30, moves on to another question. If it is above 30, prints out a message. I'm pretty new to JESS and any ideas on this would be greatly appreciated, thanks. -- View this message in context: http://www.nabble.com/Dealing-WIth- User-Input-tf2595635.html#a7239596 Sent from the Jess mailing list archive at Nabble.com. 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 owner-jess- [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]
JESS: Using Jess in Eclipse RCP
It was stated earlier that if you include gov.sandia.jess as a plugin dependency in your projects, this provides jess.jar, etc. successfully. This is true. However, if you are writing an RCP, it may be preferable to wrap the jess jars in another plugin. Otherwise, you are required to add in all the PDE pieces, which then want many of the eclipse core pieces, etc., blowing up the size of your RCP and adding all the undesired menu items that might come along with those pieces that relate primarily to the Eclipse workbench. 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: Announcing Jess 7.0RC3
I substituted old version (beta 7) of Jess and the behavior I observed is still present, so my problem relates to updating Eclipse, NOT to the Jess. Sorry for the distraction. - Mike On Oct 20, 2006, at 8:13 PM, Ernest Friedman-Hill wrote: On Oct 20, 2006, at 8:17 PM, J Michael Dean wrote: Caused by: java.io.FileNotFoundException: rules/Glucose.clp (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(FileInputStream.java:106) at java.io.FileInputStream.init(FileInputStream.java:66) at java.io.FileReader.init(FileReader.java:41) at jess.Batch.findDocument(Batch.java:121) ... 22 more Jess will, as always, first look relative to the current directory, and then along the runtime CLASSPATH. Eclipse is quite tricky about how it manages the CLASSPATH when it launches Java applications; things do change from version to version. But the important thing to note here is that you're launching a Java application, not a Jess application, so Jess's Eclipse-related code doesn't come into play at all -- it's all about the runtime CLASSPATH, which in turn is going to be related to how you set up your Java project to be run. Make sure the rules directory is being exported when you build the project. You might add some extra debug code to print the CLASSPATH and print the current working directory (and possibly its contents) and you'll probably simply find that the rules directory is simply not available at runtime. - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National LabsFAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com 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 owner-jess- [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]
JESS: Adapting Eclipse
Wrestled for number of hours with issue I solved months ago and forgot, and thought this might be useful for others. If you are using Jess in an Eclipse application, recall the buddy registration system solves classpaths, etc. Thus, the plugin manifest now has a registration statement in it. However, be certain that your own application manifest has the specific plugin listed as one to whom it will publish. I made a ridiculous error. In past version I created a jess.core plugin that wrapped the older version, and in my application, I indicated that jess.core should be a buddy. But this time, I added gov.sandia.jess as a dependency instead; when this failed, I created a plugin called jess7.core, to distinguish from the older one. But I forgot to fix the manifest.mf file of my actual application, which still referred to jess.core. Fixing this completely eliminated the path errors I mentioned earlier. 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: Announcing Jess 7.0RC3
Here is the situation. When the app starts up, it tries to load a file; this worked with the old Jess version AND the old Eclipse (3.2.0). I have upgraded two things simultaneously so this may be an eclipse problem. But the code gets to the place where the file is supposed to load:]Jess exception on startup.Jess reported an error in routine batch. Message: Cannot open file.The error occurred at line -1The line looks like this: nullMessage: Cannot open fileJess reported an error in routine batch. Message: Cannot open file. at jess.Batch.findDocument(Batch.java:131) at jess.Batch.batch(Batch.java:77) at jess.Batch.batch(Batch.java:53) at jess.Batch.batch(Batch.java:36) at jess.Rete.batch(Rete.java:2242) at edu.utah.cdmcc.decisionsupport.glucose.ApplicationWorkbenchAdvisor.postStartup(ApplicationWorkbenchAdvisor.java:45) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1854) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at edu.utah.cdmcc.decisionsupport.glucose.Application.run(Application.java:30) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)Caused by: java.io.FileNotFoundException: rules/Glucose.clp (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(FileInputStream.java:106) at java.io.FileInputStream.init(FileInputStream.java:66) at java.io.FileReader.init(FileReader.java:41) at jess.Batch.findDocument(Batch.java:121) ... 22 more
Re: JESS: Announcing Jess 7.0RC3
I am NOT certain this relates to the Jess distribution but am having significant problems in Eclipse 3.2.1 as the application is no longer finding paths and files. Have you heard of other problems with Eclipse 3.2.1 with current release? On Oct 13, 2006, at 8:21 AM, Ernest Friedman-Hill wrote: The latest version of Jess, the Programmer's Rule Engine for the Java Platform, is available for download at the usual location: http://www.jessrules.com/jess/download.shtml Jess 7.0RC3 is the third and almost certainly final release candidate for Jess 7, code-named Charlemagne. The only changes between 7.0RC2 and 7.0RC3 are that the JessDE now works on Eclipse 3.1, and an overloaded version of addMultislot() was returned to the Deftemplate class. As always comments and questions are welcome at [EMAIL PROTECTED] or to the mailing list at jess-users@sandia.gov . - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National LabsFAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com 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 owner-jess- [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: Fact definition from Java
I think I have resolved my internal confusion. I am thinking about Jess rules as being type-safe, which is nonsense. So if I have a rule file that refers to some kind of fact that does not exist, there will be no error - the rules that depend on that fact simply will not fire. So if I instantiate the relevant fact from within Java, then the rules will fire. So my question about how does the rule file know about a shadow fact is meaningless - the rule file doesn't care. Am I understanding this correctly? On Jul 17, 2006, at 7:26 AM, friedman_hill ernest j wrote: I think mdean77 wrote: Ridiculous question. I have a Bean in Java. I want to have Jess build itself a template for a shadow fact. But Jess does not know about the Bean. How does one tell Jess about the classes that have been created in Java? Right now, I manually create a fact in Jess and move the values from Java, but this is not ideal. In Jess 7, you can use Rete.add(), which automatically creates the template if needed and adds the object to working memory. In Jess 6 -- or if you want to choose your own template name rather than using the class name -- you can use the Rete.defclass() and Rete.definstance() methods. The manual section concerning templates, facts, and Java objects in working memory has been completely rewritten for the next release -- I hope it will make this stuff easier to learn and use. - Ernest Friedman-Hill Advanced Software Research Phone: (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 owner-jess- [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: Fact definition from Java
Sorry. I was reading the manual Section 8.2 (Definstance facts), where you postulate a Java Bean called ExampleBean. That's sitting in Java. The next paragraph shows, from an interactive session with Jess, the command (defclass simple ExampleBean). How does Jess know about ExampleBean in the first place? Where does it get imported, or how does Jess access the Bean, etc. That is my confusion here. There is an import commant (Section 16.87), but I don't expect to be able to import a java package into Jess unless it is in a specific location so Jess can find it, etc. - Mike On Jul 17, 2006, at 7:26 AM, friedman_hill ernest j wrote: I think mdean77 wrote: Ridiculous question. I have a Bean in Java. I want to have Jess build itself a template for a shadow fact. But Jess does not know about the Bean. How does one tell Jess about the classes that have been created in Java? Right now, I manually create a fact in Jess and move the values from Java, but this is not ideal. In Jess 7, you can use Rete.add(), which automatically creates the template if needed and adds the object to working memory. In Jess 6 -- or if you want to choose your own template name rather than using the class name -- you can use the Rete.defclass() and Rete.definstance() methods. The manual section concerning templates, facts, and Java objects in working memory has been completely rewritten for the next release -- I hope it will make this stuff easier to learn and use. - Ernest Friedman-Hill Advanced Software Research Phone: (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 owner-jess- [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: Eclipse 3.1.2
I took the earlier advice of downloading a fresh 3.1.2 version and installed the plugins, and everything is fine. I didn't think of the -clean option which probably would have accomplished the goal. My old Eclipse had a lot of junk in it, playing with aspectJ, etc., so not certain it was stable. Thanks. On Mar 1, 2006, at 9:38 AM, [EMAIL PROTECTED] wrote: I think mdean77 wrote: Just updated from 3.1.1 to 3.1.2 and voila, the Jess plugins cease to load. No crash, just silence, but of course, cannot run apps that use Jess. Anyone else have this issue? I just tried the upgrade myself, and it worked OK, so I don't think there's a fundamental problem. The two things I would try would be first: start eclipse with the -clean command-line switch. If that doesn't work, then just re-install the Jess plugins. If that *still* doesn't work, then you could check out the startup error log and see if it says anything about the Jess plugins. - Ernest Friedman-Hill Advanced Software Research Phone: (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 owner-jess- [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]