Stjepan Cvitanovic | 6 Dec 13:22
Picon

[rules-dev] A possible 'or ' bug

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

_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev
Edson Tirelli | 6 Dec 13:53

Re: [rules-dev] A possible 'or ' bug


   Looks like a bug indeed. May I ask you please to open a JIRA for it?

   Thank you,
    Edson

2007/12/6, Stjepan Cvitanovic < stjepan.cvitanovic <at> gmail.com>:
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
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev




--
  Edson Tirelli
  JBoss Drools Core Development
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat <at> www.jboss.com
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev
Stjepan Cvitanovic | 6 Dec 14:14
Picon

Re: [rules-dev] A possible 'or ' bug

I have created JIRA, url: http://jira.jboss.com/jira/browse/JBRULES-1364
Thank You

On Dec 6, 2007 1:53 PM, Edson Tirelli < tirelli <at> post.com> wrote:

   Looks like a bug indeed. May I ask you please to open a JIRA for it?

   Thank you,
    Edson

2007/12/6, Stjepan Cvitanovic < stjepan.cvitanovic <at> gmail.com>:
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
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev




--
  Edson Tirelli
  JBoss Drools Core Development
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat <at> www.jboss.com
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev




--
lp
------
Stjepan
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev
Mark Proctor | 9 Dec 04:11

[rules-dev] recursion checking util

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
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev

Darko IVANCAN | 9 Dec 14:08
Picon
Picon

Re: [rules-dev] recursion checking util

Hi Mark,

Should this be an (a) off-line or an (b) on-line tool ?
(a) off-line: parse rule file and point out the lines/rules which could
lead to a potential recursion
(b) on-line: identifiy a potential recursion while runtime by observing
the agenda and the working memory

Sounds like fun indeed, ... I'll take a look once I have some time,
Darko Ivancan

On 09/12/2007 08:41, Mark Proctor wrote:
> 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
> _______________________________________________
> rules-dev mailing list
> rules-dev <at> lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev

Mark Proctor | 9 Dec 15:09

Re: [rules-dev] recursion checking util

Darko IVANCAN wrote:
Hi Mark, Should this be an (a) off-line or an (b) on-line tool ? (a) off-line: parse rule file and point out the lines/rules which could lead to a potential recursion (b) on-line: identifiy a potential recursion while runtime by observing the agenda and the working memory Sounds like fun indeed, ... I'll take a look once I have some time, Darko Ivancan
I think the idea is it would work like the audit view. So its a special listener configuration. It would't really be used for a production system, as i expect the perf and memory penalties to be high, but it is something that people can use for testing. We would probably integrate it with the testign tool that Mic is writting - that already tells you how many times a rule fires, but it doesn't cover rule recursion or rule+data recursion. Remember as well its not a single re-entrant rule; the recursion could be part of a much bigger loop in a set of rules.
On 09/12/2007 08:41, Mark Proctor wrote:
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 _______________________________________________ rules-dev mailing list rules-dev <at> lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-dev
_______________________________________________ rules-dev mailing list rules-dev <at> lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-dev

_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev
Mark Proctor | 21 Dec 17:46

[rules-dev] Drools Extensible Process Definition Language (ePDL) and the Semantic Module Framework (SMF)

The SMF has been forward ported from Drools 2.0 and now lives again, to 
make our process definitions much more extensible.
http://blog.athico.com/2007/12/drools-extensible-process-definition.html

This is in trunk now and will be part of our Milestone 1 release in the 
new year.

Mark
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev

Mark Proctor | 24 Dec 14:31

[rules-dev] 4.0.4

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
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev

Mark Proctor | 28 Dec 14:31

[rules-dev] Fwd: Duration suggesstions

-------- 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.
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev
Tony Ross | 28 Dec 20:38
Picon

Re: [rules-dev] Fwd: Duration suggesstions

please please unsubscribe me from this 


On 28 Dec 2007, at 14:31, Mark Proctor wrote:

-------- 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.
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev

Tony Ross
Portal Consultant

UPC Broadband Holding Services
CIO Web Delivery
Boeing Avenue 53
1119 PE Schiphol-Rijk
The Netherlands

M:+31 (0)6 347 125 11
E: tony.ross <at> mac.com

_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev

Gmane