Re: [rules-users] How to create nested rules in Drool Guvnor
by malkhafaji
Marc Dzaebel wrote:
>
> Correction: extends works but is obviously undocumented. It adds the when
> part of the extended rule.
>
Is the support for this keyword removed from the current version (in trunk)?
This is the first time I am trying to use 'extends' in my rules but I cannot
find ANYTHING in the documentation about it, and I have spent at least an
hour searching this forum about it and it seems like everybody is saying
that it should work to just do:
rule "Rule 2"
when
blah
then
blah
end
rule "Rule 1" extends "Rule 2"
when
blah
then
blah
end
But eclipse does not recognize "extends" as a valid keyword. Am I missing
something?
--
View this message in context: http://n3.nabble.com/How-to-create-nested-rules-in-Drool-Guvnor-tp61446p1...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 11 months
Planner/solver - POSITIVE scoring...
by Michael Neale
Hi All - FYI I have been conversing with Geoffrey on basic
solver/planner usage questions, but we are bring the discussion here
in case others can benefit.
So I am looking at using IntConstraintOccurrence, for scoring with
weights, and HardAndSoftConstraintScoreCalculator. So I can see how
NEGATIVE_HARD and NEGATIVE_SOFT scores would work, with appropriate
accumulator rules doing that etc.
What I am not sure about is ConstraintType.POSITIVE - so I want to use
that to "favour" certain aspects of a solution. So would the correct
way to use that to be to have rules that use a positive
IntConstrainOccurrence, and then do something like:
when
$softTotal : Number() from accumulate(
IntConstraintOccurrence(constraintType ==
ConstraintType.NEGATIVE_SOFT, $weight : weight),
sum($weight) // Vote for
http://jira.jboss.com/jira/browse/JBRULES-1075
);
$positiveTotal: Number() from accumulate(
IntConstraintOccurrence(constraintType ==
ConstraintType.POSITIVE, $weight : weight),
sum($weight) // Vote for
http://jira.jboss.com/jira/browse/JBRULES-1075
);
then
scoreCalculator.setSoftConstraintsBroken($softTotal.intValue()
- $positiveTotal.intValue());
?? it seems odd - I want to use POSITIVE but I am using it to reduce
the soft constraints broken? The the higher the positive score, the
less softConstraintsBroken property of the score calculator is set -
that seems odd... or should I not use HardAndSoft if I am using
POSITIVE and NEGATIVE scoring?
--
Michael D Neale
home: www.michaelneale.net
blog: michaelneale.blogspot.com
14 years, 11 months
doubt in using collections and nested objects
by Sudhir M
Hi All,
I have a scenario which is similar to the one detailed below
There is a class Student and each students has a list of subjects.
Each subject has a name and a flag which is an indicator of pass or
failure.
Now how can I write a rule which tells me if there are atleast 10
students who failed in a subject maths.
Thanks
sudhir.
14 years, 11 months
eval in lhs
by HonorGod
Can i have the following as one of my conditions in decision table ?
eval(convertYesOrNo("$param").equals(myObject.getFlag()))
where convertYesOrNo() is a function inside decision table.
I get the following error -
Exception e org.drools.RuntimeDroolsException: Exception executing predicate
com.barcap.efg.fine.drools.dataobject.Rule_Corporate_Action_12_0Predicate0Invoker@490d7410
org.drools.RuntimeDroolsException: Exception executing predicate
com.barcap.efg.fine.drools.dataobject.Rule_Corporate_Action_12_0Predicate0Invoker@490d7410
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
Thanks.
--
View this message in context: http://n3.nabble.com/eval-in-lhs-tp112964p112964.html
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 11 months
Hashmap in rules
by Da Sun
I got a CompileException when run the following rule.
when
bioAnswers:HashMap(bioAnswers.values["HEARING"] == "Y")
reviewMsgs:LinkedList(size >= 0)
then
reviewMsgs.add("Hearing");
It will be very helpful is anyone of you rectify my mistake.
Thanks,
_________________________________________________________________
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
http://clk.atdmt.com/GBL/go/196390709/direct/01/
14 years, 11 months
Re: [rules-users] rules-users Digest, Vol 38, Issue 10
by Agrawal, Swapnil
Thanks Thomas.
I think it is related to proxy.
I was able to get past that issue on my personal machine ... Though I have other issues which I am trying to resolve.
Thanks
Swapnil Agrawal
desk: (212)-816-7024
cell: (201)-616-1189
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of rules-users-request(a)lists.jboss.org
Sent: Wednesday, January 06, 2010 5:04 AM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 38, Issue 10
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of rules-users digest..."
Today's Topics:
1. Re: compiling DROOLS 5 (Swindells, Thomas)
2. Drools Flow with RuleSet node suppresses exceptions (vasilievip)
3. Re: Drools Guvnor installation on weblogic (Swindells, Thomas)
----------------------------------------------------------------------
Message: 1
Date: Wed, 6 Jan 2010 09:57:57 +0000
From: "Swindells, Thomas" <TSwindells(a)nds.com>
Subject: Re: [rules-users] compiling DROOLS 5
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<DAC86F5F3B84F14088F0DB16092558CA05F903FF90(a)UKMA1.UK.NDS.COM>
Content-Type: text/plain; charset="us-ascii"
This looks to be a maven issue.
The most likely cause is probably that your networks proxy hasn't been configured properly in your maven settings.xml file, alternatively your proxy may be blocking the downloads or you were just unlucky and the site was down!
Thomas
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Agrawal, Swapnil
Sent: 05 January 2010 19:53
To: 'rules-users(a)lists.jboss.org'
Subject: [rules-users] compiling DROOLS 5
Hi
I downloaded the Drools 5 source code from the website.
I am trying to compile it and see following errors:
[WARNING] Unable to get resource 'org.apache.maven.wagon:wagon-webdav:pom:1.0-be
ta-2' from repository repository.jboss.org (http://repository.jboss.org/maven2):
Error transferring file: repository.jboss.org
.
.
(bunch of such warnings)
.
.
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) org.codehaus.plexus:plexus-utils:jar:1.1
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.codehaus.plexus -DartifactId=plexus -utils -Dversion=1.1 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.codehaus.plexus -DartifactId=plexus-u tils -Dversion=1.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -Drepository Id=[id]
Path to dependency:
1) org.drools:drools:pom:5.0.1
2) org.codehaus.plexus:plexus-utils:jar:1.1
2) org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.apache.maven.wagon -DartifactId=wag on-webdav -Dversion=1.0-beta-2 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.apache.maven.wagon -DartifactId=wagon -webdav -Dversion=1.0-beta-2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -D repositoryId=[id]
Path to dependency:
1) org.drools:drools:pom:5.0.1
2) org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2
Thanks
Swapnil
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
________________________________
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes.
To protect the environment please do not print this e-mail unless necessary.
An NDS Group Limited company. www.nds.com
14 years, 11 months
Drools Guvnor installation on weblogic
by Nilima R
Hi All,
I am trying to install Drools Guvnor on weblogic 10 .I have added the
Guvnor WAR file and dependent jars from Drools binaries download.
However I am getting error for datasource configuration. Do we need to
configure any datasource?
Please find error logs below
<Error> <Deployer> <BEA-149265> <Failure occurred in the execution of
deployment request with ID '1262262938099' for task '1'. Error is:
'weblogic.application.ModuleException: '
weblogic.application.ModuleException:
at
weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:317)
at
weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
at
weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at
weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:360)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
Truncated. see log file for complete stacktrace
weblogic.deployment.EnvironmentException: Error processing persitence unit
org.drools.persistence.jpa of module drools_guvnor.war: Error looking up a
DataSource for PersistenceUnit org.drools.persistence.jpa:
javax.naming.NameNotFoundException: While trying to lookup 'jdbc.testDS1'
didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/testDS1'
at
weblogic.deployment.PersistenceUnitInfoImpl.lookUpDataSources(PersistenceUnitInfoImpl.java:126)
at
weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:105)
at
weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:316)
at
weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:96)
at
weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:53)
Truncated. see log file for complete stacktrace
>
<Dec 31, 2009 6:05:52 PM IST> <Warning> <Deployer> <BEA-149004> <Failures
were detected while initiating distribute task for application
'drools_guvnor'.>
<Dec 31, 2009 6:05:52 PM IST> <Warning> <Deployer> <BEA-149078> <Stack
trace for message 149004
weblogic.application.ModuleException:
at
weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:317)
at
weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
at
weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at
weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:360)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
Truncated. see log file for complete stacktrace
weblogic.deployment.EnvironmentException: Error processing persitence unit
org.drools.persistence.jpa of module drools_guvnor.war: Error looking up a
DataSource for PersistenceUnit org.drools.persistence.jpa:
javax.naming.NameNotFoundException: While trying to lookup 'jdbc.testDS1'
didn't find subco
ntext 'jdbc'. Resolved ''; remaining name 'jdbc/testDS1'
at
weblogic.deployment.PersistenceUnitInfoImpl.lookUpDataSources(PersistenceUnitInfoImpl.java:126)
at
weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:105)
at
weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:316)
at
weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:96)
at
weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:53)
Truncated. see log file for complete stacktrace
>
<Dec 31, 2009 6:05:52 PM IST> <Error> <Console> <BEA-240003> <Console
encountered the following error weblogic.application.ModuleException:
at
weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:317)
at
weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
at
weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at
weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:360)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at
weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:56)
at
weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:46)
at
weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at
weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
at
weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:147)
at
weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:61)
at
weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:189)
at
weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:87)
at
weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
at
weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:719)
at
weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1186)
at
weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
at
weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:157)
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
at
weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:464)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
Caused by: weblogic.deployment.EnvironmentException: Error processing
persitence unit org.drools.persistence.jpa of module drools_guvnor.war:
Error looking up a DataSource for PersistenceUnit
org.drools.persistence.jpa: javax.naming.NameNotFoundException: While
trying to lookup 'jdbc.testDS1' didn't
find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/testDS1'
at
weblogic.deployment.PersistenceUnitInfoImpl.lookUpDataSources(PersistenceUnitInfoImpl.java:126)
at
weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:105)
at
weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:316)
at
weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:96)
at
weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:53)
at
weblogic.servlet.internal.WebAppModule.initPURegistry(WebAppModule.java:1176)
at
weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:307)
>
Regards,
Nilima Rajendra Raichandani
Sub Focus Area Lead - BPM/BAM/BRE
TEG - Open Source Platform
Tata Consultancy Services
Ph:- +91 22 6778 2027
Cell:- 9322108518
Mailto: nilima.r(a)tcs.com
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
14 years, 11 months