Thank you very much Steve its working fine.

 

I need one clarification in drl file.  Here I am checking the two values, the first value is from Numbers calss “one” and another is 2 which is constant

 

Is there any constraint the right side condition will take only constant value like numeric or final filed in the class etc.

 

 

rule "check less"

      no-loop true

      when

            n :  Numbers( one < 2)

      then

            System.out.println( "One Less then Two" );

            n.setResult(n.getOne()+n.getTwo());

            System.out.println(n.getResult());

end

 

The situation like as follows I need to check two fields in the class.  Sample rule is given below

 

rule "check less"

      no-loop true

      when

            n :  Numbers( one < two)

      then

            System.out.println( "One Less then Two" );

            n.setResult(n.getOne()+n.getTwo());

            System.out.println(n.getResult());

end

 

Here one and two are the two fields in the class Numbers so here I am comparing two fields so I got like this error

 

org.drools.rule.InvalidRulePackage: Unable to return Declaration for identifier 'two'

 

      at org.drools.rule.Package.checkValidity(Unknown Source)

      at org.drools.common.AbstractRuleBase.addPackage(Unknown Source)

      at com.sample.AddDroolsTest.readRule(AddDroolsTest.java:66)

      at com.sample.AddDroolsTest.main(AddDroolsTest.java:22)

 

 

How to resolve it?

 

Thanks & Regards

Shilpa

 

-----Original Message-----
From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Steven Williams
Sent:
Monday, January 29, 2007 10:20 AM
To: Rules Users List
Subject: Re: [rules-users] java.lang.NoSuchMethodError

 

Sorry Shilpa - I was looking at 3.0.5. What I said still holds true though - make sure the v642 jar is at the top of your runtime classpath.

On 1/29/07, shilpa.raghavendra@wipro.com <shilpa.raghavendra@wipro.com> wrote:

 

  I am using org.drools.ide_3.0.4 as eclipse plug-in it's having org.eclipse.jdt.core_3.2.0.v_642.jar

 

Still I have to use higher version

 

Regards

Shilpa

 

 

-----Original Message-----
From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Steven Williams
Sent: Monday, January 29, 2007 9:15 AM

To: Rules Users List
Subject: Re: [rules-users] java.lang.NoSuchMethodError

 

Hi Shilpa,

It looks like you do not have org.eclipse.jdt.core_3.2.0.v_671.jar in your classpath. You should find it in the eclipse/plugins directory - just add it to your application's classpath.

cheers
Steve

On 1/29/07, shilpa.raghavendra@wipro.com <shilpa.raghavendra@wipro.com > wrote:

 

I am new to Drools. I wanted to put the rules in the project so I am learning this.

 

So I have taken code sample from Maven Repository bur I am getting following error.

 

To run the Example I Have used eclipse as IDE and the drl file in XML format.

 

 

java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;

      at org.apache.commons.jci.compilers.EclipseJavaCompiler$2.acceptResult(EclipseJavaCompiler.java:237 )

      at org.eclipse.jdt.internal.compiler.Compiler.compile( Compiler.java:454 )

      at org.apache.commons.jci.compilers.EclipseJavaCompiler.compile( EclipseJavaCompiler.java:268 )

      at org.drools.compiler.PackageBuilder.compileAll(Unknown Source)

      at org.drools.compiler.PackageBuilder.addPackage(Unknown Source)

      at org.drools.compiler.PackageBuilder.addPackageFromDrl(Unknown Source)

      at org.drools.examples.HonestPoliticianExample.main( HonestPoliticianExample.java:20 )

java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;

      at org.apache.commons.jci.compilers.EclipseJavaCompiler$2.acceptResult(EclipseJavaCompiler.java:237 )

      at org.eclipse.jdt.internal.compiler.Compiler.compile( Compiler.java:454 )

      at org.apache.commons.jci.compilers.EclipseJavaCompiler.compile( EclipseJavaCompiler.java:268 )

      at org.drools.compiler.PackageBuilder.compileAll(Unknown Source)

      at org.drools.compiler.PackageBuilder.addPackage(Unknown Source)

      at org.drools.compiler.PackageBuilder.addPackageFromDrl(Unknown Source)

      at org.drools.examples.HonestPoliticianExample.main( HonestPoliticianExample.java:20 )

Exception in thread "main"

 

Please help me fix this.

 

Thanks in advance

 

Thanks & Regards

Shilpa


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com


_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenw@objectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com


_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenw@objectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com