Rete.addDefrule (which is what the Jesp does internally) overwrites rules
with the same name.

You can parse the next .clp file tentatively before you really load it.

Use the Jesp parser API methods which parse a source file one by one. (See
the Jesp javadoc for an example.) If it parses a defrule, check whether the
name is already in the Rete.

If all goes well, you can load the entire .clp the way you do now.

(If duplicates may occur within the same file, you'll have to register the
rule names during each pass over a file.)

-W


On Mon, May 10, 2010 at 1:19 PM, Kumar, Amitesh <
[email protected]> wrote:

>  Hi,
>
> Currently im loading Jess rules like this
>
> Jesp jesp  = new Jesp(new InputStreamReader(clp.getInputStream()),rete);
> jesp.parse(false);
>
> As some the CLP files arn't on the class path
>
> Is there a way to either detect duplicate rules ? Or throw an exception of
> a duplicate is found.
>
> Cheers
> Kumaap0
>
>
>
> ******************************************************************************************
> More information on Standard Bank is available at www.standardbank.com
>
> Everything in this email and any attachments relating to the official
> business
> of Standard Bank Group Limited and any or all subsidiaries, ("the
> Company"), is
> proprietary to the Company. It is confidential, legally privileged and
> protected
> by relevant laws. The Company does not own and endorse any other content.
> Views and opinions are those of the sender unless clearly stated as being
> that of the Company.
>
> The person or persons addressed in this email are the sole authorised
> recipient. Please notify the sender immediately if it has unintentionally,
> or inadvertently reached you and do not read, disclose or use the content
> in any way and delete this e-mail from your system.
>
> The Company cannot ensure that the integrity of this email has been
> maintained nor that it is free of errors, virus, interception or
> interference.
> The sender therefore does not accept liability for any errors or omissions
> in the contents of this message which arise as a result of e-mail
> transmission.
> If verification is required please request a hard-copy version. This
> message
> is provided for informational purposes and should not be construed as a
> solicitation or offer to buy or sell any securities or related financial
> instruments.
>
> ******************************************************************************************
>
>
>
> This message has been scanned for viruses by BlackSpider 
> MailControl<http://www.blackspider.com/>
>

Reply via email to