• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to assert a fact from java into a specifical jess module.

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am working on a project which uses embedding jess in java. The system first load a .clp file which has all modules & rules definitions in. Later in java I assert all facts into Jess. The problem is that I don't know how to assert fact objects into a specifical module. I use eng.assertFact(fact) but it goes into MAIN module all the time. Does anyone knows how to do it?

Thanks in advance.
Hope
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't assert facts into a module; the fact itself is created from a template, and that template belongs to some module. When you create the jess.Fact object, just make sure you're using the right template; including the module name in the template name is the easiest way to do that -- i.e.,

Fact myFact = new Fact("MYMODULE::factname", engine);
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic