Returned mail: see transcript for details
by Mail Delivery Subsystem
The original message was received at Tue, 15 Dec 2009 13:16:33 +0800 from lists.jboss.org [90.223.46.39]
----- The following addresses had permanent fatal errors -----
<rules-users(a)lists.jboss.org>
----- Transcript of session follows -----
... while talking to host 66.197.7.2:
>>> RCPT To:<rules-users(a)lists.jboss.org>
<<< 550 MAILBOX NOT FOUND
14 years, 11 months
Re: [rules-users] Event consuming policy
by Edson Tirelli
You are not using the configuration you created... you need to pass it as
a parameter to the factory:
KnowledgeBaseConfiguration config =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
config.setOption(EventProcessingOption.STREAM);
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(
config );
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
As it is now, your are using CLOUD mode. Since you are not timestamping
events, the engine is using the system clock and your application should not
rely on the matching order. If you need a specific matching order, you need
to use one of the conflict resolution strategies (like salience).
Edson
2009/12/14 Khalil Hafsi <hafsi(a)fzi.de>
> Hi Edson,
>
> I am running in stream mode , I used this function
>
> config.setOption(EventProcessingOption.STREAM);
>
> to enable it.
>
> About the clock and time stamping I am not using anything special , this is
> the initiation part of my main :
>
>
> KnowledgeBuilder kbuilder =
> KnowledgeBuilderFactory.newKnowledgeBuilder();
> kbuilder.add(ResourceFactory.newClassPathResource("pol.drl"),
> ResourceType.DRL);
> if ( kbuilder.hasErrors() ) {
> System.err.println( kbuilder.getErrors().toString() );
> }
> KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
> kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
>
>
> KnowledgeBaseConfiguration config =
> KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
> config.setOption(EventProcessingOption.STREAM);
> StatefulKnowledgeSession ksession =
> kbase.newStatefulKnowledgeSession();
> WorkingMemoryEntryPoint mainS =
> ksession.getWorkingMemoryEntryPoint( "mainS" );
>
> Thank you,
> Khalil Hafsi
>
> Edson Tirelli wrote:
>
>
> Are you running in STREAM or CLOUD mode? What clock are you using? Are
> you timestamping the events or are you using the clock to timestamp them?
>
> Edson
>
> 2009/12/14 Khalil Hafsi <hafsi(a)fzi.de>
>
>> Hi Guys,
>>
>> I was working lately with drools fusion, we wanted to know what event
>> consumption policy was implemented.
>> We made the following simple rule :
>>
>> rule a
>>
>> when
>> $c1 : Event(symbol == 1 , $l1 :load) from entry-point "mainS"
>> and
>> $c2 : Event(this after $c1,symbol == 2,$l2 :load) from
>> entry-point "mainS"
>>
>> then
>> System.out.println("event1 "+$l1+" event2 "+$l2);
>>
>> end
>>
>> The event class has just symbol : int and load : int , load is used to
>> differentiate between different events that have the same symbol.
>>
>> and then we declared the following events into the stream using the
>> constructor Event(symbol,load): with mainS being a WorkingMemoryEntrypoint
>>
>> mainS.insert(new Event(1,10.0));
>> mainS.insert((new Event(1,20.0)));
>> mainS.insert((new Event(1,30.0)));
>> mainS.insert(new Event(2,80.0));
>> mainS.insert(new Event(2,90.0));
>>
>>
>> We have the following output :
>>
>> event1 30.0 event2 90.0
>> event1 20.0 event2 90.0
>> event1 10.0 event2 90.0
>> event1 10.0 event2 80.0
>>
>> So what is exactly the consumption policy used in DROOLS ? It seems that
>> is unrestricted for event 90.0 and chronological for event 80 .
>>
>> We have tested different situations and order of events and we always
>> came to the conclusion that for the first $c2 the policy is
>> chronological and for all the other $c2's it is unrestricted.
>>
>> Thank you for you time.
>> Khalil
>>
>> _______________________________________________
>>
>
>
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
14 years, 11 months
Human Task Work Item
by Todd Pagni
>From the Mina client, how do you get a work item associated with a human
task?
I see the Task.getTaskData(), but I don't see any easy way to get the
work item as I need the work item inparameters from the mina client
side.
Thanks,
Todd
14 years, 11 months
Event consuming policy
by Khalil Hafsi
Hi Guys,
I was working lately with drools fusion, we wanted to know what event
consumption policy was implemented.
We made the following simple rule :
rule a
when
$c1 : Event(symbol == 1 , $l1 :load) from entry-point "mainS"
and
$c2 : Event(this after $c1,symbol == 2,$l2 :load) from
entry-point "mainS"
then
System.out.println("event1 "+$l1+" event2 "+$l2);
end
The event class has just symbol : int and load : int , load is used to
differentiate between different events that have the same symbol.
and then we declared the following events into the stream using the
constructor Event(symbol,load): with mainS being a WorkingMemoryEntrypoint
mainS.insert(new Event(1,10.0));
mainS.insert((new Event(1,20.0)));
mainS.insert((new Event(1,30.0)));
mainS.insert(new Event(2,80.0));
mainS.insert(new Event(2,90.0));
We have the following output :
event1 30.0 event2 90.0
event1 20.0 event2 90.0
event1 10.0 event2 90.0
event1 10.0 event2 80.0
So what is exactly the consumption policy used in DROOLS ? It seems that
is unrestricted for event 90.0 and chronological for event 80 .
We have tested different situations and order of events and we always
came to the conclusion that for the first $c2 the policy is
chronological and for all the other $c2's it is unrestricted.
Thank you for you time.
Khalil
14 years, 11 months
Is this overkill to use a rule engine?
by Will_Virtual
I have a new RCP application that allows users to maintain patient
demographics data via a UI form. It is a fairly deep object graph and data
of this model is pre loaded for every patient. I need to add the flexibility
for users to write rules via a UI tool and customize how and when they want
data in the model should be changed and control things in the UI form, such
as set focus, set required, enable/disable field, show message box ...etc.
They also want the ability to group and when to fire rules based on three
different levels such as form, dialog or field. They could build one or more
rules to the form or/and dialogs/fields in the form. They could set up to
fire rules at the open/close of the form or dialog or even when a value is
changed/lost focus on a field.
I’d like to have your opinions if this will fit well with Drool rule engine.
Is this a bit overkill for what I want to do? Has anyone used Drool for
something similar to this?
Thanks.
--
View this message in context: http://n3.nabble.com/Is-this-overkill-to-use-a-rule-engine-tp90400p90400....
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 11 months
Server Sizing for Flow and Expert
by Bruce Campbell
I will be starting a new project soon and my middleware folks need to size a server for it. Does anyone have any input as to how they (middleware) can adjust their usual sizing exercise to account for the use of Flow and Expert? Here are some "facts" that may or may not be relevant...
We do not have any significant experience with Flow nor Expert
We will be using the "current" release of Drools as of January 4th 2010
Websphere in the middle, Oracle in the back
Our main Expert routine will run every 10 minutes and
will determine which of our 10-ish "flows" the work items will travel
may contain 500 - 1000 rules (guestimated by a noob)...
will process the rules once-through for each item in the batch (little or no rule interactions)
a batch would typically contain 10- 100 items to process..
but could contain up to 300 after a severe outage.
batch size could be controlled if necessary.
and will likely run on the same server as the "Flow" application...
Our internal web application will be primarily Flow driven with...
50-ish user, 35 concurrent
10 "flows" with simple to moderate complexity from a processing perspective, mainly human tasks. (much of the time someone will check a few boxes, add some comments, and the work item will flow to the next step/person.)
I'm hopeful someone can pipe in with how Flow and Expert change the typical sizing exercise, however, I appreciate any input you may have whether related to sizing or not..
thanks in advance
Bruce
NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
14 years, 11 months
write rule in xml format.
by stefano corna
hello,
i use drools 5.0 and i have a big problem while i try to write a rule in xml
format.
my example rule is the follow:
---------------------------------------------------------------------------
<rule-set name="cheese rules"
xmlns="http://drools.org/rules"
xmlns:java="http://drools.org/semantics/java"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/rules rules.xsd
http://drools.org/semantics/java java.xsd">
<rule name="Bob Likes Cheese">
<parameter identifier="bob">
<class>org.drools.examples.simple.Bob</class>
</parameter>
<java:condition>bob.likesCheese() == true</java:condition>
<java:consequence>
System.out.println( "Bob likes cheese." );
</java:consequence>
</rule>
</rule-set>
-----------------------------------------------------------
and editor (eclipse) show me this error and im unable to run program:
[1,0]: [ERR 101] Line 1:0 no viable alternative at input '<'
java.lang.IllegalArgumentException: Could not parse knowledge.
at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:67)
at com.sample.DroolsTest.main(DroolsTest.java:24)
someone know how to fix it? is this cause eclipse see the '<' as a boolean
operator and not as xml opening tag?
thanks in advice.
14 years, 11 months
Starting ruleflow on event
by bbking
I'm using Drools 5.0.1 and have read in the online documentation that i can
start a process on event:
"Events could also be used to start a process. Whenever a Start node defines
an event trigger of a specific type, a new process instance will be started
every time that type of event is signalled to the process engine."
However, I cannot find a property on the Start activity that exposes this
functionality.
Am I missing something?
--
View this message in context: http://n3.nabble.com/Starting-ruleflow-on-event-tp73368p73368.html
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 11 months
Inserting elements of a list into a session from a rule consequence
by Warren, David [USA]
I am trying to write a rule whose consequence loads several lists into the session. Each list contains a different type of class. What I would like to do (need to do as far as I can tell) is loop through the list and insert each element individually, rather than inserting the list as a whole. Is ther a way to do this in DRL?
Here is my example rule:
rule "Do we need to validate ONFI final action"
when
a : PackageMovementInfo( finalActionInd == "*", packageId == "AA")
b : SubmissionsInfoForRules(subId == a.subId, amendment == false, onfiAssignmentId != null)
then
insert( new RuleFlag("Validate ONFI final action") );
insert( onfiService.getONFIAssignment(b.getSubId()) );
insert( onfiService.getONFIReviewers(b.getOnfiAssignmentId()) );
insert( onfiService.getONFIAttachments(b.getOnfiAssignmentId()) );
end
The last two insert statements insert lists. A problem occurs in subsequent rules if I try to evaluate the contents of the lists. I've been getting a ClassCastException when lists are present for both the reviewers and attachments, because they are not the same class. Here is an example rule that causes a ClassCastException:
rule "Validate ONFI final action - code 666"
when
RuleFlag(value == "Validate ONFI final action")
a: PackageMovementInfo(actionCode == "666")
b: ONFIAssignmentInfo(reviewType == "ES", subId == a.subId)
$list : List( size > 0 )
ONFIReviewerInfo(notId == b.notId, revStatus == "CLO", reviewerRole == "PR") from $list
then
result.addMessage(a, "You can't do action code 666..." );
end
What I need to do is either (1) load each element of the lists individually, or (2) rewrite "$list : List (size > 0)" to only pick up lists of a particular class.
Is there a way to do either of these things from DRL? Or do I need to handle the loading outside of my rules (in the Java class that calls the rules).
Thank you,
David Warren
14 years, 11 months
rule on Array of custom Object
by stefano corna
hello,
im using drools 5.0 on eclipse and i have a problem. i want to use an array
of object in my rule condition.
now i try to explain:
i have my java class with the array attribute
-------------------------------------------------
public static class Message {
public numbers[] numbersArray;
}
--------------------------------------------
and the numbers class that rapresent the objects contained in numbersArray
----------------------------------------------
public static class numbers
{
public int first;
public int last;
}
--------------------------------------------------
my goal is make a rule that check if Message.numbersArray[0].first="value"
i use
-------------------------------------------------
rule "rule_001"
dialect "mvel"
when
$msg : Message(numbersArray[0].first=="1")
then
System.out.println("something....");
end
-------------------------------
and on runtime it give me this error:
---------------------------------------
org.drools.RuntimeDroolsException: Exception executing predicate
numbersArray[0].first=="1"
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:279)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:143)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:360)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:344)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)
at
org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:146)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1046)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1001)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:788)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:216)
at com.sample.DroolsTest.main(DroolsTest.java:47)
Caused by: [Error: unable to access property (null parent): first]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0]
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:861)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanProperty(ReflectiveAccessorOptimizer.java:585)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:313)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:138)
at
org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:133)
at
org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:102)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:107)
at org.mvel2.MVEL.executeExpression(MVEL.java:978)
at
org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:75)
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:272)
... 10 more
-------------------------------------------------------
moreover if i try to print the "first" value:
.
.
.
then
System.out.println(numbersArray[0].first);
end
appear this new error and i cant compile:
"BuildError: Unable to build expression for 'consequence': Failed to
compile: 1 compilation error(s):
- (1,12) unqualified type in strict mode for: numbersArray'
System.out.println(numbersArray[0].first);
'"
someone can kindly help me?
14 years, 11 months