Bug with BatchExecutionHelper when using Log4j rootlogger?
by dunnlow
Hi,
I have a small drools client that sends a pojo to a Drools Server using
xstream:
MyBean mb = new MyBean();
List<Command> cmds = new ArrayList<Command>();
InsertObjectCommand insertCmd = (InsertObjectCommand)
CommandFactory.newInsert(mb);
insertCmd.setOutIdentifier("inserter");
insertCmd.setEntryPoint("Default");
cmds.add(insertCmd);
FireAllRulesCommand fireAllRulesCommand = new FireAllRulesCommand();
cmds.add(fireAllRulesCommand);
BatchExecutionCommand command =
CommandFactory.newBatchExecution(cmds,"ksession1");
String xml BatchExecutionHelper.newXstreammarshaller().toXML(command); *<--
this XML is sent to the server*
..........8<
Pretty standard, I think. It works just fine and I get a http 200 response
back from my server.
HOWEVER, if I add log4j (log4j.1.2.14.jar) and a log4j.properties that has a
root logger (set to any level) the XML produced includes an "appenderList"
which seems to be trying to stream the log4j appenders (e.g.
org.apache.log4j.ConsoleAppender). I'm guessing these are not serializable
(no surprise there) and the server complains about the XML. (fyi, the same
log4j jar is on the drools server)
Is this a known issue/expected? I can comment out the root logger and
everything is back to ok.
Thanks for any insight,
-J
--
View this message in context: http://drools.46999.n3.nabble.com/Bug-with-BatchExecutionHelper-when-usin...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 9 months
Re: [rules-users] Error running Drools 5.0 HelloWorldExample on WebSphere 6.1
by Blythe, Marshall
A quick follow-up: this error occurs only when I have rules using the MVEL dialect. I rewrote the MVEL rule in the HelloWorld.drl to use the Java dialect, and now the problem is gone. I may need to raise this issue on the MVEL mailing list instead.
----------------------------------------- This e-mail and any attachments may contain CONFIDENTIAL information, including PROTECTED HEALTH INFORMATION. If you are not the intended recipient, any use or disclosure of this information is STRICTLY PROHIBITED; you are requested to delete this e-mail and any attachments, notify the sender immediately, and notify the LabCorp Privacy Officer at privacyofficer(a)labcorp.com or call (877) 23-HIPAA.
12 years, 9 months
setting different value in consequence ( RHS part) based on a conditional check
by vadlam
Hi,
we have an existing BRL rule in Guvnor whereby we set the value of some
fields in RHS based on some value checks in the condition part. we have
created several of these rules already in a previous release.
In the next release, we have new requirements to set the value of an
existing field in consequence to be of 2 different values based on a
specific conditional evaluation. the rest of the rule remains the same.
to clarify,
when
samplefact1( status== "active" , state=="CA" )
then
Response fact0= new Response();
fact0.setField1( "Y" );
fact0.setName( "something " );
insert(fact0 );
end
we now have to change this to set Field1 value to Y or N based on some
updated condition for status field.
lets say if status=="active" , Field1 has to be Y, but when status=closed,
then Field1 has to be N
Please keep in mind that the rest of the rule remains the same.
is there a way to set the value of Field1 to be Y or N within the
consequence part of same rule without having to create another rule .
will the use of functions or variables be of any help in this case?
--
View this message in context: http://drools.46999.n3.nabble.com/setting-different-value-in-consequence-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 9 months
Camel-drools example
by Serge Vilvovsky
Can anybody provide, please, the example of using camel with drools? Where
should I place the drool files if I run them in ServiceMix?
Thank you!
12 years, 10 months
Accumulate function, events and stream processing
by Juanker Atina
I need your help to put to work an accumulate function.
So, i will introduce several facts into working memory (StateEvent, which i
declare as event) and i want to accumulate the last five values.
I have changed a property in drools.default.rulebase.conf
(drools.eventProcessingMode = STREAM) to make the engine works in stream
mode.
And my rule is:
declare StateEvent
@role( event )
end
rule "Testing"
when
$total : Number() from accumulate(
StateEvent(itemName=="Temperatura", $val : newState) over
window:length( 5 ),
sum ( ((DecimalType)$val).toBigDecimal().doubleValue() ) )
then
#actions
end
But it's not working, as the value of $total is 0.0, no matter what i do,
and the rule is firing with every fact in the working memory.
Any help will be appreciated.
Thanks
12 years, 10 months
ruleflow and bpmn files issues with drools and guvnor 5.2 final
by style.x7
Hi all,
I've tried drools 5.2 final version with much excitement but the default
create new drools project is already giving problems:
Issue 1. Exceptions when running default created .rf and .bpmn files.
When I ran ProcessTest.java with .rf file, I get:
java.lang.NullPointerException
at
org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:516)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:556)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at com.sample.ProcessTest.readKnowledgeBase(ProcessTest.java:36)
at com.sample.ProcessTest.main(ProcessTest.java:23)
When I ran ProcessTest.java with .bpmn file, I get:
lang.IllegalArgumentException: Unable to instantiate service for Class
'org.drools.compiler.BPMN2ProcessProvider'
at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:161)
at
org.drools.compiler.BPMN2ProcessFactory.loadProvider(BPMN2ProcessFactory.java:29)
at
org.drools.compiler.BPMN2ProcessFactory.getBPMN2ProcessProvider(BPMN2ProcessFactory.java:21)
at
org.drools.compiler.BPMN2ProcessFactory.configurePackageBuilder(BPMN2ProcessFactory.java:12)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:559)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at com.sample.ProcessTest.readKnowledgeBase(ProcessTest.java:33)
at com.sample.ProcessTest.main(ProcessTest.java:20)
Caused by: java.lang.IllegalArgumentException: Unable to instantiate
'org.jbpm.bpmn2.BPMN2ProcessProviderImpl'
at
org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.newInstance(ServiceRegistryImpl.java:210)
at
org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.call(ServiceRegistryImpl.java:202)
at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:159)
... 7 more
Caused by: java.lang.ClassNotFoundException:
org.jbpm.bpmn2.BPMN2ProcessProviderImpl
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.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.newInstance(ServiceRegistryImpl.java:207)
... 9 more
Issue 2: Guvnor 5.2 final unable to display .rf and .bpmn files
No error message was given when guvnor is unable to display .rf files. The
popup shows blank diagrams.
For .bpmn files, guvnor with designer-1.0.0.052-jboss.war shows the oryx
editor with blank diagrams, error message:
SEVERE [JbpmProfileImpl] Could not find BPMNDI information
java.lang.IllegalArgumentException: Could not find BPMNDI information
at
com.intalio.bpmn2.impl.Bpmn2JsonMarshaller.marshallProcess(Bpmn2JsonMarshaller.java:347)
at
com.intalio.bpmn2.impl.Bpmn2JsonMarshaller.marshallDefinitions(Bpmn2JsonMarshaller.java:255)
at
com.intalio.bpmn2.impl.Bpmn2JsonMarshaller.marshall(Bpmn2JsonMarshaller.java:138)
at
com.intalio.web.profile.impl.JbpmProfileImpl$2.parseModel(JbpmProfileImpl.java:197)
at
com.intalio.web.repository.impl.UUIDBasedJbpmRepository.load(UUIDBasedJbpmRepository.java:38)
at
com.intalio.web.server.UUIDBasedRepositoryServlet.doGet(UUIDBasedRepositoryServlet.java:123)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.intalio.web.filter.impl.PluggableFilter.doFilter(PluggableFilter.java:75)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
My development environment is eclipse 3.6, drools plugin 5.2 final, java 6,
windows 7, jboss as 5.1 jdk 6.
Any help would be greatly appreciated.
--
View this message in context: http://drools.46999.n3.nabble.com/ruleflow-and-bpmn-files-issues-with-dro...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 10 months
Difference between Rule Base and Knowledge Base
by Swapnil Sawant
Hi,
I had a very basic doubt. 'Rule Base' and 'Knowledge Base' are two different concepts (may be from implementation point of view )?
I got this doubt when I was going through section '1.4.7.2. Drools execution server' of drools guvnor (v5.0) where it was written like :
The drools execution server (drools-server) module is a war which you can deploy to execute "knowledgebases (rulebases)" remotely for any sort of client application
The thing is that , I have created Knowledge base from changeset.xml as follows :
kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyRuleAgent" );
kagent.applyChangeSet( ResourceFactory.newUrlResource( changesetUrl ) );
kbase = kagent.getKnowledgeBase();
Now if I wish to get Rule Base corresponding to my changeset(or rather my DRL file) using 'this kbase object' , how can I do that ?
Thanks,
Swapnil Sawant
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.
______________________________________________________________________
12 years, 10 months
Activation Firing slow on many events with timer attribute in rule (Drools Fusion)
by Philipp Herzig
Dear Community,
Drools is pretty fast regarding all my use cases. However, today I have
found a problem where I cannot find any solution. Hopefully someone of you
can help.
1. I have a rule with a @timer(10s) attribute (should be 24h later on but
doesn't matter). This rule is activated when a "create" event occurs and
invalidated once a "delete" event occurs within the timeframe of @timer.
2. I have approx. 9000 "create" events which are bulk loaded into the
working memory and creating activations for the rule above.
3. I have approx. 2000 "delete" events which are bulk loaded into my
entry-point cancelling the respective activations from step (2)
4. After the timer expired, the first activation is fired correctly.
However, all other activations are fired with some noticeable delay
(actually it needs 20-30minutes until all activations are fired).
Do you have an idea what the problem with the timer might be?
Unfortunately, I have neither an idea how the scheduler in the background
works nor which class I should start looking at.
BTW: For testing purpose I switched step (2) & (3), that is, "delete"
events are inserted before the "create" events and removed the timer
attribute which is obviously the same logic. It performs lightning fast in
this case... (all remaining activations are fired within 5
seconds). However, insertinging my "delete" events before the "create"
events is ok for testing but not feasible in practice.
It would be great if some of you has an idea or point to start within the
code.
Thanks in advance,
Philipp
12 years, 10 months