ClassCastException in SessionConfiguration.initProcessInstanceManagerFactory on JBoss 6.0
by Massudi
I’m trying to create StatefulKnowledgeSession:
StatefulKnowledgeSession ksession =
JPAKnowledgeService.newStatefulKnowledgeSession(
kbase, null, env);
Here is the problem as it seen in the log:
15:39:05,884 ERROR [STDERR] Caused by: java.lang.IllegalArgumentException:
Unable to instantiate process instance manager factory
'org.drools.persistence.processinstance.JPAProcessInstanceManagerFactory'
15:39:05,884 ERROR [STDERR] at
org.drools.SessionConfiguration.initProcessInstanceManagerFactory(SessionConfiguration.java:317)
15:39:05,884 ERROR [STDERR] at
org.drools.SessionConfiguration.getProcessInstanceManagerFactory(SessionConfiguration.java:291)
15:39:05,884 ERROR [STDERR] at
org.drools.common.AbstractWorkingMemory.<init>(AbstractWorkingMemory.java:367)
15:39:05,884 ERROR [STDERR] at
org.drools.common.AbstractWorkingMemory.<init>(AbstractWorkingMemory.java:295)
15:39:05,884 ERROR [STDERR] at
org.drools.common.AbstractWorkingMemory.<init>(AbstractWorkingMemory.java:259)
15:39:05,884 ERROR [STDERR] at
org.drools.reteoo.ReteooWorkingMemory.<init>(ReteooWorkingMemory.java:96)
15:39:05,885 ERROR [STDERR] at
org.drools.reteoo.ReteooStatefulSession.<init>(ReteooStatefulSession.java:80)
15:39:05,885 ERROR [STDERR] at
org.drools.reteoo.ReteooRuleBase.newStatefulSession(ReteooRuleBase.java:386)
15:39:05,885 ERROR [STDERR] at
org.drools.reteoo.ReteooRuleBase.newStatefulSession(ReteooRuleBase.java:371)
15:39:05,885 ERROR [STDERR] at
org.drools.persistence.session.SingleSessionCommandService.<init>(SingleSessionCommandService.java:97)
Exception is thrown from here:
private void initProcessInstanceManagerFactory() {
...
if ( clazz != null ) {
try {
this.processInstanceManagerFactory = clazz.newInstance();
} catch ( Exception e ) {
throw new IllegalArgumentException( "Unable to instantiate
process instance manager factory '" + className + "'" );
}
...
}
And the actual Exception type is ClassCastException
java.lang.ClassCastException:
org.drools.persistence.processinstance.JPAProcessInstanceManagerFactory
cannot be cast to org.drools.process.instance.ProcessInstanceManagerFactory
I’ve created the following snippet to illustrate the problem:
…running inside JTA transaction
Class<ProcessInstanceManagerFactory> cls =
(Class<ProcessInstanceManagerFactory>)
Class.forName("org.drools.persistence.processinstance.JPAProcessInstanceManagerFactory");
// this one is OK
ProcessInstanceManagerFactory pimf =
(ProcessInstanceManagerFactory)cls.newInstance();
System.out.println(pimf.getClass().getCanonicalName());
cls =
(Class<ProcessInstanceManagerFactory>)Thread.currentThread().getContextClassLoader().loadClass("org.drools.persistence.processinstance.JPAProcessInstanceManagerFactory"
);
// here will be ClassCastException
pimf = (ProcessInstanceManagerFactory)cls.newInstance();
System.out.println(pimf.getClass().getCanonicalName());
It seems that ProcessInstanceManagerFactory interface and
JPAProcessInstanceManagerFactory are loaded by different class loaders.
How can I avoid that problem?
I'm using Drool Flow 5.1.1, JBoss 6.0, Hibernate 3.6.0.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/ClassCastException-in...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 11 months
Re: [rules-users] Possible to enforce a unique salience?
by Tihomir Surdilovic
Nothing out-of-the-box afaik.
Take a look at dynamic salience expressions -
http://blog.athico.com/2007/05/dynamic-salience-expressions.html
Also note that dynamic salience can also be determined with a function
call, for example:
package com.sample
public class MyClass {
...
public static int uniqueSalience(String ruleflowGroup) {
// return and maintain unique salience contract ..implement
yourself
}
...
}
and in your drl for example:
package com.sample
import function com.sample.MyClass.uniqueSalience;
rule "testrule"
ruleflow-group "abc"
salience (uniqueSalience("abc"))
when
...
then
...
end
Hope this helps some.
Thanks.
Tihomir
> Is it possible in Drools to enforce a unique salience?
>
> Ideally this would be done at the point of entering a new rule.
>
> For example, if a rule existed with salience of 17 and a user tried to
> add a
> new rule of salience 17, an error message would be generated saying
> 'salience level already in use'.
>
> Even better would be the ability to enforce a unique salience for rules
> belonging to a particular ruleflow-group.
>
> The reason for wanting to achieve this is to prevent indeterminate
> behaviour
> when two or more rules exist with the same salience level.
>
> Any help would be much appreciated.
>
> Regards,
>
> Barnaby
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Possible-to-enforce-a...
> Sent from the Drools - User mailing list archive at Nabble.com
> <http://Nabble.com>.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org <mailto:rules-users@lists.jboss.org>
> https://lists.jboss.org/mailman/listinfo/rules-users
13 years, 11 months
Drools Flow Fluent API Help
by Dan Nathanson
Hi,
I've been banging my head against this for days and just can't get it
to work. At this point I'd like to just get the example code working.
I've got a simple class that is currently being driven by a JUnit
test case. I just want to create a Process flow and execute it. I
don't care what it does at this point. Hello world level stuff.
My method under test:
public String runFlow() throws Exception {
RuleFlowProcessFactory factory
= RuleFlowProcessFactory.createProcess("org.drools.process");
factory
// header
.name("My process").packageName("org.drools")
// nodes
.startNode(1).name("Start").done()
.actionNode(2).name("Action")
.action("java", "System.out.println(\"Hello
World\");").done()
.endNode(3).name("End").done()
// connections
.connection(1, 2)
.connection(2, 3);
RuleFlowProcess process = factory.validate().getProcess();
KnowledgeBase knowledgeBase =
KnowledgeBaseFactory.newKnowledgeBase();
KnowledgeBuilder builder =
KnowledgeBuilderFactory.newKnowledgeBuilder(knowledgeBase);
Package pkg = new Package("package1");
pkg.addProcess(process);
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(pkg);
Collection<KnowledgePackage> kpackages =
builder.getKnowledgePackages();
KnowledgePackage kpackage = new KnowledgePackageImp(pkg);
kpackages.add(kpackage);
knowledgeBase.addKnowledgePackages(kpackages);
StatefulKnowledgeSession ksession =
knowledgeBase.newStatefulKnowledgeSession();
KnowledgeRuntimeLogger logger =
KnowledgeRuntimeLoggerFactory.newConsoleLogger(ksession);
ksession.startProcess("org.drools.process");
return "foo";
}
When I run this process, I get an exception when the Action node is
run. It is a NPE and it happens because the metaData map in the
underlying ActionNode does not contain a KVP for "Action". It looks
like that KVP is added in in the DroolsAction class when the public
void wire(Object object) method is called. Unfortunately, I can't
figure out what causes that method to be called. I'm pretty sure my
problem is with the set up of my knowledge base (the call to new
KnowledgePackageImp() is suspect), but I can't figure out how to set
up the knowledge base when building a RuleFlowProcess using the
RuleFlowProcessFactory. None of the examples I can find show how to
do this.
Note that if I take out the Action node and just have Start and End
nodes, it works fine.
I am using Drools 5.1.0, but it doesn't work with Drools 5.0.1 either.
Any help would be appreciated. The flat spot on my forehead is
getting flatter every day I continue to bang my head against the wall.
Here's the output (including KnowledgeRuntimeLogger output):
BEFORE RULEFLOW STARTED process:My process[id=org.drools.process]
BEFORE RULEFLOW NODE TRIGGERED node:Start[id=1] process:My
process[id=org.drools.process]
null process:My process[id=org.drools.process]
BEFORE RULEFLOW NODE TRIGGERED node:Action[id=2] process:My
process[id=org.drools.process]
java.lang.RuntimeException: unable to execute Action
at
org.drools.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:56)
at
org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:117)
at
org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:178)
at
org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:144)
at
org.drools.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)
at
org.drools.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)
at
org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:117)
at
org.drools.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:32)
at
org.drools.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:192)
at
org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:309)
at
org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1644)
at
org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1622)
at
org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:301)
at
com.proferi.epm.process.DroolsFlowManager.runFlow(DroolsFlowManager.java:75)
at
com.proferi.epm.process.DroolsFlowManagerTest.testRunFlow(DroolsFlowManagerTest.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
at
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
at
org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
at
org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
at
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at org.junit.runner.JUnitCore.run(JUnitCore.java:130)
at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:64)
Caused by: java.lang.NullPointerException
at
org.drools.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:54)
... 34 more
Regards,
Dan Nathanson
13 years, 11 months
Re: [rules-users] StreamCorruptedException - invalid stream
by John Peterson
A little more information:
- Prior to upgrading the drools-guvnor.war file on the server to 5.1.1
and my local eclipse install of Drools to 5.1.1, I had successfully run
from my eclipse to the server many times (using version 5.0.1 on both).
- I'm unable to access or utilize the old packages created prior to the
upgrade to 5.1.1 (see rules-users Digest vol.49, issue 61 from 12/23 -
"message 6" attached below)
- I CAN run the application locally, using the Guvnor 5.1.1 standalone
installed on my computer. This makes me think something is out of synch
with the server and my computer.
>----------------------------------------------------------------------
>
>Message: 1
>Date: Mon, 27 Dec 2010 09:05:50 -0700
>From: "John Peterson" <john.peterson.gv3k(a)statefarm.com>
>Subject: [rules-users] StreamCorruptedException - invalid stream
>To: <rules-users(a)lists.jboss.org>
>Message-ID:
>
<D3A6E68928C9104BB815C83F43A36BDF0F0C6446(a)WPSCV6NH.OPR.STATEFARM.ORG>
>Content-Type: text/plain; charset="US-ASCII"
>
>Workstation Version (windows): 1.6.0_17
>Server Version (linux): 1.6.0 (build 1.6.0-b09)
>
>Are you using the same JVM version in both machines?
>Greetings
>
>2010/12/27 John Peterson <john.peterson.gv3k(a)statefarm.com>
>
> Hi,
>
> I?m experiencing an interesting issue with Drools/Guvnor. I am
> running Drools 5.1.1 on my workstation and the Guvnor 5.1.1 standalone
locally.
> When I run it locally, it works fine. The server installation of
> JBoss AS was downloaded and installed at the same time as Drools
5.1.1.
>
> When I try to run it connecting to the remote server (on Linux), I get
> the following error:
>
> [2010:12:361 09:12:910:debug] KnowledgeAgent rebuilding KnowledgeBase
> using ChangeSet
>
> [2010:12:361 09:12:972:exception]
>
> ***java.lang.RuntimeException*: KnowledgeAgent exception while trying
> to deserialize KnowledgeDefinitionsPackage
>
> at
> org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(***
> KnowledgeAgentImpl.java:664*)
>
> at
> org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(*
> **
> KnowledgeAgentImpl.java:889*)
>
> at
> org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(***
> KnowledgeAgentImpl.java:704*)
>
> at
> org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(***
> KnowledgeAgentImpl.java:584*)
>
> at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(***
> KnowledgeAgentImpl.java:185*)
>
> at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(***
> KnowledgeAgentImpl.java:168*)
>
> at
> com.agencyawards2.RuleSessionProviderFactory.getSessionFactory(
> ***RuleSessionProviderFactory.java:95*)
>
> at
> com.agencyawards2.RuleSessionProviderFactory.getProvider(***
> RuleSessionProviderFactory.java:35*)
>
> at com.agencyawards2.RunRules.runRules(***RunRules.java:27*)
>
> at com.agencyawards2.DroolsTest.main(***DroolsTest.java:40*)
>
> Caused by:*** java.io.StreamCorruptedException*: invalid stream
header:
> 7061636B
>
> at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
>
> at java.io.ObjectInputStream.<init>(Unknown Source)
>
> at org.drools.common.DroolsObjectInputStream.<init>(***
> DroolsObjectInputStream.java:71*)
>
> at org.drools.core.util.DroolsStreamUtils.streamIn(***
> DroolsStreamUtils.java:205*)
>
> at org.drools.core.util.DroolsStreamUtils.streamIn(***
> DroolsStreamUtils.java:174*)
>
> at
> org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(***
> KnowledgeAgentImpl.java:653*)
>
> ... 9 more
>
> [2010:12:361 09:12:03:debug] KnowledgeAgent obtaining pkg
> resource=[UrlResource path='file:src/main/rules/ruleflow.rf']
>
> The only thing I can think of that is different is that I recently
> upgraded my Guvnor 5.0.1 to 5.1.1 on the Server. I did this by
> replacing the drools-guvnor.war with the newer version. Did that
> create some sort of compatibility between my local 5.1.1 installation
> and the server installation of 5.1.1 on top of the old 5.0.1?
>
> Thanks,
>
> John
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>Message: 6
>Date: Thu, 23 Dec 2010 08:51:24 -0700
>From: "John Peterson" <john.peterson.gv3k(a)statefarm.com>
>Subject: [rules-users] Unable to validate package configuration (eg,
> DSLs, models) for [package name]
>To: <rules-users(a)lists.jboss.org>
>Message-ID:
>
<D3A6E68928C9104BB815C83F43A36BDF0F0C5F61(a)WPSCV6NH.OPR.STATEFARM.ORG>
>Content-Type: text/plain; charset="us-ascii"
>
>Hi,
>
>We recently upgraded from Drools/Guvnor 5.0.1 to 5.1.1 (early
December).
>We had an existing package we had developed in 5.0.1 that we had not
done much with since the upgrade. This morning, we tried to open one of
the rules in that package and we get the following messages:
>
>Unable to validate package configuration (eg, DSLs, models) for
[package name]. Suggestion completions may not operate correctly for
graphical editors for this package.
>
>Unable to get content assistance for this rule.
>
>Unable to get content assistance for this rule.
>
>
>I've tried to re-upload the 3 jar files (I saw this post as a possible
>solution: http://comments.gmane.org/gmane.comp.java.drools.user/23407),
>but I get "Unable to upload the file". New packages seem to be okay
(e.g. packages created since the upgrade). Does anyone have any
thoughts on what's going on here?
>
>Thanks.
13 years, 11 months
StreamCorruptedException - invalid stream
by John Peterson
Workstation Version (windows): 1.6.0_17
Server Version (linux): 1.6.0 (build 1.6.0-b09)
>Are you using the same JVM version in both machines?
>Greetings
>
>2010/12/27 John Peterson <john.peterson.gv3k(a)statefarm.com>
>
> Hi,
>
> I?m experiencing an interesting issue with Drools/Guvnor. I am
> running Drools 5.1.1 on my workstation and the Guvnor 5.1.1 standalone
locally.
> When I run it locally, it works fine. The server installation of
> JBoss AS was downloaded and installed at the same time as Drools
5.1.1.
>
> When I try to run it connecting to the remote server (on Linux), I get
> the following error:
>
> [2010:12:361 09:12:910:debug] KnowledgeAgent rebuilding KnowledgeBase
> using ChangeSet
>
> [2010:12:361 09:12:972:exception]
>
> ***java.lang.RuntimeException*: KnowledgeAgent exception while trying
> to deserialize KnowledgeDefinitionsPackage
>
> at
> org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(***
> KnowledgeAgentImpl.java:664*)
>
> at
> org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(*
> **
> KnowledgeAgentImpl.java:889*)
>
> at
> org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(***
> KnowledgeAgentImpl.java:704*)
>
> at
> org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(***
> KnowledgeAgentImpl.java:584*)
>
> at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(***
> KnowledgeAgentImpl.java:185*)
>
> at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(***
> KnowledgeAgentImpl.java:168*)
>
> at
> com.agencyawards2.RuleSessionProviderFactory.getSessionFactory(
> ***RuleSessionProviderFactory.java:95*)
>
> at
> com.agencyawards2.RuleSessionProviderFactory.getProvider(***
> RuleSessionProviderFactory.java:35*)
>
> at com.agencyawards2.RunRules.runRules(***RunRules.java:27*)
>
> at com.agencyawards2.DroolsTest.main(***DroolsTest.java:40*)
>
> Caused by:*** java.io.StreamCorruptedException*: invalid stream
header:
> 7061636B
>
> at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
>
> at java.io.ObjectInputStream.<init>(Unknown Source)
>
> at org.drools.common.DroolsObjectInputStream.<init>(***
> DroolsObjectInputStream.java:71*)
>
> at org.drools.core.util.DroolsStreamUtils.streamIn(***
> DroolsStreamUtils.java:205*)
>
> at org.drools.core.util.DroolsStreamUtils.streamIn(***
> DroolsStreamUtils.java:174*)
>
> at
> org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(***
> KnowledgeAgentImpl.java:653*)
>
> ... 9 more
>
> [2010:12:361 09:12:03:debug] KnowledgeAgent obtaining pkg
> resource=[UrlResource path='file:src/main/rules/ruleflow.rf']
>
> The only thing I can think of that is different is that I recently
> upgraded my Guvnor 5.0.1 to 5.1.1 on the Server. I did this by
> replacing the drools-guvnor.war with the newer version. Did that
> create some sort of compatibility between my local 5.1.1 installation
> and the server installation of 5.1.1 on top of the old 5.0.1?
>
> Thanks,
>
> John
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
- CTO @ http://www.plugtree.com
- MyJourney @ http://salaboy.wordpress.com
- Co-Founder @ http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -
13 years, 11 months
StreamCorruptedException - invalid stream header
by John Peterson
Hi,
I'm experiencing an interesting issue with Drools/Guvnor. I am running
Drools 5.1.1 on my workstation and the Guvnor 5.1.1 standalone locally.
When I run it locally, it works fine. The server installation of JBoss
AS was downloaded and installed at the same time as Drools 5.1.1.
When I try to run it connecting to the remote server (on Linux), I get
the following error:
[2010:12:361 09:12:910:debug] KnowledgeAgent rebuilding KnowledgeBase
using ChangeSet
[2010:12:361 09:12:972:exception]
java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(Knowl
edgeAgentImpl.java:664)
at
org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(Kno
wledgeAgentImpl.java:889)
at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgent
Impl.java:704)
at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAge
ntImpl.java:584)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:185)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:168)
at
com.agencyawards2.RuleSessionProviderFactory.getSessionFactory(RuleSessi
onProviderFactory.java:95)
at
com.agencyawards2.RuleSessionProviderFactory.getProvider(RuleSessionProv
iderFactory.java:35)
at com.agencyawards2.RunRules.runRules(RunRules.java:27)
at com.agencyawards2.DroolsTest.main(DroolsTest.java:40)
Caused by: java.io.StreamCorruptedException: invalid stream header:
7061636B
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.<init>(Unknown Source)
at
org.drools.common.DroolsObjectInputStream.<init>(DroolsObjectInputStream
.java:71)
at
org.drools.core.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:2
05)
at
org.drools.core.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:1
74)
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(Knowl
edgeAgentImpl.java:653)
... 9 more
[2010:12:361 09:12:03:debug] KnowledgeAgent obtaining pkg
resource=[UrlResource path='file:src/main/rules/ruleflow.rf']
The only thing I can think of that is different is that I recently
upgraded my Guvnor 5.0.1 to 5.1.1 on the Server. I did this by
replacing the drools-guvnor.war with the newer version. Did that create
some sort of compatibility between my local 5.1.1 installation and the
server installation of 5.1.1 on top of the old 5.0.1?
Thanks,
John
13 years, 11 months
Guvnor Fact field
by wasim.khan318
i have a table in database Contain itemId and Item Price suppose i want to
do that
public class Applicant
{
private int ItemId;
public static int Calculate(ItemId id)
{
// here i have written code to find item price and apply some formula for
adding tax
and return prices
}
}
when i importing this class in guvnor application . in technical rule
editor. under fact field it is not showing
Calculate as a fact
i want to write
when
100<(Calculate(1))
then
//// some rule
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-Fact-field-tp2...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 11 months
.NET web application problem
by primoz1987
Hello!
I have a lot of problems with my asp.net web application.
The example(MinimalDroolsForm) good fine to me, but web application not..
Did you resolved that problem with missing compiledRules0.dll or The invoked
member is not supported in a dynamic assembly error.
error show at builder.AddPackageFromDrl(rule);
I am sure there is no problem with my Stream and .drl file.
If I do that:
try {
builder.AddPackageFromDrl(rule);
} catch (Exception ex)
{
if (ex is NotSupportedException)
{ }
}
get error: ... rule is not valid, but I'm sure it is..
rule:
package test
rule "OldCustomer"
when
cust : Bolnik( Id > 90 )
then
modify(cust) { cust.Starost = "111" };
end
or
rule "OldCustomer"
when
cust : CustomerRecord( Id > 90 )
then
cust.Starost = "111";
modify(cust);
end
I really need help because I spent a lot of time with these problem.
I can't find .NET web app example..
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/NET-web-application-p...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 11 months
help with diagnosing CEP performance issue
by me
Hi.
im trying to demo drools-fusion for a system that processes backup events.
i have the following 2 CEP rules:
rule "Backup Not Succeeded For At Least 3 Days"
@ruleId(1)
when
Node($id : id)
not ( Backup(clientId == $id, $state: state == BackupStateEnum.FINISHED)
over window:time( 3d ) from entry-point "Backup Stream" )
then
//nothing for now
end
rule "Prune Previous Successful Backups"
@ruleId(2)
when
$prevBackup : Backup($id : clientId, state ==
BackupStateEnum.FINISHED) from entry-point "Backup Stream"
$newerBackup : Backup(clientId == $id, state ==
BackupStateEnum.FINISHED, this after $prevBackup) from entry-point "Backup
Stream"
then
drools.retract($prevBackup);
end
rule #2 is my attempt to cut down on memory usage. the problem is that rule
#2 slows down the processing very very considerably (2 orders of magnitude
slower when simulating batches of 40K events/day).
what would be my next step in trying to find the reason for it? my intuition
tells me that with 2 events in the system at any given time instead of 120K
(single node, 40K events/day 3 day window) i should have seen either a
speedup or reduced memory consumption (if not both) and yet the results im
seeing are the exact opposite.
is there anything im missing ? i could try adding some sort of
LastSuccessfulBackup "marker" object into main memory and updating it using
events from the backup stream, but then how would i express rule #1 ?
any help/clues/suggestions would be greatly appreciated,
radai.
13 years, 11 months