Help needed in Rule flow in Guvnor
by Vignesh
Hi,
I am using Rule flow in Guvnor for setting some value out of the flow which
would be used for my further processing. Below is what I'm trying to
achieve,
I have two rule groups in the rule flow, out of which the first one would
set a <key, value> pair in a Map which is a field in one of the bean class
declared Global for the package when ever each rule is executed in the set
of rules in the group and the next rule group would be required to have a
set of rules that needs to be executed against this Map which was set in the
first rules group and send the final result as output out of the flow.
I have defined the rules in the first rule group and set the Map with
necessary keys and values, but I was not able to read the Map in this second
rule group. I had tried this second rule group as a custom java code in my
Java part after the rules execution from guvnor and able to read the map
that was set from the first rule group and able set the final decision.
I want to know whether reading the Map from the second rule group which was
set in the first rule group is possible or not. Or kindly let me know
whether I'm missing anything here and needed to add any other logic to
achieve the same.
Thanks,
Vignesh
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Help-needed-in-Rule-f...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
Getting NullPointer Exception while sending an response back from Guvnor using web services
by Vignesh
Hi,
I have defined a set of rules using DSL and corresponding rules in Guvnor
and i have tested the same using a standalone code which is working fine.
But when i tried invoking the same from a webservice by including this
guvnor project as a JAR Im getting a NullPointerException while sending the
response back from Guvnor to the web service client,
below is the exception stack i got in server side,
ERROR - AxisServlet.doPost(172) |
java.lang.NullPointerException
at
org.apache.axis2.clustering.context.DefaultContextManager.updateContexts(DefaultContextManager.java:81)
at
org.apache.axis2.clustering.context.Replicator.replicate(Replicator.java:81)
at
org.apache.axis2.receivers.AbstractMessageReceiver.replicateState(AbstractMessageReceiver.java:71)
at
org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:41)
at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
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
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process
Http11Protocol.java:588)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:595)
and the below is the exception stack in client side,
org.apache.axis2.AxisFault: java.lang.NullPointerException
at
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512)
at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at org.tempuri.Service1Stub.CheckEntitlement(Service1Stub.java:740)
at ws.client.testClient.main(testClient.java:73)
If any one has faced similar issue and fixed the same, please help me out it
resolving the same or any pointers for fixing this issue would be of great
helpful.
Thanks,
Vignesh
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Getting-NullPointer-E...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
Missing Drools Pipeline
by Thorsten
Hello out there,
I just installed the Drools 5.1 final and have read the updated
documentation of Expert and Fusion. I wonder what happend to the
Pipeline-classes? It seems like they are no longer inside the packages.
Do you have more information?
Thanks and regards
Thorsten
15 years, 6 months
UTF8 characters corrupted when embedded in DRL files
by crafferty
Drools, version, 5.0.1 running on Java 1.6.0_12
Our application creates rules in DRL files, the rules contain non-Latin
characters, here is an example rule:
//****************************************************************************
//
// TRIGGER_ RULE: Detect Dual Receiver Failure
//
//****************************************************************************
rule TRIGGER_Detect_Dual_Receiver_Failure_43296731577724
no-loop true
salience 0
when
// When a Child Group exists with:
child0:ChildGroup(
// base class is "com.sidonis.vp.dtvexample.BroadcastEquipment"
baseClass == "com.sidonis.vp.dtvexample.BroadcastEquipment",
// parent base class is "com.sidonis.vp.dtvexample.BroadcastEquipment"
parentBaseClass == "com.sidonis.vp.dtvexample.BroadcastEquipment",
// parent sub class starts with "DualReceiver"
child0_parentSubClass:parentSubClass ->
(child0_parentSubClass.startsWith( "DualReceiver" )),
// failed count is 2
failed == 2
)
then
StatisticsSystemRuleFunctions.incrementTrigRuleCount();
StatePropagationFunctions.trigForceParentFailedViaChild(
"TRIGGER_Detect_Dual_Receiver_Failure_43296731577724",
"あえいおう",
child0,
true );
end
When the static method trigForceParentFailedViaChild is invoke as a
consequence of fullfilling the rule conditions, the non-latin text in the
second argument is corrupted when output to a file.
The DRL is loaded as a resource by our application and passed to Drools
thus:
try {
final FileInputStream fis = new FileInputStream(drlFile);
fr = new InputStreamReader(fis, textEncoding);
} catch (FileNotFoundException e1) {
log.error("Cannot open DRL file: " + drlFile.getName());
return null;
} catch (UnsupportedEncodingException e) {
log.error("Text encoding configuration problem " + textEncoding);
return null;
}
// Load DRL file into PackageBuilder and create Package
Resource resource = ResourceFactory.newReaderResource(fr, textEncoding);
KnowledgeBuilder knowledgeBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder(knowledgeBuilderConfiguration);
knowledgeBuilder.add(resource, ResourceType.DRL);
Note, 'textEncoding' is loaded from a properties file by the application and
is set to "UTF8". The system property "file.encoding" for the
application's JVM is also set to "UTF8".
We have also tried using the ResourceFactory's newFileResource passing it
the drlFile Object, but to no avail, the result is the same.
So we have debugged the Drools 5.0.1 source and discovered that when the
stream representing the DRL is wrapped by the ANTLRInputStream, line 320,
org.drools.compiler.DrlParser (drools-compiler project) the encoding of the
input stream is not passed on to the ANTLRInputStream that is used to wrap
it. If we modify the Drools code to use the overloaded ANTLRInputStream
constructor that accepts the stream encoding then the non-Latin text is
passed correctly to our method. We've also checked the code on the head
of the repository and it is same. Although this seems like a bug, I want to
make sure we're not doing something wrong first.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/UTF8-characters-corru...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
Re: [rules-users] How to work with org.drools.repository
by wilsonywx
Because I only needed a small subset of the Drools functionality (i.e. just
plain rules without salience) I just made up a simple xml schema to store
the rule. I've posted some other related questions about the .brl format
(which is the xml format Guvnor uses to store rules) but haven't gotten many
useful replies. I think if you project is not overly complex it's probably
better off just making up your own storage scheme than trying to reverse
engineer the classes in Drools (fyi they use XStream to serialize and
deserialize their classes into xml). Hope that helps.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-work-with-org-...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
API of Rule: no access to interesting attributes
by Wolfgang Laun
Whereas org.drools.rule.Rule contains a wealth of interesting fields,
the stable API org.drools.definition.rule.Rule restricts us to
getName() and getPackageName() (and some MetaData - whatever that
might be).
I'd opt for an extension of this interface, providing access to
agendaGroup, activationGroup and ruleFlowGroup. I see no obvious
reason why these user defined attributes should remain hidden.
These rule attributes would provide a good opportunity for writing
more sophisticated event loggers, letting you specify rule filters by
natural rule groupings.
Cheers
-W
15 years, 7 months
DATE-EXPIRES in rule table ?
by Arun Kumar
Hi,
Am using a spreadsheet based rules. Is it possible to set the attribute
like "date-expires", "enabled"
in the spread sheet ?
*
*
*Regards,*
*Arun*
*
*
15 years, 7 months
IllegalStateException : DroolsJPAManager while calling session.dispose() method.
by drooRam
Hi
I have got the following exception when i tried to call ksession.dispose()
method : Does anyone have faced this problem before??
java.lang.IllegalStateException: No value for key
[org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean@173898a]
bound to thread [http-8080-1]
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.IllegalStateException: No value for key
[org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean@173898a]
bound to thread [http-8080-1]
org.springframework.transaction.support.TransactionSynchronizationManager.unbindResource(TransactionSynchronizationManager.java:199)
org.drools.container.spring.beans.persistence.DroolsSpringJpaManager.dispose(DroolsSpringJpaManager.java:75)
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:296)
org.drools.command.impl.CommandBasedStatefulKnowledgeSession.dispose(CommandBasedStatefulKnowledgeSession.java:181)
edu.rascalflow.service.impl.LoanApprovalServiceImpl.requestLoan(LoanApprovalServiceImpl.java:59)
edu.rascalflow.service.impl.BankingServiceImpl.requestLoan(BankingServiceImpl.java:62)
edu.rascalflow.controller.LoanRequestFormController.onSubmit(LoanRequestFormController.java:31)
org.springframework.web.servlet.mvc.SimpleFormController.onSubmit(SimpleFormController.java:387)
org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:272)
org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:268)
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:774)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/IllegalStateException...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 7 months
MinaTaskClientHandler Reference Object
by drooRam
How can I obtain reference to MinaTaskClientHandler through drools config
tags? I mean .. we have <drools:kbase> tag for KnowledgeBase...similarly, do
we have anything for MinaTaskClientHandler...
I basically need to call the methods, TaskClient.claim, TaskClient.complete
etc thro MinaTaskClientHandler.getClient().
Please let me know how can i obtain MinaTaskClientHandler thro config or
snippet ?
-drooRam
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/MinaTaskClientHandler...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 7 months