I guess it depends on whether there is a static connect() method on the Database class
which returns a DatabaseConnection, which in turn has a method
getUserRisk(POC_CombineString), which returns an instance of the TestValue class.
On a side note, it's a very bad idea to put database calls in the LHS of your rules.
It invariably plays hell with performance. Although potentially it gives people like me a
job re-writing slow applications, as I was doing last year, so not everyone loses out. ;)
Steve
On 27 Jul 2013, at 07:11, Wolfgang Laun <wolfgang.laun(a)gmail.com> wrote:
There is no reason why this should not compile.
I suspect that you have not posted the *accurate* text of the rule
where that error occurred. Does the snippet you've mailed
cause the same error?
-W
On 26/07/2013, IPatel <ishita.patel(a)usbank.com> wrote:
> Thank you for your replay... here is what i am using
> package POC2013
> dialect "mvel"
> import com.usbank.tmup.rules.value.Database
> import com.usbank.tmup.rules.value.TestValue
> import com.usbank.tmup.rules.value.DatabaseConnection
>
> rule "getting user"
>
> when
> $value: TestValue()
> record : POC_CombineString($value.getField1(),$value.getField2())
> val : TestValue() from Database.connect().getUserRisk(record);
> then
> System.out.println("The value of the score is" + val);
> end
>
>
>
> --
> View this message in context:
>
http://drools.46999.n3.nabble.com/using-From-keyword-in-the-rule-tp402516...
> Sent from the Drools: User forum mailing list archive at
Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users