How to implement custom editor for Drools Flow work definitions
by Jay
Hi fellas,
I'm trying to implement custom email node of Drools flow, to add
'attachment' property to email node.
I know how to implement defining custom work definitions, but I don't know
how to implement a custom editor for it.
Because I need a File Chooser(just like JFileChooser) for 'attachment' to
select file as attachment of email, so I want to implement a custom editor
for it.
I've created a editor using SWING and AWT, and re-define email work
definition, below info is a extract from it:
"customEditor" : "com.icil.booking.as.drools.model.EmailEditor".
But it's not work, no editor shown after db click the email node.
Could anyone help me with your good ideas? I'll very appreciate what you do
for me.
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-implement-custom-editor-for-Droo...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Drools - server requires proxy
by Sébastien Raickman
Hi guys,
I am trying to deploy drools-server 5.2.0.M1 on tomcat 7. It works good
when my proxy is set in catalina.sh, but for production environment, we
don't want that for security reasons.
In the case where no proxy is set, the server get stuck after this traces.
I have to kill it to stop it.
Do you know the reason why it requires an internet connection or a Proxy??
Thanks a lot,
Sebastien
10:37:42 CEST 2011]; root of context hierarchy
2011-04-28 10:37:42,299 INFO [XmlBeanDefinitionReader] Loading XML bean
definitions from class path resource [beans.xml]
2011-04-28 10:37:42,479 INFO [XmlBeanDefinitionReader] Loading XML bean
definitions from class path resource [knowledge-services.xml]
2011-04-28 10:37:42,666 INFO [XmlBeanDefinitionReader] Loading XML bean
definitions from class path resource [camel-server.xml]
2011-04-28 10:37:43,707 INFO [XmlBeanDefinitionReader] Loading XML bean
definitions from class path resource [META-INF/cxf/cxf.xml]
2011-04-28 10:37:43,760 INFO [XmlBeanDefinitionReader] Loading XML bean
definitions from class path resource
[META-INF/cxf/cxf-extension-jaxrs-binding.xml]
2011-04-28 10:37:43,905 INFO [XmlBeanDefinitionReader] Loading XML bean
definitions from class path resource [META-INF/cxf/cxf-extension-soap.xml]
2011-04-28 10:37:43,932 INFO [XmlBeanDefinitionReader] Loading XML bean
definitions from class path resource [META-INF/cxf/cxf-servlet.xml]
2011-04-28 10:37:44,156 INFO [CamelNamespaceHandler]
camel-osgi.jar/camel-spring-osgi.jar not detected in classpath
2011-04-28 10:37:45,606 INFO [XmlWebApplicationContext] Bean factory for
application context
[org.springframework.web.context.support.XmlWebApplicationContext@5e76f2e8]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@25de152f
2011-04-28 10:37:45,819 INFO [XmlWebApplicationContext] *Bean 'cxf' is not
eligible for getting processed by all BeanPostProcessors (for example: not
eligible for auto-proxying)*
2011-04-28 10:37:46,029 INFO [DefaultListableBeanFactory] Pre-instantiating
singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@25de152f:
defining beans
[node1,kbase1,ksession1,cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.jaxrs.JAXRSBindingFactory,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.transport.servlet.ServletTransportFactory,rsServer,soapServer,droolsPolicy,template,consumerTemplate,camel:beanPostProcessor,camel];
root of factory hierarchy
13 years, 8 months
Import Functions in Guvnor
by Pankaj Khattar
Can anybody share that how to import java function in the guvnor & use them
in writing rules in guvnor.
For example i have a drl file in which i have
import function com.alu.ae.ais.smp.fm.drools.service.Function.delayAlert;
in which 'Function' is the class & 'delayAlert' a method in the class, the
rule is as
rule "Delay Alert"
no-loop true
dialect "mvel"
lock-on-active
when
then
delayAlert(<method parameter>);
end
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Import-Functions-in-G...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 8 months
NullPointer after inserting fact in RHS
by dabar
I've been battling with drools and just wanting a second viewpoint. I'm
using drools 5.2.0 flow and rules.
I have a rule that inserts a new fact as part of the RHS of the rule and
then I'm getting a null pointer exception - stack below. I assume when the
fact is inserted all the rules are evaluated to build up the agenda.
I've debugged through drools code and found that in ClassFieldReader object1
is null and object2 is my new fact.
I'm interested in what a JoinNode represents as I think this is what is
being evaluated. I would guess its a join node in the flow but these don't
contain any rules so perhaps not.
Similar threads here suggest this is a fault in one of the rules but I have
about 100 rules so working out the culprit isn't straightforward.
What I really want to know is if there a way I can find out which rule is
being assessed for the agenda so I check that rule.
Caused by: java.lang.NullPointerException
at
org.drools.base.com.somecompany.prov.rulesbased.facts.ProvResponse1649170666$getMmlCommandUid.getIntValue(Unknown
Source)
at
org.drools.base.ClassFieldReader.getIntValue(ClassFieldReader.java:165)
at
org.drools.base.evaluators.EqualityEvaluatorsDefinition$IntegerEqualEvaluator.evaluate(EqualityEvaluatorsDefinition.java:1522)
at
org.drools.core.util.AbstractHashTable$SingleIndex.equal(AbstractHashTable.java:619)
at
org.drools.core.util.LeftTupleList.matches(LeftTupleList.java:190)
at
org.drools.core.util.LeftTupleIndexHashTable.getOrCreate(LeftTupleIndexHashTable.java:347)
at
org.drools.core.util.LeftTupleIndexHashTable.add(LeftTupleIndexHashTable.java:233)
at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:65)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:138)
at
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:148)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:190)
at
org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:145)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1183)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1085)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:889)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:238)
at
com.somecompany.rules.global.RulesUtils.insertFact(RulesUtils.java:159)
at
com.somecompany.rules.common.Rule_Common_HandleUnexpectedResponse___Mark_an_unexpected_response_as_handled_0.defaultConsequence(Rule_Common_HandleUnexpectedResponse___Mark_an_unexpected_response_as_handled_0.java:28)
--
View this message in context: http://drools.46999.n3.nabble.com/NullPointer-after-inserting-fact-in-RHS...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Memory issue with drools (using 10000 rules)
by Shebs, Liron
Hello All,
I'm working at HP Software R&D and we are considering using drools in our product.
Benchmarking tests showed that running 10,000 rules consumes 382mb.
This is too high for our system requirements, and we would like to know how we can improve it.
Technical details:
- Drools version: 5.1 with default configuration.
- All rules look like this:
rule "status-Fixed-Open"
when
event : FieldChangedEvent(fieldName == "status", oldValue == "Fixed");
entity : Entity(entityType == "mock-entity");
eval(((String) entity.getFieldValue("status")).equals("Open"));
then
do Something...
end
- Loading code:
KnowledgeBuilder knowledgeBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
for(all resources)
{
knowledgeBuilder.add(resource, ResourceType.DRL);
}
knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();
knowledgeBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());
Any insights are most appreciated.
Thank You,
Liron, HP Software R&D
13 years, 8 months
Hot deployment in Drools
by Sumeet Karawal
Hi,
I have some queries about Drools - Guvnor :
1) Is hot deployment possible in Guvnor, how can we do that? How can we
change rules on fly? eg we are using Decision Table for rules and if we
change some data in that sheet, how will the changes get reflected in the
rule engine?
2) Does the rule engine maintain a log file (in expert as well as in
Guvnor). How to do an Audit check eg. for getting which rules were fired,
which user changed the rules and at what time?
Thanks & Regards,
Sumeet Karawal
Mailto: sumeet.karawal(a)tcs.com
=====-----=====-----=====
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
13 years, 8 months
Sequential mode and partial propagations
by Vincent LEGENDRE
Hi All
First : sorry for the misplaced reply to another thread
This post is to continue an interresting (to me) discussion started there : https://issues.jboss.org/browse/JBRULES-46
This was about my remark about a backward-chaining mode that could be used to allow sequential mode to handle some kind of RETE updates (first rules could then trigger subsequent rules).
There are some number of answers after that, but I am not sure if I can answer them in the JIRA, so this post ...
To Mark :
" Currently our sequential mode works as single pass, but it has no inference as rete join memory is turned off. So it produces all the conflict set more efficiently, and then it uses rule order for the execution order of the conflict set. However changes in the current rule are not recognised by the later rules. That is planned though by "partinioning" the sequential engine around the modify statements. The advantage to this is we keep a single algorithm that is just configured slightly to provide different behaviours. Rather than two competely different engines. "
I think this is a very good solution, far much better (more efficient and far more clear to predict how rules will fire) than handling propagation for each individual rule's update. But I did not understand if it is already done in trunk in some way, or if it is something planned for future. And if so, the question after that is do you have an idea of when this could be done ? ... or if is quite affordable for someone not involved directly in drools developement? (like me for instance, as you speak of "sligth configuration").
To Michael :
You propose some new rules, by binding the "something" field in condition rather than calling getSomething() in action (and you change the object to which is applied the update, which is an error I think).
To me that changes nothing, the rule will loop as one of its binded value is changed ($value, and now $something..). And a no-loop property won't change this too ...
To summarize a bit, the use-case I present in the JIRA (create counters, fill them, validate them) could really take advantage (perfs, simplicity in authoring/design) of a sequential mode that could handle a partial inference (driven by a flow for instance, which seems quite natural for everyone (dev or BA)).
13 years, 8 months