Semantic Web Drools Module, Request for Feedbak
by Xavier Breton
Hi,
I'm looking for feedback, I'll develop a Semantic Web Drools Module that
will be the subject of my Master Degree Tesis.
The idea is to use Eclipse Modelling Framework (EMF) for prototyping and
follow a Model Driven Architecture (MDA) where the source language is
Semantic of Business Vocabularies and Business Rules (SBVR) and the target
language is Drools DRL.
The mapping could be (PIM level):
- Semantic Web Rule Language (SWRL)
- Ontology Web Language (OWL)
- RuleML
- Rule Interchange Format (RIF)
- REWERSE Rule Markup Language (R2ML)
It could be added to the module at the source UML or Entity Relationship
like models to transform the models into SBVR.
Regards
Xavier Breton
10 years, 10 months
Kie: pluggable builders
by Michael Anstis
I was thinking over the weekend.
Guvnor has many different file types it uses to store rule definitions.
Currently Guvnor builds DRL before passing this to KieBuilder via
KieStorage (erm, will do this).
Any thoughts on moving the conversion to DRL from Guvnor to pluggable
builders within Kie that accept defined file-types (you have DRL and XLS at
the moment).
This further makes Guvnor just the "rule management" component having
knowledge base building (from any resource type) within Expert.
Guvnor would obviously provide all the pluggable builders it needs for 6.0.
Just a thought...
sent on the move
11 years, 9 months
removing DSLs
by Mark Proctor
How would people feel if we removed DSLs from 6.0? There is no decision either way, but I wanted to see if people liked or disliked the idea.
My reason for this is I don't believe DSLs in their current form, beyond demo ware, are useful. They need a lot more work to turn them into guided structured documents, we don't have the people to focus on that right now, and no one from the community has taken this on.
I'd rather see them removed, until they can be done properly.
Mark
11 years, 11 months
[Bug] cannot invoke method: asList
by Wolfgang Laun
Below is a self-contained DRL which, when run with 5.5.0, throws an
exception "cannot invoke method asList". Remarkably, this only happens
when a second Project fact is inserted. (Haven't I heard this before?)
-W
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
declare Project
@typesafe (false)
list1 : List
list2 : List
end
rule kickoff
salience 999999
when
then
insert( new Project() );
insert( new Project() ); // necessary to trigger the exception
end
rule " Config rule "
dialect "mvel"
no-loop true
when
P : Project()
then
modify(P) {
list1 = Arrays.asList(10, 15, 20, 25),
list2 = Arrays.asList(11, 2, 3, 4, 5, 10, 9, 8, 7)
};
end
Exception in thread "main" Exception executing consequence for rule "
Config rule " in express: java.lang.RuntimeException: cannot construct
object
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1297)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1221)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1456)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:710)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:674)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:230)
at express.Main.execute(Main.java:77)
at express.Main.main(Main.java:110)
Caused by: java.lang.RuntimeException: cannot construct object
at org.mvel2.optimizers.impl.refl.nodes.ConstructorAccessor.getValue(ConstructorAccessor.java:63)
at org.mvel2.ast.NewObjectNode.getReducedValueAccelerated(NewObjectNode.java:233)
at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:42)
at org.mvel2.ast.WithNode$ParmValuePair.eval(WithNode.java:281)
at org.mvel2.ast.WithNode.getReducedValueAccelerated(WithNode.java:67)
at org.mvel2.ast.InterceptorWrapper.getReducedValueAccelerated(InterceptorWrapper.java:40)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)
at org.mvel2.MVEL.executeExpression(MVEL.java:930)
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:104)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1287)
... 7 more
Caused by: java.lang.RuntimeException: cannot invoke method: asList
at org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.getValue(MethodAccessor.java:63)
at org.mvel2.optimizers.impl.refl.nodes.VariableAccessor.getValue(VariableAccessor.java:37)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)
at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:42)
at org.mvel2.optimizers.impl.refl.nodes.ConstructorAccessor.executeAll(ConstructorAccessor.java:76)
at org.mvel2.optimizers.impl.refl.nodes.ConstructorAccessor.getValue(ConstructorAccessor.java:43)
... 18 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 4
at org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.executeAll(MethodAccessor.java:149)
at org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.getValue(MethodAccessor.java:48)
... 23 more
11 years, 11 months
Re: [rules-dev] [BAD Bug] incorrect evaluation of LHS using Integer/Number intValue
by Wolfgang Laun
[Sorry - the previous email "escaped" before I was complete.]
This is a self-contained DRL demonstrating the erroneous handling of
a condition involving Integer.intValue (same: Number.intValue), not
and retract, which is meant to sort the integers. This fails with 5.5.0,
but works correctly with 5.4.0 and previous versions.
rule init
salience 9999
when
then
insert( Integer.valueOf( 10 ) );
insert( Integer.valueOf( 50 ) );
insert( Integer.valueOf( 60 ) );
insert( Integer.valueOf( 40 ) );
insert( Integer.valueOf( 20 ) );
end
rule "Rule 04"
when
$number : Integer( $i: intValue )
not Integer(intValue < $i)
then
System.out.println("Number found with value: " + $number.intValue());
retract($number);
end
>
> On 17/01/2013, Wolfgang Laun <wolfgang.laun(a)gmail.com> wrote:
>> This BAD bug was introduced on the way from 5.4.0 to 5.5.0 (and seems
>> to have sneaked into 6.0.0 as well).
>>
>> Only 5.4.0 and predecessors work as expected.
>>
>> Damage control? How far can 5.5.0 be trusted?
>>
>>
>> On 17/01/2013, John Smith <ffirstt.llastt(a)gmail.com> wrote:
>>> I am new to Drools and am trying to get the sample program to work. This
>>> sample is given in the drools documentation
>>> http://docs.jboss.org/drools/release/5.5.0.Final/drools-expert-docs/html_....
>>> This drool rule is expected to sort integers. I just changed the numbers
>>> from what are given in the sample and they do not get sorted as
>>> expected.
>>> Tried using drools version 5.5.0, 5.5.1 and the master 6.0.0, but got
>>> the
>>> same wrong results.
>>>
>>> Following is the main code:
>>> package com.sample;
>>>
>>> public class Example2 {
>>> public static void main(String[] args) throws Exception {
>>> Number[] numbers = new Number[] { wrap(5), wrap(6), wrap(4),
>>> wrap(1), wrap(2) };
>>> new RuleRunner().runRules(new String[] { "Example3.drl" },
>>> numbers);
>>> }
>>>
>>> private static Integer wrap(int i) {
>>> return new Integer(i);
>>> }
>>> }
>>>
>>> The RuleRunner class is the same as given in the example and I do not
>>> think
>>> I should give that here, since it will clutter the question. It simply
>>> creates the KnowledgeBase, stateful session, inserts the facts as given
>>> in
>>> the 'numbers' array above and then calls fireAllRules method on the
>>> session.
>>>
>>> The rule file (Example3.drl) is:
>>>
>>>
>>> rule "Rule 04"
>>> dialect "mvel"
>>> when
>>> $number : Number()
>>> not Number(intValue < $number.intValue)
>>> then
>>> System.out.println("Number found with value: " +
>>> $number.intValue());
>>> retract($number);
>>> end
>>>
>>>
>>> The output I get is as follows:
>>> Loading file: Example3.drl
>>> Inserting fact: 5
>>> Inserting fact: 6
>>> Inserting fact: 4
>>> Inserting fact: 1
>>> Inserting fact: 2
>>> Number found with value: 1
>>> Number found with value: 4
>>> Number found with value: 2
>>> Number found with value: 5
>>> Number found with value: 6
>>>
>>> Not the correct expected ascending sorted order.
>>>
>>> What might I be doing wrong? I cannot imagine that the drools rule
>>> engine
>>> would be broken at this basic level.
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://drools.46999.n3.nabble.com/Drools-Expert-does-not-sort-integers-co...
>>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>>> _______________________________________________
>>> rules-users mailing list
>>> rules-users(a)lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>
>>
>
11 years, 11 months
[BAD
by Wolfgang Laun
rule init
salience 9999
when
then
insert( Integer.valueOf( 10 ) );
insert( Integer.valueOf( 50 ) );
insert( Integer.valueOf( 60 ) );
insert( Integer.valueOf( 40 ) );
insert( Integer.valueOf( 20 ) );
end
rule "Rule 04"
## dialect "mvel"
when
$number : Integer( $i: intValue )
not Integer(intValue < $i)
then
System.out.println("Number found with value: " + $number.intValue());
retract($number);
end
On 17/01/2013, Wolfgang Laun <wolfgang.laun(a)gmail.com> wrote:
> This BAD bug was introduced on the way from 5.4.0 to 5.5.0 (and seems
> to have sneaked into 6.0.0 as well).
>
> Only 5.4.0 and predecessors work as expected.
>
> Damage control? How far can 5.5.0 be trusted?
>
>
> On 17/01/2013, John Smith <ffirstt.llastt(a)gmail.com> wrote:
>> I am new to Drools and am trying to get the sample program to work. This
>> sample is given in the drools documentation
>> http://docs.jboss.org/drools/release/5.5.0.Final/drools-expert-docs/html_....
>> This drool rule is expected to sort integers. I just changed the numbers
>> from what are given in the sample and they do not get sorted as expected.
>> Tried using drools version 5.5.0, 5.5.1 and the master 6.0.0, but got the
>> same wrong results.
>>
>> Following is the main code:
>> package com.sample;
>>
>> public class Example2 {
>> public static void main(String[] args) throws Exception {
>> Number[] numbers = new Number[] { wrap(5), wrap(6), wrap(4),
>> wrap(1), wrap(2) };
>> new RuleRunner().runRules(new String[] { "Example3.drl" },
>> numbers);
>> }
>>
>> private static Integer wrap(int i) {
>> return new Integer(i);
>> }
>> }
>>
>> The RuleRunner class is the same as given in the example and I do not
>> think
>> I should give that here, since it will clutter the question. It simply
>> creates the KnowledgeBase, stateful session, inserts the facts as given
>> in
>> the 'numbers' array above and then calls fireAllRules method on the
>> session.
>>
>> The rule file (Example3.drl) is:
>>
>>
>> rule "Rule 04"
>> dialect "mvel"
>> when
>> $number : Number()
>> not Number(intValue < $number.intValue)
>> then
>> System.out.println("Number found with value: " +
>> $number.intValue());
>> retract($number);
>> end
>>
>>
>> The output I get is as follows:
>> Loading file: Example3.drl
>> Inserting fact: 5
>> Inserting fact: 6
>> Inserting fact: 4
>> Inserting fact: 1
>> Inserting fact: 2
>> Number found with value: 1
>> Number found with value: 4
>> Number found with value: 2
>> Number found with value: 5
>> Number found with value: 6
>>
>> Not the correct expected ascending sorted order.
>>
>> What might I be doing wrong? I cannot imagine that the drools rule engine
>> would be broken at this basic level.
>>
>>
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Drools-Expert-does-not-sort-integers-co...
>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>> _______________________________________________
>> rules-users mailing list
>> rules-users(a)lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
11 years, 11 months
Template Rules and Knowledge Agent Change Sets
by Michael Donovan
Hello,
In my application I create rules using a template. The application allows
users to specify the when clause of a rule and then builds a knowledge base
by taking the when clauses stored in the database and joining them with the
template. I am trying to solve the problem of incrementally updating the
knowledge base when the information stored in the database has been
updated/inserted/deleted without completely rebuilding the entire knowledge
base.
I was looking at using Knowledge Agent change sets to do this. I was
wondering if there are any options other than supplying a change set xml
file to manipulate the knowledge base? I believe I can make it work with
what is outlined in the documentation and in the blog posts but I want to
understand all my options so I can make a solid implementation decision.
Any help is greatly appreciated. Thanks!
11 years, 11 months
droolsjbpm-integration failing
by Toni Rikkola
droolsjbpm-integratio has been failing for over 2 months now. Hard to find the person who broke it. Still going to try.
The following tests are broken:
>>> org.drools.examples.carinsurance.rule.PolicyApprovalRulesTest.rejectMinors 22 ms 17
>>> org.drools.examples.carinsurance.rule.PolicyApprovalRulesTest.rejectMinorsFailingAssertion 19 ms 17
>>> org.drools.examples.carinsurance.workflow.PolicyApprovalWorkflowTest.approvePolicyRequest 1.2 sec 17
I'm looking for the person responsible for these codes or for the person who broke the tests. Not to blame him, but to get the build blue again.
Toni
11 years, 11 months