New DSL question...Interpreting constants...
by Pegram, Macon
Given the following rules (contrived example):
rule "Monetary 1"
when
Currency(typeID in (CurrencyConst.DOLLAR,
CurrencyConst.EURO, CurrencyConst.YEN))
then
insert(new Fact());
end
rule "Monetary 2"
when
Currency(typeID in (CurrencyConst.RUBLES,
CurrencyConst.WON))
then
insert(new Fact());
end
Is it possible to map constant values into a DSL?
So the above rules could be partially rewritten as:
rule "Monetary 1"
when
Currency is one of DOLLAR, EURO, YEN
then
insert(new Fact());
end
rule "Monetary 2"
when
Currency is one of RUBLES, WON
then
insert(new Fact());
end
15 years, 1 month
Recommended permgen settings for Guvnor
by Clint Brown
Hi,
We're using Drools Guvnor 5.0.1 in a production environment, running on
Oracle's OAS10g 10.1.3.3.0 application server. We're experiencing permgen
issues, particularly when doing large imports of rules, archiving, or
compilation of rules.
We initially deployed to production with the following permgen settings:
-XX:MaxPermSize=128M -ms128M -mx256M
Following permgen exceptions, we increased the permgen to :
-XX:MaxPermSize=256M -ms128M -mx256M.
This sustained us for a while, but our assets are ever growing, and again
we're exceeding the permgen space allocated. Can someone recommend
appropriate setting, particularly if you are using Guvnor to this
capacity? Is there a close correlation to the number of assets within
Guvnor to the memory needed, so that we can project our future memory
requirements?
Assets in Guvnor:
~ 1000 rules in 5 decision tables (.xls) in 5 separate packages
~ 125 technical rules (drl)
~ 5 Guided editor rules
Thanks,
Clint
______________________________________________________________________________________
Clint Brown | Programmer Analyst II (Advisors) | o: 512.683.5232 | m:
512.736.6337
15 years, 1 month
DSL questions....
by Pegram, Macon
All,
Given the following rule:
rule "Add ABC123 Feature"
when
not MyFeature(testCD == "ABC123")
UserRequest(someValue == "ABC123_FEATURE")
$eligible : FeatureEligible(testCD == "ABC123")
then
insert(new MyFeature($eligible));
end
I'd like to create a DSL. Notice that "testCD" is the same value.
Is it possible to apply a value captured in a DSL and use it in more
than one condition? In the above scenario we want to see if the user
is eligible for the feature ABC123, and check whether or not that
feature has already been added in working memory.
The DSL version of the rule might look something like:
rule "Add ABC123 Feature"
when
User is eligible for "ABC123"
User requests "ABC123_FEATURE"
then
Add feature
end
Would I need to write the DSL for the "ABC123" piece like this?
[when]User is eligible for "{testCD}"=not MyFeature(testCD ==
"{testCD}") $eligible : FeatureEligible(testCD = "{testCD}")
Or will I always need to create 2 statements?
What are the performance implications of using a DSL? Is there extra
overhead at runtime or does all the interpretation occur at rule
compilation?
Thanks!
Macon
15 years, 1 month
Guvnor Cache Error with Seam
by Robert Morse
Not sure if this is a Seam or Drools issue, but....
Under Seam 2.2.0.GA, JBoss 5.1.0.GA, and Drools 5.0.1.GA and Guvnor,
changes to rules within Guvnor followed by a rule build within Guvnor
doesn't seem to be reflected back to Seam or the associated cache
directory.
Under Seam, I've defined one rule agent as:
<drools:rule-agent name="securityRules"
url="http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/cdms...
"
local-cache-dir="/usr/local/jboss/server/default/data/guvnor/cache/"
poll="30"/>
<drools:managed-working-memory
name="securityWorkingMemory" auto-create="true"
rule-base="#{securityRules}" />
Clearing the cache and starting up JBoss, everything works fine. If I
make a rule change in Guvnor, and rebuild the rules, I'll typically get:
08:34:24,343 ERROR [STDERR] RuleAgent(default) INFO (Thu Oct 22
08:34:24 MDT 2009): Applying changes to the rulebase.
08:34:24,343 ERROR [STDERR] RuleAgent(default) EXCEPTION (Thu Oct 22
08:34:24 MDT 2009): null. Stack trace should follow.
08:34:24,343 ERROR [STDERR] java.lang.NullPointerException
08:34:24,343 ERROR [STDERR] at
org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:235)
08:34:24,344 ERROR [STDERR] at
org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:366)
08:34:24,344 ERROR [STDERR] at
org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:712)
08:34:24,344 ERROR [STDERR] at
org.drools.common.AbstractRuleBase.removePackage(AbstractRuleBase.java:
640)
08:34:24,344 ERROR [STDERR] at
org.drools.agent.PackageProvider.removePackage(PackageProvider.java:44)
08:34:24,344 ERROR [STDERR] at
org.drools.agent.PackageProvider.applyChanges(PackageProvider.java:80)
08:34:24,344 ERROR [STDERR] at
org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:397)
08:34:24,344 ERROR [STDERR] at org.drools.agent.RuleAgent$2.run
(RuleAgent.java:516)
08:34:24,344 ERROR [STDERR] at java.util.TimerThread.mainLoop
(Timer.java:512)
08:34:24,344 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:
462)
The application will hang indefinitely when calling fireAllRules().
Restarting the server fixes the problem. If I never rebuild the
rules, or restart the server after rebuilding the rules, this problem
never surfaces.
Changing the poll value doesn't appear to alter anything.
The human mind is an iterative processor, it never does anything right
the first time. What it does well is to make improvements on every
iteration (deMarco)
15 years, 1 month
drools engine not working
by Hemanth kumar
hi,
Im working on Drools project.here is my project scenario.
front end : Adobe Flex 3.0 application
server : tomcat 6.x
Drools : 5.0
from flex application i was invoking java class which isin the server
"DroolsTest.java" .
In this i was dynamically creating a class ( Fact ) ,compiling it and
creating a rule ( a simple test rule).
To run the Rule i also created "StatefulKnowledgeSession" in that i added
facts from dynamically compiled class.
up to this point i was succeded.
now when i call ksession.fireAllRules() it is not displaying any message
from rule engine.i have done several trails and no luck...
Added the following JARS in WEB-INF\lib
antlr-runtime-3.1.1.jar
core-3.4.2.v_883_R34x.jar
drools-api-5.0.1.jar
drools-core-5.0.1.jar
drools-decisiontables-5.0.1.jar
mvel2-2.0.10.jar
drools-compiler-5.0.1.jar
xstream-1.3.1.jar
suggest me any ideas .
regards
Hemanth
--
View this message in context: http://www.nabble.com/drools-engine-not-working-tp25987317p25987317.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 1 month
Drools engine not working
by Hemanth kumar
hi,
Im working on Drools project.here is my project scenario.
front end : Adobe Flex 3.0 application
server : tomcat 6.x
Drools : 5.0
from flex application i was invoking java class which isin the server
"DroolsTest.java" .
In this i was dynamically creating a class ( Fact ) ,compiling it and
creating a rule ( a simple test rule).
To run the Rule i also created "StatefulKnowledgeSession" in that i added
facts from dynamically compiled class.
up to this point i was succeded.
now when i call ksession.fireAllRules() it is not displaying any message
from rule engine.i have done several trails and no luck...
Added the following JARS in WEB-INF\lib
antlr-runtime-3.1.1.jar
core-3.4.2.v_883_R34x.jar
drools-api-5.0.1.jar
drools-core-5.0.1.jar
drools-decisiontables-5.0.1.jar
mvel2-2.0.10.jar
drools-compiler-5.0.1.jar
xstream-1.3.1.jar
suggest me any ideas .
regards
Hemanth
--
View this message in context: http://www.nabble.com/Drools-engine-not-working-tp26004131p26004131.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 1 month
[droolsflow] JPAProcessInstanceManager - NullPointerException - part 2
by Bill Tarr
sorry, that email went of prematurely.
I am firing an event at a process created
session = JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase, null, env);
processInstance = session.startProcess(CLAIM_FLOW, parameterMap);
the process is fired, and this is the line which throws the NullPointerException:
process.signalEvent("DocReviewedEvent", null);
Here is my logging info:
Doc Reviewed Event id=16
Doc Reviewed Join id=17
Set Complete id=22
End id=3
java.lang.NullPointerException
So as you can see the process completed during the event.
at org.drools.persistence.processinstance.JPAProcessInstanceManager.removeProcessInstance(JPAProcessInstanceManager.java:82)
which is this line:
ProcessInstanceInfo processInstanceInfo = em.find( ProcessInstanceInfo.class,
processInstance.getId() );
It's actually the EntityManager which is returning null... I wonder why?
15 years, 1 month
[droolsflow] JPAProcessInstanceManager - NullPointerException
by Bill Tarr
I got this stack when firing an Event. The result of the event is that the process should be completed, details of Event below:
java.lang.NullPointerException
at org.drools.persistence.processinstance.JPAProcessInstanceManager.removeProcessInstance(JPAProcessInstanceManager.java:82)
at org.drools.common.AbstractWorkingMemory.removeProcessInstance(AbstractWorkingMemory.java:1724)
at org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.setState(WorkflowProcessInstanceImpl.java:186)
at org.drools.workflow.instance.node.EndNodeInstance.internalTrigger(EndNodeInstance.java:56)
at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:112)
at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:148)
at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:135)
at org.drools.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:62)
at org.drools.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:58)
at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:112)
at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:148)
at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:135)
at org.drools.workflow.instance.node.JoinInstance.triggerCompleted(JoinInstance.java:152)
at org.drools.workflow.instance.node.JoinInstance.internalTrigger(JoinInstance.java:65)
at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:112)
at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:148)
at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:135)
at org.drools.workflow.instance.node.EventNodeInstance.triggerCompleted(EventNodeInstance.java:70)
at org.drools.workflow.instance.node.EventNodeInstance.internalTrigger(EventNodeInstance.java:62)
at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:112)
at org.drools.workflow.instance.node.EventNodeInstance.signalEvent(EventNodeInstance.java:50)
at org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:272)
at com.csatp.svc.rulesmgr.claim.ClaimsDemoJpaTest.createNewSession(ClaimsDemoJpaTest.java:173)
I am firing an event at a process created in
15 years, 1 month