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, 10 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, 10 months
creating .pkg from .drl
by Amit Kumar
Hi Folks,
I am trying to create a .pkg file (for probably faster loading) from a .drl
file
Does anybody has a code snippet which I can use. Am unable to find it in
javadocs.
Thanks
Amit
15 years, 10 months
Bug: ActivationCreatedEvent - Activation: InitialFactImpl in Object set
by Wolfgang Laun
Given this rule
rule "show no gaps"
when
not Gap()
then
System.out.println( "No gaps!" );
end
the ActivationCreatedEvent references an Activation, where the list of
fact handles (getFactHandles) contains one element, but its Object is null:
Fact null @0:0:27032609:1306428912:0:DEFAULT
But the list of objects (getObjects) returns a list where there *is* an
object:
Object (org.drools.reteoo.InitialFactImpl):
org.drools.reteoo.InitialFactImpl@4dde85f0
I think that this should be changed; neither a fact handle nor an object
should
be returned if there are no user objects participating in the activation.
Cheers
Wolfgang
15 years, 10 months
Drools Flow - Dependency Injection
by jawa
Hi,
I am writing a custom workItem handler in drools flow and want to access my
Stateless session bean from there. I will deploy my drools project to JBoss
so can I use @EJB annotation to get my stateless bean injected by jboss with
in WorkItemHandler?
Secondly I'll call my flow from with in a Stateless session bean. Is it ok?
Or does drools use multi threading? As multi threading is not recommended to
be used in EJBs?
Thanks
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-Dependenc...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 10 months
Is nested loops possible ?
by Dinesh kumar
Hi,
I am having a problem in iterating a list inside a list.
I am having the following business scenario.
Public Class CustomerOrder {
private String customerName;
private ArrayList<Order> orderList;
}
Public Class Order {
private String orderId;
private String orderTime;
private ArrayList<OrderItem> orderList;
}
Public Class OrderItem {
private String itemName;
private Double itemAmount;
}
I need to find the total order amount for each order and the sum of all
order.
My rule is like individual orders should not exceed a 10000 and total order
amount of all customers should not exceed 100000.
For this, I need to iterate ArrayList<Order> orderList and during each
iteration , I need to iterate ArrayList<OrderItem> orderList. Is this
possible in Drools ?
I tried something like this. But it doesn't seem to be working.
when
ClaimRegistration($orderList: orderList)
Number( $count : intValue > 0)
from accumulate(Order(orderId== "order1"
&&
Number( doubleValue > 10000 )
from accumulate( OrderItem( $value : itemAmount),
init( double total = 0; ),
action( total += $value; ),
reverse( total -= $value; ),
result( total ) )
) from $orderList,count(1))
then
Sysout(",,,,,");
It would be of great help if any one can give suggestions to solve this.
Is nested loops possible in Drools ?
Regards,
Dinesh
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Is-nested-loops-possi...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 10 months
Math calculations on attributes in WHEN section of rules.
by tom ska
Hello,
what I want to do, is to calculate on object's attributes in WHEN section of
rule. Can I do it?
For example:
class CObj
{
private int k;
private int n;
// setters and getters
}
Now what I want to do is:
rule "r1"
when
p : CObj ( k + n <= 1000)
then
System.out.println("We love Drools :)");
end
Why can't I construct conditions like in Java, or C++ (with calculations in
conditions)? How can I achieve my goal?
Thx,
Tom.
15 years, 10 months
Another solution for: Detecting more than 3 occurrences within 1 hour
by Tina Vießmann
Hi,
I'm working on thinking in Drools rules. Right now I'm trying to solve this:
The rule shall fire if _a special event occurs more than 3 times
within 1 hour_.
My _first thought of a solution_ was to count the count the detected
events using a counter. But the counter has to be a global variable,
hasn't it? And global variables are not to be used to frequently, aren't
they?
And global variables must always be initialized from outside the rules
file, don't they?
Because of these thoughts I've looked for a _different solution without
global variables_. I came up with:
function boolean valueExceededLimit(Set<Alarms> alarmSet) {
//....
}
rule "more than 3 occurs within 1 hour"
when
// event #1
$eventA : Value(
eval(parameterValueExceededLimit($eventA.getAlarms())) )
// event #2
$eventB : Value( this after[0ms,1h] $eventA &&
this != $eventA &&
eval(valueExceededLimit($eventB.getAlarms())) )
// event #3
$eventC : Value( this after[0ms,1h] $eventA &&
this != $eventA &&
this != $eventB &&
eval(valueExceededLimit($eventC.getAlarms())) )
// event #4 -> 4 > 3
$eventD : Value( this after[0ms,1h] $eventA &&
this != $eventA &&
this != $eventB &&
this != $eventC &&
eval(valueExceededLimit($eventD.getAlarms())) )
then
// ... do something ...
end
More than 3 is kind of a doable task. But I think of this solution as
heavy in case its needed to detect a larger number of events. I would be
thankful for other approaches to the problem.
Thanks :)
Tina
15 years, 10 months