rules update not working properly .
by sony.john@kie.com.sg
Hi All,
When i try to update three object in rules its changes the values in
rules . But after update its not reflecting on my calling code. But
workflowAction object has been updated.
What could be the problem anything i missed out here.
Please help me .
rule "Referback"
when
$workflow : Workflow(workflowActorId==2)
$workflowactor : WorkflowActor( $actoremail :actorEmail )
$workflowaction : WorkflowActions(currentUser==$actoremail &&
actions=='referback', $prevActions : prevActions )
$workflowactor1 : WorkflowActor( actorId== 1 && actorSign!=null)
then
System.out.println("drl2 action finally " + $workflowaction.getActions() +
$actoremail +$workflowactor1.getActorEmail() + $prevActions +
$workflow.getWorkflowActorId()
);
$workflow.setWorkflowActorId(1);
$workflowactor1.setActorSign(null);
$workflowaction.setActions("not need further actions");
System.out.println("worklfow id " + $workflow.getWorkflowActorId() +
$workflowactor1.getActorId() + " " + $workflowactor1.getActorSign());
update($workflowactor1);
update($workflowaction);
update($workflow);
end
Thanks in advance
Regards
Information in this e-mail is intended solely for the person(s) to whom it is addressed and may contain confidential information. If you are not the intended recipient, please notify the sender and delete this e-mail message and any other record of it from your system immediately. You should not disclose or disseminate the information to any person, use it for any purpose or store or copy the information in any form or manner.
14 years, 5 months
Drools Flow inconsistancies
by paulB
Hello,
I'm hoping someone can shed some light on something that I have limited info
to provide. This is a shot in the dark...
I have several processes that I have created with many different work item
implementations that I've created. They all work wonderfully...or they did.
Suddenly, I'm having some odd behavior on my servers.
1. Some processes (only some, not all) suddenly will not map result values
into the process variables on completion.
2. Any onEntry or onExit actions "crash" (I know that's a vague term) the
process.
3. Splits seem to randomly choose the resulting path.
I've spent three days on this doing the stare-and-compare to no avail. When
I attempt to debug these processes in Eclipse, everything runs perfectly.
My first thought is that I was not including the correct jars on my servers.
This still may be the case, but I was hoping someone knew something I
didn't.
Thanks in advance for any help,
Paul
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-inconsist...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 5 months
NoClassDefFoundError when inserting Guvnor-declared Fact
by John Peterson
I'm experiencing a stack trace error (which I've pasted below) with a
sample Drools/Guvnor application. I'm running version 5.0.1 right now.
Here's the scenario:
I have a Java application loading data (56 records right now) from a
flat file, creating objects (one per row), parsing the individual fields
on the file into the attributes of the objects, putting them into an
array, and then inserting them into my Guvnor session. In Guvnor, I
have a POJO model to receive the data plus a Declarative Model that
enables the Guvnor user to set derived values based on the input data.
There is a very basic rule that says the following (using the Guided
Editor):
When
AppData[ad]
Then
System.out.println("Creating DerivedValues for " +
ad.getAwards_id()); /* Added as Free Form DRL
Insert DerivedValues appID=ad.getAwards_ID();
System.out.println("DerivedValus for Awards_id " + dv.getAwardsID()); /*
Added as Free Form DRL
Essentially, for each Fact of AppData, I'm creating and linking it to a
Fact of DerivedValues that the user can add attributes to. I runs fine
for the first 51 rows, then blows up on the rule when it is processing
the 52 row (with 4 more to go after that). If I cut the file down to
only have 51 rows, it doesn't blow up. The error -
java.lang.NoClassDefFoundError: com/statefarm/DerivedValues is confusing
because it has used DerivedValues 51 times without issue up to this
point. I've been trying to a handle on this for a couple days without
any luck.
Here is my stack trace:
RuleAgent(default) INFO (Tue Aug 24 11:17:12 CDT 2010): Configuring with
newInstance=false, secondsToRefresh=-1
RuleAgent(default) INFO (Tue Aug 24 11:17:12 CDT 2010): Configuring
package provider : URLScanner monitoring URLs:
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/com
.statefarm/LATEST
RuleAgent(default) INFO (Tue Aug 24 11:17:15 CDT 2010): Applying changes
to the rulebase.
RuleAgent(default) INFO (Tue Aug 24 11:17:16 CDT 2010): Adding package
called com.statefarm
(53 blank rows removed to save space)
Creating DerivedValues for 122932
DerivedValus for Awards_id 122932
Creating DerivedValues for 122440
DerivedValus for Awards_id 122440
Creating DerivedValues for 122433
DerivedValus for Awards_id 122433
Creating DerivedValues for 122295
DerivedValus for Awards_id 122295
Creating DerivedValues for 119677
DerivedValus for Awards_id 119677
Creating DerivedValues for 118089
DerivedValus for Awards_id 118089
Creating DerivedValues for 118055
DerivedValus for Awards_id 118055
Creating DerivedValues for 118047
DerivedValus for Awards_id 118047
Creating DerivedValues for 118001
DerivedValus for Awards_id 118001
Creating DerivedValues for 117969
DerivedValus for Awards_id 117969
Creating DerivedValues for 117750
DerivedValus for Awards_id 117750
Creating DerivedValues for 117685
DerivedValus for Awards_id 117685
Creating DerivedValues for 117679
DerivedValus for Awards_id 117679
Creating DerivedValues for 117607
DerivedValus for Awards_id 117607
Creating DerivedValues for 117520
DerivedValus for Awards_id 117520
Creating DerivedValues for 117492
DerivedValus for Awards_id 117492
Creating DerivedValues for 117432
DerivedValus for Awards_id 117432
Creating DerivedValues for 117413
DerivedValus for Awards_id 117413
Creating DerivedValues for 117292
DerivedValus for Awards_id 117292
Creating DerivedValues for 117230
DerivedValus for Awards_id 117230
Creating DerivedValues for 117137
DerivedValus for Awards_id 117137
Creating DerivedValues for 116971
DerivedValus for Awards_id 116971
Creating DerivedValues for 116748
DerivedValus for Awards_id 116748
Creating DerivedValues for 116662
DerivedValus for Awards_id 116662
Creating DerivedValues for 116579
DerivedValus for Awards_id 116579
Creating DerivedValues for 116101
DerivedValus for Awards_id 116101
Creating DerivedValues for 115834
DerivedValus for Awards_id 115834
Creating DerivedValues for 115730
DerivedValus for Awards_id 115730
Creating DerivedValues for 114885
DerivedValus for Awards_id 114885
Creating DerivedValues for 114837
DerivedValus for Awards_id 114837
Creating DerivedValues for 114760
DerivedValus for Awards_id 114760
Creating DerivedValues for 114728
DerivedValus for Awards_id 114728
Creating DerivedValues for 114652
DerivedValus for Awards_id 114652
Creating DerivedValues for 114317
DerivedValus for Awards_id 114317
Creating DerivedValues for 113944
DerivedValus for Awards_id 113944
Creating DerivedValues for 113908
DerivedValus for Awards_id 113908
Creating DerivedValues for 113251
DerivedValus for Awards_id 113251
Creating DerivedValues for 113230
DerivedValus for Awards_id 113230
Creating DerivedValues for 112949
DerivedValus for Awards_id 112949
Creating DerivedValues for 112397
DerivedValus for Awards_id 112397
Creating DerivedValues for 111749
DerivedValus for Awards_id 111749
Creating DerivedValues for 111313
DerivedValus for Awards_id 111313
Creating DerivedValues for 111035
DerivedValus for Awards_id 111035
Creating DerivedValues for 110646
DerivedValus for Awards_id 110646
Creating DerivedValues for 110617
DerivedValus for Awards_id 110617
Creating DerivedValues for 109918
DerivedValus for Awards_id 109918
Creating DerivedValues for 109821
DerivedValus for Awards_id 109821
Creating DerivedValues for 109439
DerivedValus for Awards_id 109439
Creating DerivedValues for 109154
DerivedValus for Awards_id 109154
Creating DerivedValues for 105709
DerivedValus for Awards_id 105709
Creating DerivedValues for 105333
DerivedValus for Awards_id 105333
Creating DerivedValues for 103269 <- appears to blow up when
creating/inserting the instance of DerivedValues
Exception in thread "main" java.lang.NoClassDefFoundError:
com/statefarm/DerivedValues
at ASMAccessorImpl_320797751282666636960.getValue(Unknown
Source)
at
org.mvel2.optimizers.dynamic.DynamicGetAccessor.optimize(DynamicGetAcces
sor.java:87)
at
org.mvel2.optimizers.dynamic.DynamicGetAccessor.getValue(DynamicGetAcces
sor.java:57)
at
org.mvel2.ast.NewObjectNode.getReducedValueAccelerated(NewObjectNode.jav
a:170)
at
org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:3
7)
at
org.mvel2.ast.TypedVarNode.getReducedValueAccelerated(TypedVarNode.java:
68)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:1
04)
at org.mvel2.MVEL.executeExpression(MVEL.java:978)
at
org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:87)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
at
org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:660)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:627)
at com.statefarm.DroolsTest.main(DroolsTest.java:30)
Caused by: java.lang.ClassNotFoundException: com.statefarm.DerivedValues
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 16 more
14 years, 5 months
Bug?
by Pavel Tavoda
When I use latest 5.1.1 I'm getting following error when using
change-set with DTABLE:
<?xml version = '1.0' encoding = 'UTF-8'?>
<change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.0/change-set
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/...'>
<add>
<resource source='file:DecisionTables.xls' type="DTABLE">
<decisiontable-conf input-type="XLS" worksheet-name="Sheet1" />
</resource>
</add>
</change-set>
Exception in thread "main" java.lang.NullPointerException
at org.drools.decisiontable.DecisionTableProviderImpl.compileStream(DecisionTableProviderImpl.java:26)
at org.drools.decisiontable.DecisionTableProviderImpl.loadFromInputStream(DecisionTableProviderImpl.java:19)
at org.drools.compiler.DecisionTableFactory.loadFromInputStream(DecisionTableFactory.java:18)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:482)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:637)
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 DroolsCompiler.compileChangeSet(DroolsCompiler.java:42)
It's similar to JBRULES-2230. I reused solution from comments (on
different place) and now it's again working. Attached you can find
patch. Can somebody apply to TRUNK?
Pavel
14 years, 5 months
counting facts of a kind
by Wolfgang Laun
As simple as it gets:
rule countHigh
when
$n : Number() from accumulate ( $sgc : StartGoalConn() count( $sgc ) )
then
System.out.println( "plain routes: " + $n );
end
And yet, it fails:
Exception in thread "main" org.drools.RuntimeDroolsException:
java.lang.ClassCastException: rss.ixl.route.TrainStartGoalConn cannot be
cast to java.io.Serializable
Sure, adding "implements Serializable" to StartGoalConn fixes this. But why
is this necessary?
FYI, StartGoalConn is abstract superclass of TrainStartGoalConn - just in
case this has some bearing on this issue.
Best
-W
14 years, 5 months
Rules in Database.
by tom ska
Hi,
what I can't do is to save rules defined in Guvnor to DBMS's tables. I want
another application to read rules, and this another application can read
from Database. I saved Guvnor's data in database, but I can't see tables
with rules definition... How can I do it?
Thanks in advance,
tom.
14 years, 5 months
Error while applying changeset in 5.1 version
by Swapnil Sawant
Hi,
I have used 5.1 drools-api and drools-core JARs and wrote following code :
String currentWorkingDirectory = System.getProperty("ofbiz.home");
kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyRuleAgent"
);
String url =
"file:"+currentWorkingDirectory+"/framework/drools/config/changeset.xml";
System.out.println("Url is "+url+"\t CwD
"+currentWorkingDirectory);
kagent.applyChangeSet( ResourceFactory.newUrlResource( url ) );
KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( ResourceFactory.newUrlResource( url ),
ResourceType.CHANGE_SET );
kbase = kagent.getKnowledgeBase();
ResourceFactory.getResourceChangeNotifierService().start();
ResourceFactory.getResourceChangeScannerService().start();
While execution , I got following error :
Service invocation error
Exception: org.ofbiz.service.GenericServiceException
Message: Service [ruleServiceJava] target threw an unexpected exception
(org/drools/rule/CompositeClassLoader)
---- cause
---------------------------------------------------------------------
Exception: java.lang.NoClassDefFoundError
Message: org/drools/rule/CompositeClassLoader
---- stack trace
---------------------------------------------------------------
java.lang.NoClassDefFoundError: org/drools/rule/CompositeClassLoader
org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl.newKnowledgeBuilder(KnowledgeBuilderFactoryServiceImpl.java:34)
org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:47)
org.drools.agent.impl.KnowledgeAgentImpl.createKBuilder(KnowledgeAgentImpl.java:1214)
org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:884)
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:704)
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:584)
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:185)
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:168)
org.ofbiz.drools.event.drool.RuleIntegrate.createKnowledgeBase(RuleIntegrate.java:46)
org.ofbiz.drools.event.drool.RuleIntegrate.createWorkingMemory(RuleIntegrate.java:29)
org.ofbiz.payroll.DroolsRule.callRuleJava(DroolsRule.java:42)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:100)
org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:57)
org.ofbiz.service.ModelServiceReader$GenericInvokerImpl.runSync(ModelServiceReader.java:761)
_$gen.file_58$.D_58$.Swapnil_95$Data.ofbiz_95$payroll.ofbiz_45$17_45$Aug_45$2010.applications.payroll.servicedef.services
_46$xml_35$ruleServiceJava.runSync(file:/D:/Swapnil_Data/ofbiz_payroll/ofbiz-17-Aug-2010/applications/payroll/servicedef/
services.xml#ruleServiceJava:114)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:399)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:226)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:165)
org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:336)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:637)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:383)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:227)
org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:90)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:271)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Thread.java:619)
--------------------------------------------------------------------------------
Then I check drools-core.jar in version 5 and in 5.1 too.
The problem I found was 'org/drools/rule/CompositeClassLoader' class
was present in 5.0 version but was not there in 5.1 .
Pl help me in resolving this issue.
Thanks,
Swapnil Sawant
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Error-while-applying-...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 5 months
Stream Mode with Temporal Reasoning and Event Lifecycle Management
by Tina Vießmann
Hi,
I'm thinking about something. Maybe anyone can tell me.
The Stream Processing Mode of Drools Fusion provides automatic lifecycle
managment. For my understandings this is based on the sliding windows
used inside the rule conditions, the @expires metadata and the @delay
metadata. Am I right so far?
My questions is now: How are Events handled if non of the things listed
above are used?
Let's say I've got rules just using the temporal reasoning operators
inside the rule conditions - no sliding windows at all. I'm also not
using any of the @expires and @delay metadata. Is it correct than that:
- Drools matches the event coming in and the events existing in the
KnowledgeBase and eventually activates a rule. And after fireAllRules()
is called the resulting actions are performed and all Events are
retracted by the automatic lifecycle managment, because there are no
hints (like a sliding window) that events will be needed again. (So that
the knowledge base would be empty again?)
Thanks for any explanations. :)
Tina
14 years, 5 months