recursion checking util
by Mark Proctor
I've been getting requests for a testing tool that checks for recursion,
and exits the test if its detected. Any takers fancy having a go at
this? Mostly its just an event model thing, bit like the audit view. But
as recursion is not just about rule recursion, but Activation recursion
too (i.e. rule recursion with the same data), you'll need to create a
stack of rules and tuples, and check against that stack for possible
recursions. Should be fun :)
Mark
16 years, 11 months
Hypothetical Tickets...
by mmquelo massi
Hi everybody,
I am a simple "newbie user" but I have been strugglin' with drools IDE\BRMS
since sept 2007.
During my little experience with Drools and Jrules, I noticed the following
lacks in drools.
Take the following points just like "hypothetical" improvements... I am
really do not sure whether they could be
a real solution I am even not 100% sure whether the following points have
already been fixed.
1) Concerning the IDE
1.1) Nested Accessors with the guided editor
1.2) Eval expression with the guided editor
1.3) Cut\paste between different ruleflows
1.4) Showing lexical\parsing errors in .package files
1.5) Converting .brl to .drl files
2) Concerning the IDE\BRMS integration
2.1) Make .pkg files "importable" into the IDE plug in
2.2) Making the repository_export.xml "importable" into the IDE plug in
That's it.
Massi
16 years, 11 months
Fwd: Duration suggesstions
by Mark Proctor
-------- Original Message --------
Dear Mark,
Thanks again for your tasty BOF at Javapolis07, it was a pleasure
meeting you.
As you suggested me to post it, here is the feature request we talked about:
Our company often has to code time spans across working hours for
ticketing systems (issue tracking/service calls) in accordance with
ever-changing SLA (service level agreements). Those times calculi are
PAINFUL in an imperative language.
Therefore I wish I could have a modification of the 'duration' principle
that would allow the coding of such rules:
When
a customer ticket is opened for more than two hours during
working_hours_2008
and state is urgent
then
send a reminder to the support team and the team leader
-
When
a customer ticket is opened for more than four hours during
working_hours_2008
and state is urgent
and no action taken
then
escalate ticket
This might require:
* A scheduling mechanism such as quartz (sort of java combination of
'at' and 'cron' Unix commands with extension capabilities) to trigger
the second assertion of the LHS at a specific time.
* New syntax tokens: during, "for"
* New nonterminal symbols after these tokens (composite date and time
classes)
I have since then had a talk with Stephen Colebourne at Javapolis; he is
the responsible of the JSR 310 Date and Time API
(http://jsr-310.dev.java.net).
I have proposed him to extend the scope of the JSR to accept composites
of DatesWithoutTime and TimeIntervals objects to enable the retrieval of
a OffsetDateTime by calculating the span of a Duration trough a
CompositeDateAndTimeInterval.
An example is much more clear:
CompositeTimeInterval working_hours = EnhancedTimeInterval(Mon tru fri
8:00 to 20:00)
TimeInterval lunchbreak = 12:00 to 12:45
CompositeDateWithoutTime belgiumBankHolidays2008 = 1 Jan 2008, 23 Mar
2008, 24 Mar 2008, 1 May 2008, 11 May 2008, 12 May 2008, 21 Jul 2008, 15
Aug 2008, 1 Nov 2008, 11 Nov 2008, 25 Dec 2008
CompositeDateWithoutTime specialOpeningDays = Sun 20 Feb (launch of our
new super awaited product), Sun 21 Dec (shopping day before Xmas)
CompositeTimeInterval working_hours_2008 = new CompositeTimeInterval()
working_hours_2008.include(working_hours)
working_hours_2008.exclude(lunchbreak)
working_hours_2008.exclude(belgiumBankHolidays2008)
working_hours_2008.include(specialOpeningDays)
This composite is to be used after the 'during' token. The duration
would require its own syntax token (the word 'for' is already overused
in programming languages, it could lead to confusion)
These composites would have to be defined somewhere at sometime for the
BRE to access them. Could they be directly defined in rule packages? Or
accessed as
Thus, in order:
* assert LHS's CEs
* calculate the time span of the duration across the 'agenda' (also a
confusing keyword, would it be good English to call it schedule?)
* set an event in the future for the matched object
* when it’s event time: callback the object LHS assertion
* and if still true, execute RHS
I would be very happy to contribute to the implementation of this
feature, please let me know if you (and your team) are interested in
such a feature.
Looking forward to hearing from you,
Stanislas Herman Rusinsky.
16 years, 11 months
4.0.4
by Mark Proctor
Now that we have the modify keyword backported to 4.0.x we should use
this for all the examples, as "update" is now redundant inside of the
consequence. Also should switch over manners and waltz and disable
shadow proxies - he we need to update docs too to explain this. Once
those are done, lets release 4.0.4, was hoping to do it before xmas but
as fernando has been busy elsewhere, it looks like it'll be in the first
week or so of the new year.
Mark
16 years, 12 months
A possible 'or ' bug
by Stjepan Cvitanovic
Hello
I'd like to report a (possible) bug,
I've tried to run this on the latest version of drools (4.0.3) but I get an
error:
applyOrTransformation could not find transformation for parent 'OR' and
child 'OR'
java.lang.RuntimeException: applyOrTransformation could not find
transformation for parent 'OR' and child 'OR'
at org.drools.rule.LogicTransformer.applyOrTransformation(
LogicTransformer.java:148)
at org.drools.rule.LogicTransformer.processTree(LogicTransformer.java
:140)
at org.drools.rule.LogicTransformer.transform(LogicTransformer.java:76)
at org.drools.rule.Rule.getTransformedLhs(Rule.java:419)
at org.drools.reteoo.builder.ReteooRuleBuilder.addRule(
ReteooRuleBuilder.java:102)
at org.drools.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:116)
at org.drools.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java:268)
at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java
:337)
at hr.combis.rule.editor.tester.RuleTesterFDAImpl.createRuleBase(
RuleTesterFDAImpl.java:210)
at hr.combis.rule.editor.tester.RuleTesterFDAImpl.init(
RuleTesterFDAImpl.java:159)
at hr.combis.rule.editor.testing.TestingExecutor.run(
TestingExecutor.java:129)
at java.lang.Thread.run(Thread.java:595)
this is what the rule looks like:
wine : Wine(color == "red")
or
(
cheese : Cheese(smelly == "yes")
*and*
(
person : Person(height == 12, fovouriteCheese == cheese)
*or*
person : Person(height == 13, fovouriteCheese == cheese)
)
)
the rule looks perfectly sensical to me. If I change it to this (which, btw.
looks non-sensical)
wine : Wine(color == "red")
or
(
cheese : Cheese(smelly == "yes")
*or*
(
person : Person(height == 12, fovouriteCheese == cheese)
*and*
person : Person(height == 13, fovouriteCheese == cheese)
)
)
I'm not saying the second one shouldn't work(I fail to make the sense of it
however), but it looks to me, the first one should.
Am I wrong, or is this really a bug?
--
lp
------
Stjepan
17 years