How to return a primitive or object value from a static method using Drools Rule Engine?

I have a static calculation method (many more methods like this one) like:

public class ShareCalculator{
    public static double calculateDailyDecDivRate(DeclaredDividend pDeclaredDiv,  
             FundProductDeclaredDividend pFundProductDeclaredDividend)throws FMSCalculationException{

             ...... verify many if, then else conditions ,, etc....
             then return the double value
    }
}

    I plan to utilize Drools Rule Engine ...
    Then my real question is how DO I RETURN THE Primitive or Object value from this method to a calling
    class?

    Does my question make sense?
    Most of the examples I saw on Drools mostly deal with Object with getter/setter type !!!
    How to I use a class with static methods to return values?

    Thanks much.
    _Esam
_EsamAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

schybertCommented:
What version of Drools are you using? In 4.0 you can imort your static methods as functions like this:

import function your.package.ShareCalculator.calculateDailyDecDivRate

Then you can use the method as a function using it's name like this:

when
    eval( true )
then
    System.out.println( calculateDailyDecDivRate( yourInput) );
end

Hope this helps...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.