[rules-users] Stumped by error in rule

Swindells, Thomas TSwindells at nds.com
Tue Feb 9 06:51:40 EST 2010


Have you tried:
Applicant ( $ApplicantNumber : applicantNumber )

Eg your field should start with a lower case letter?

Thomas

From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Tom.E.Murphy at wellsfargo.com
Sent: 09 February 2010 11:44
To: rules-users at lists.jboss.org
Subject: [rules-users] Stumped by error in rule

After all this time working with Drools 5.0.1, I thought I'd figured out all the ways my syntax could fail, but this one has me stumped.

Any help would be appreciated.

I have the following rule:

rule "RS6051.1.2_"
        dialect "mvel"
        when

                Applicant ( $ApplicantNumber : ApplicantNumber )
                not ( ScoreCard (name == "Context test", contextId == $ApplicantNumber) )
        then
                ScoreCard scoreCard = functions.getScoreCardManager().newScoreCard();
scoreCard.setName("Context test");
scoreCard.setContextId($ApplicantNumber);
                insert(scoreCard);
end

I'm getting the following error on this rule during compilation:

Unable to create Field Extractor for 'ApplicantNumber' : [Rule name='RS6051.1.2_']
org.drools.RuntimeDroolsException: Field/method 'ApplicantNumber' not found for class 'com.wellsfargo.service.provider.sse.decisioning.x2009.Applicant'Unable to build expression for 'consequence': null '




And here is (part of) the Applicant class in question:

package com.wellsfargo.service.provider.sse.decisioning.x2009;
public class Applicant
{
        public  Short getApplicantNumber()
        {
                return applicantNumber ;
        }

        public void setApplicantNumber(Short applicantNumber)
        {
this.applicantNumber = applicantNumber;
        }
Short applicantNumber;
}

And This is (part of) the ScoreCard class:

public class ScoreCard
{
        public void setName(String name) { this.name = name; }
        public String getName() { return name; }

        public int getContextId(){return contextId;}
        public void setContextId(int id){contextId = id;}
        private String name;
        private int contextId;
}



Why am I getting this error?
Help!
Thanks

Tom Murphy



________________________________

**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster at nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************

________________________________
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster at nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes.
To protect the environment please do not print this e-mail unless necessary.

An NDS Group Limited company. www.nds.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100209/5d9ac3c5/attachment.html 


More information about the rules-users mailing list