« Return to Thread: JESS: Problem on handling the function 'batch'

Re: JESS: Problem on handling the function 'batch'

by David Coyle-3 :: Rate this Message:

Reply to Author | View in Thread

Francisco:

Instead of using batch(), you can use eval() with the contents of a
file as a String.

I have found that by loading the file myself using resource loading
mechanisms that are native to my app server environment, and caching
it in the application, then providing a String to eval() sped up
performance by about an order of magnitude over a batch() with the
same content.

Of course, your mileage may vary.

-d-

On Mar 30, 2008, at 2:53 PM, francisco santiago wrote:

> Hello. This is my first time using Jess. I have a full project in
> which I'm making some changes. This project works via ANT
> (build.xml file fully functional).
>
> The project is working at 100%, but we want to run it without ANT.
> ANT manages the classpath to add some paths to critical locations
> into the app.
>
> I'm having a problem when invoking the function 'batch' in Jess
> when I give it an argument like 'fileName.clp'.
>
> Jess reports an error saying it cannot open the file. The file is
> under a subdirectory into the app base directory. If I put the file
> into this root directory, all works well.
>
> But it's necessary to have those clp's placed in a subfolder.
>
> I've tried using System.getProperties().setProperty
> ("java.class.path",'clp's-directory-path'), but only Java code find
> it useful by using Class.getResourceAsStream() to get acces to the
> resources (as 'fileName.clp' is). But Jess still gives the same
> error, like it doesn't see the changes done to the classpath via
> Java code in execution time.
>
> 'java.class.path' property contains paths to the ./ and ./build
> locations initially. I've noted that placing directly the clp's
> into those places makes Jess find them. Any other location doesn't
> work. Appending to that classpath variable the path to my dir of
> clp's is the solution I've tried, as explained in the paragraph above.
>
> Thank you so much for yout attention and sorry for the length of
> the e-mail. I think that details were necesary.



--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------

 « Return to Thread: JESS: Problem on handling the function 'batch'