how to debug rules in JBoss AS?
by Marina
Hello,
I know one can debug rules (put breakpoints in .drl and ruleflow files) when
running/debugging an application as a Drools Application.
However, I would like to debug rules when my application is running in JBoss AS
- just like we do a normal debugging of a Remote application running in a
different JVM ,by enabling the JDWP on the server
(-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n) and then
connecting to the specified port.
Basically, I would like to be able to debug both my Java classes and rules
together. Is it possible?
thanks,
Marina
12 years, 4 months
How to set drools.dialect.mvel.strict = false?
by jeetendray
Hi,
Snippet of my DRL .
rule "Rev: Start Time < 2 Hours in Future"
when
$obj : eval(compareDatesWithTime(startDateTime, -2, 2, "<"))
then
$obj.addFailedRule("Rev: Start Time < 2 Hours in Future");
end
This fails during compilation and throws error:
org.drools.rule.InvalidRulePackage: Unable to Analyse Expression
(eval(compareDatesWithTime(startDateTime, -2, 2, "<")) ):
[Error: unable to resolve method using strict-mode: myObject.eval(boolean)]
[Near : {... (eval(compareDatesWithTime(star ....}]
^
[Line: 6, Column: 2] : [Rule name='Proposal - Start time is after current +
2 hour']
I am using Drools 5.5 and I found the cause that my code runs in strict
mode.. so If I set strict mode to false then this would work. Now I am not
sure how to make it to false.
Here's the code I am using:
PackageBuilderConfiguration packageBuilderConfiguration = new
PackageBuilderConfiguration();
PackageBuilder packageBuilder = new
PackageBuilder(packageBuilderConfiguration);
packageBuilder.addPackageFromDrl(drl.getCharacterStream());
Can someone please suggest me how to do that??
Thanks!!!
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-set-drools-dialect-mvel-strict-f...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months
Re: [rules-users] java.lang.ClassCastException: [Lorg.drools.rule.Package; cannot be cast to org.drools.rule.Package
by Manasi
Hi,
I am also getting same error when trying to a call rule stored in guvnor.
Following error I am getting:
Exception in thread "main" java.lang.ClassCastException:
[Lorg.drools.rule.Package; cannot be cast to org.drools.rule.Package
at org.drools.agent.HttpClientImpl.fetchPackage(HttpClientImpl.java:82)
at org.drools.agent.URLScanner.readPackage(URLScanner.java:171)
at org.drools.agent.URLScanner.getChangeSet(URLScanner.java:143)
at org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:119)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:427)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:379)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:364)
at org.drools.agent.RuleAgent.init(RuleAgent.java:264)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:204)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:164)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:273)
I am using Drools 5.4 version.
The error is coming when trying to get the RuleAgent:
RuleAgent agent = RuleAgent.newRuleAgent("/com/model/drools.properties");
drools.properties contains:
url =
http://localhost:8080/guvnor/org.drools.guvnor.Guvnor/package/FeltKnapRes...
name=guvnorAgent
enableBasicAuthentication=True
username=admin
password=admin
FeltKnapRestriktionerKundeMedAnl is the package name I have created in
guvnor ,and I want to call one of the rule in this package.
Thanks,
Manasi
--
View this message in context: http://drools.46999.n3.nabble.com/java-lang-ClassCastException-Lorg-drool...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months
Timers and fireAllRules
by Wolfgang Laun
A rule controlled by a timer becomes active when it matches, and
once for each individual match. Its consequence is executed
repeatedly, according to the timer's settings. This stops as soon
as the condition doesn't match any more.
Consequences are executed even after control returns from a call
to fireUntilHalt(). Moreover, the Engine remains reactive to any
changes made to the Working Memory. For instance, removing a fact
that was involved in triggering the timer rule's execution causes
the repeated execution to terminate, or inserting a fact so that
some rule matches will cause that rule to fire. But the Engine is
not continually active, only after a rule fires, for whatever
reason. Thus, reactions to an insertion done asynchronously will
not happen until the next execution of a timer-controlled rule.
Disposing a session puts an end to all timer activity.
-W
12 years, 5 months
Event and Facts Problem
by Andynator
hey,
I have a problem with events and facts: when i have two existing facts
(resources) und i am inserting an event (request), then following rule is
fired twice (for each resource)
/declare ReservationRequest
@role ( event )
@timestamp ( timestamp )
@expires(0s)
end
rule "Allocate"
no-loop true
when
$resource : Resource(state == 0)
$request : ReservationRequest() from entry-point "EventStream"
then
modify($resource) { setState(1) };
insert(new Allocation($resource, $request.getDuration()));
log.warn("Rule 'Allocate' fired: '" + $resource.getName() + "' on
Request '" + $request.getName());
end/
Any ideas why?
--
View this message in context: http://drools.46999.n3.nabble.com/Event-and-Facts-Problem-tp4024622.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months