difference between context and kcontext
by Vikram Pancholi
Hi,
basic question in terms of rule flow whats the difference between kcontext
and context. If I set Variable to both using setVariable whats the
difference between the two.
Also whats the purpose of doing
update(context.getProcessInstance()) after we do changes to any fact in
the working in an action.
15 years, 5 months
Accumulate and Serializable
by Steve Ronderos
Hello,
I've been working on upgrading an application that uses Drools 4.0.7 to
5.0.1. For the most part things have been going well.
After I got the rules running with 5.0.1 I started getting a
ClassCastException on one of my model classes within the class
MVELAccumulatorFunctionExecutor. Here is the full stacktrace
org.drools.runtime.rule.ConsequenceException:
org.drools.RuntimeDroolsException: java.lang.ClassCastException:
com.example.Slot
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:945)
at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
at
org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1091)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:684)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:650)
at
com.example.StatefulDroolsRuleManager.execute(StatefulDroolsRuleManager.java:59)
at
com.example.common.TestMaxQuantity.multipleMaximum4Slot(TestMaxQuantity.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at
org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
Caused by: org.drools.RuntimeDroolsException:
java.lang.ClassCastException: com.example.Slot
at org.drools.rule.Accumulate.accumulate(Accumulate.java:172)
at
org.drools.reteoo.AccumulateNode.modifyTuple(AccumulateNode.java:432)
at
org.drools.reteoo.AccumulateNode.assertObject(AccumulateNode.java:284)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:360)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:344)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:147)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:360)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:337)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)
at
org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:146)
at
org.drools.common.AbstractWorkingMemory.modifyInsert(AbstractWorkingMemory.java:1365)
at
org.drools.base.DefaultKnowledgeHelper.modifyInsert(DefaultKnowledgeHelper.java:201)
at
org.drools.base.DefaultKnowledgeHelper.modifyInsert(DefaultKnowledgeHelper.java:195)
at
com.example.Rule_Update_Slot_s_valid_occupants_0.consequence(Rule_Update_Slot_s_valid_occupants_0.java:30)
at
com.example.Rule_Update_Slot_s_valid_occupants_0ConsequenceInvoker.evaluate(Rule_Update_Slot_s_valid_occupants_0ConsequenceInvoker.java:33)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:936)
... 34 more
Caused by: java.lang.ClassCastException: com.example.Slot
at
org.drools.base.accumulators.MVELAccumulatorFunctionExecutor.accumulate(MVELAccumulatorFunctionExecutor.java:125)
at org.drools.rule.Accumulate.accumulate(Accumulate.java:164)
... 49 more
I then downloaded the code to see what was going on and it looks like my
fact types are being cast to Serializable objects in the
MVELAccumulatorFunctionExecutor.accumulate method. I don't remember
reading anything about needing to make my model serializable, did I miss
some documentation somewhere?
Also, I found this JIRA request that looked related:
https://jira.jboss.org/jira/browse/JBRULES-2202
Any help would be greatly appreciated. Thanks!
Steve Ronderos
15 years, 5 months
Guvnor web based decision table
by Johan Kumps
Hi all,
I've a number of Excel based decision tables running in my applications. Now
I want to use Guvner to manage these rules. Only importing the xsl files is
not enough. So I have to manually convert the xsl's to a web based decision
table.
I have following questions :
- How do have have to use an eval condition? Whitin the eval I have to call
a piece of java code with a number of parameters coming from the fact model.
- How can I prioritize rules?
- How to use global variables?
Thanks for helping me out.
Kind regards,
Johan Kumps
15 years, 5 months
Re: Drools Guvnor integration with MySql
by Pardeep.Ruhil@lntinfotech.com
Thanks Jarek
Succesfully integrated MySql with Drools Guvnor.
Thanks again.
http://blog.athico.com/2008/08/tuning-guvnor.html
http://jackrabbit.apache.org/jackrabbit-configuration.html
Cheers,
Jarek
Pardeep.Ruhil(a)lntinfotech.com wrote:
>
> Hi,
>
> I want to integrate the Drools Govnor with extenal Database (MySql).
> Can anyone help me how can i do the settings to connect to the extenal
> database.
>
> Thanks & Regards
>
> Pardeep Ruhil
Thanks & Regards
Pardeep Ruhil
L&T Infotech Ltd
Mumbai
Ph: +919820283884
Larsen & Toubro Infotech Ltd.
www.Lntinfotech.com
This Document is classified as:
L&T Infotech Proprietary L&T Infotech Confidential L&T Infotech
Internal Use Only L&T Infotech General Business
This Email may contain confidential or privileged information for the
intended recipient (s) If you are not the intended recipient, please do
not use or disseminate the information, notify the sender and delete it
from your system.
______________________________________________________________________
15 years, 5 months
Re: [rules-users] Comparing multiple accumulations
by Richard Sherman
Thanks Wolfgang,
Here's the extra information as requested.
Firstly the When creating the email I was removing all references to rent and missed one hence RentTransaction should read Transaction. I've also noticed that the sum($value) in the third accumulation should read sum(-$value).
Below is a typical set of Transactions that should cause a message to occur.
Account :
accountBalanceInPence : 70000
transactions :
- transactionDate : 2009/07/10
amountInPence : 50000
transactionCode : charge
- transactionDate : 2009/07/12
amountInPence : 45000
transactionCode : Type 1
Below is a similar set of Transactions that shouldn't cause a message to occur.
Account :
accountBalanceInPence : 70000
transactions :
- transactionDate : 2009/07/10
amountInPence : 50000
transactionCode : charge
- transactionDate : 2009/07/12
amountInPence : 45000
transactionCode : Type 1
- transactionDate : 2009/07/13
amountInPence : 5000
transactionCode : Type 2
Thanks
Richard
>From: wolfgang.laun(a)gmail.com
>To: rules-users(a)lists.jboss.org
>Date: Tue, 14 Jul 2009 12:43:40 +0200
>Subject: Re: [rules-users] Comparing multiple accumulations
>
>You'll have to provide one full set of $acc.transaction values
>(indicating class and relevant field values) where you think the rule
>should fire, but doesnt, for people to be able to check what's going
>on.
>
>Also, it is necessary to know how the types of Account.transactions
>(List<???>), Transaction and RentTransaction are related.
>
>-W
>
>On 7/14/09, Richard Sherman <rsherman315(a)hotmail.com> wrote:
>> First I'm new to drools and secondly where I'm working we're using version
>> 4.0.7.
>>
>> I have a list of accounts and each account contains a list of transactions.
>> I wish to accumulate charge transactions and compare them to an accumulation
>> of payment transactions for a given time period (such as the last month).
>> And it gets slightly more awkward in that if a payment transaction is of a
>> certain type it needs to be converted from a 4 weekly figure to a monthly
>> figure ( using / 4 / 7 * 365 / 12). I've tried to use structures as follows
>> but they are causing the then part of the rule never to fire.
>>
>> rule "Account in arrears"
>> salience 10
>> no-loop
>> when
>> $acc : Account( // balance between £500 and £1000
>> accountBalanceInPence >= 50000 &&
>> accountBalanceInPence <= 100000
>> )
>>
>> $s : MessageInfo( accountNumber == $acc.accountNumber )
>>
>> Number($charges : intValue) from
>> accumulate(
>> (Transaction(
>> transactionDate > oneMonthAgo &&
>> amountInPence > 0 &&
>> $value : amountInPence)
>> from $acc.transactions),
>> sum($value)
>> )
>>
>> Number($adjustment : intValue) from
>> accumulate(
>> (Transaction(
>> transactionDate > oneMonthAgo &&
>> amountInPence < 0 &&
>> transactionCode == "Type 1" &&
>> $value : amountInPence)
>> from $acc.transactions),
>> sum(($value / 4 / 7 * 365 / 12) - $value)
>> )
>>
>>
>> Number( intValue > ($charges + $adjustment)) from
>> accumulate(
>> (RentTransaction
>> (transactionDate > oneMonthAgo
>> $value : amountInPence)
>> from $acc.transactions),
>> sum($value)
>> )
>>
>> then
>> $s.setMessage( "Account in arrears" );
>> update($s); // flag update
>> end
>>
>> Thanks
>> Richard
>>
>> ________________________________
>> Beyond Hotmail - see what else you can do with Windows Live. Find out more.
>> _______________________________________________
>> rules-users mailing list
>> rules-users(a)lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
_________________________________________________________________
Share your photos with Windows Live Photos – Free.
http://clk.atdmt.com/UKM/go/134665338/direct/01/
15 years, 5 months
Guvnor deployment pattern
by rviswanathan
Hi,
I would like to understand the deployment pattern supported by Guvnor.
Everytime when I add the rules or model objects on Guvnor those files are
checked in on SVN repository.
1.) Where exactly those files are stored?
2.) In case of SVN, Which SVN repository (What’s the URL)?
3.) Is it possible to define the list of rules on Guvnor & use those rules
across the application wherever drools-guvnor.war is deployed? If so, what
all steps need to be followed?
Thanks,
Ram
--
View this message in context: http://www.nabble.com/Guvnor-deployment-pattern-tp24492959p24492959.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 5 months
role based authentication in tomcat
by VÅM§Ï ®
Hi,
I configured my guvnor in tomcat 6.0.It is working fine with out any user
name validation.now i just want to create a role and give permission to that
role.
In the components.xml i have changed like the below configuration
<security:role-based-permission-resolver
enable-role-based-authorization="true"/>
<security:identity authenticate-method="#{authenticator.authenticate}"
jaas-config-name="brms"/>
now where i need to create a role with that name "brms" and where i need
mention the username and password.
i tried in the tomcat-users.xml but it is not working.
could anyone please help me..
regards,
Vamsi Krishna.Kavuri.
<http://www.brainyquote.com/quotes/authors/g/gilda_radner.html>
15 years, 5 months
Drools Guvnor integration with MySql
by Pardeep.Ruhil@lntinfotech.com
Hi,
I want to integrate the Drools Govnor with extenal Database (MySql).
Can anyone help me how can i do the settings to connect to the extenal
database.
Thanks & Regards
Pardeep Ruhil
L&T Infotech Ltd
Mumbai
Ph: +919820283884
Larsen & Toubro Infotech Ltd.
www.Lntinfotech.com
This Document is classified as:
L&T Infotech Proprietary L&T Infotech Confidential L&T Infotech
Internal Use Only L&T Infotech General Business
This Email may contain confidential or privileged information for the
intended recipient (s) If you are not the intended recipient, please do
not use or disseminate the information, notify the sender and delete it
from your system.
______________________________________________________________________
15 years, 5 months
Default Sequential Mode Order in Decision Table
by bhavesh devashraye
As per the JBoss Project Documentation it is clear that if we set SEQUENTIAL = true then it will going to execute rules in Top to Down order but what if we make this flag false and even not set this field at all?
if SEQUENTIAL = false. Will it confirm Bottom to Top order of execution?
I have observed that if not set this SEQUENTIAL flag, by default rules get executed Bottom to Top order. Does this assumption is correct? Does JBoss always execute rules from Bottom to Top order if we not set this flag ( SEQUENTIAL ) ?
-Orbit007in
15 years, 5 months
drools 5 custom evalautor
by Asif Iqbal
Hi,
Im new to drools and am trying to implement the following, and really need to override the evaluator '>' and '<' for strings... Can someone please show me how to do this?
SomeClass(version > "02.00.01" && version < "02.00.20")
regards
I
15 years, 5 months