looking for more information on drools expert
by Gab Aldian
Hi everybody
I have read with attention the drools expert documentation, which was
very interesting, but a little 'too simple". For example, most
examples don't present rules with the keyword "forall". I also met big
difficulties mixing the references on the objects to my javacode. This
is why I would need some more documentation with examples that go
deeper into drools capacities.
To give you clues about my plan, here is an example (which works
perfectly in drools 5) that I have developed:
java code - http://drools.pastebin.com/m1a705614
rule code - http://drools.pastebin.com/m3f30cbdc
As you can see I am studying the case where drools is used for the
monitoring of a network of equipments that send alarms about their
problems. But I have big difficulties, because I would like to get
references on the objects of the "forall", and to execute javacode
such as $toto.method($titi, $tata), but such things seems impossible
(systematic failed of compilation)
Could you please help me?
Thank you very much!
Aldian
16 years, 7 months
Updating a Boolean object in the WM
by skasab2s
Hi guys,
I've been desperately trying to update a Boolean object, which is in the
working memory.
I have an initial rule that first inserts it:
rule "Insert initial weanable value" salience 100
when
then
Boolean $weanable = false;
insert($weanable);
end
and then I try to update it:
...
when
$weanable: Boolean( )
...
then
$weanable=true;
update($weanable);
end
Which results to this exception : org.drools.FactException: Update error:
handle not found for object: true. Is it in the working memory?
I checked in the working memory and the Boolean-object was there!
Is it possible to update a boolean that is in the working memory? If not, do
you know some other Java class with setters and getters (behaving as a
drools-fact) that I don't have to create myself and which I can use instead
of Bboolean for this case ?
Thanks in advance!
Svetlomir
--
View this message in context: http://www.nabble.com/Updating-a-Boolean-object-in-the-WM-tp24513225p2451...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 7 months
OFBiz entity engine compatibility with Jackrabbit
by Pardeep.Ruhil@lntinfotech.com
Hi,
I am using apache OFBiz which uses Entity engine as a persistence layer.
To know more about Entity engine refer this link
http://ofbiz.apache.org/docs/entity.html
Drools Guvnor uses Jackrabbit as a persistence layaer.
So my question is there a way i can use OFbiz entity engine persistence
layer in Drools guvnor in place of
Jackrabbit.
Is it feasible to do this and if possible how much effort is needed?
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.
______________________________________________________________________
16 years, 7 months
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.
16 years, 7 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
16 years, 7 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
16 years, 7 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.
______________________________________________________________________
16 years, 7 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/
16 years, 7 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.
16 years, 7 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>
16 years, 7 months