Debug rule functions ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Debug rule functions ?

ipeshev
Hello,

could some give me some tips for debugging functions in .drl ?
by now I'm not able to debug inside the functions which are called by the rule sequence.
I follow the JBoss Drools Tools Reference Guide but what is show there is how to debug a very simple rule sequence. I have no problem with that - following the guide everything is ok.

BUT
There is nothing shown about a more complex case when there are functions (java-like) in the .drl file and the rule calls one or more of these functions. And one function calls another etc. (just like in normal programming)
When a put a breakpoint inside functions I cannot debug them.
I can only debug the rule ("then" section)

Any help would be appreciated?
Or any official info if this supported at all.
versions etc.

Best Regards
Ivan

Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Debug rule functions ?

Armand Welsh
Personally, I never use DRL functions.  I create my functions in a java class module, and I import functions into drools.  I have noticed that in earlier versions of Drools (I don't know about recent versions), that using drl functions put a larger load on system than using imported external functions.  Plus you gain the added benefit of being able to use your IDE's built-in debugger to step through the function logic.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of ipeshev
Sent: Wednesday, January 25, 2012 10:17 PM
To: [hidden email]
Subject: [rules-users] Debug rule functions ?

Hello,

could some give me some tips for debugging *functions* in .drl ?
by now I'm not able to debug *inside the functions* which are called by the
rule sequence.
I follow the
http://docs.jboss.org/tools/3.0.0.GA/en/drools_tools_ref_guide/html_single/index.html#debugging_rules
JBoss Drools Tools Reference Guide  but what is show there is how to debug a
very simple *rule sequence*. I have no problem with that - following the
guide everything is ok.

BUT
There is nothing shown about a more complex case when there are functions
(java-like) in the .drl file and the rule calls one or more of these
functions. And one function calls another etc. (just like in normal
programming)
When a put a breakpoint inside functions I cannot debug them.
I can only debug the *rule* ("then" section)

Any help would be appreciated?
Or any official info if this supported at all.
versions etc.

Best Regards
Ivan



--
View this message in context: http://drools.46999.n3.nabble.com/Debug-rule-functions-tp3689774p3689774.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: Debug rule functions ?

benq2188
In reply to this post by ipeshev
Hello,

I also followed reference manual of Drools but breakpoints are not being hit by debugger in drl.

The steps that I went through:

-Installed GEF
- downloaded drools-distribution-5.4.0.Final.zip
-unzipped it into Eclipse main folder
-restarted Eclipse
-defined run time  based on the latest Drools project jars included in the plugin
itself,
-Created Drools Project
-Created new launch configuration for Drools Application.
-Put a breakpoint in the helloworld simple project on the first line of the section "then".

When I debug it as Drools Application, debugger doesn't stop in drl rule.

Any solutions, how can I fix it?

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: Debug rule functions ?

ipeshev
Hi,

the best option I've seen by now is the one mentioned by Armand Welsh - use imported java class with methods instead of drools functions.

btw:
by now I group my classes into jars, but I've never tried to use standalone .class files.
anyone tried this?
anything special (some settings) in order .class to be found?

(note: I use local .drl files instead of Guvnor repository to load rules into memory)