Resolution to JBRULES-2837 possible?
by davesomebody
Hi,
I am hesitating on making a recommendation to use the jBPM 5.0 based on
Drools due to the bug https://issues.jboss.org/browse/JBRULES-2837
https://issues.jboss.org/browse/JBRULES-2837 JBRULES-2837 not being
resolved since November.
I have seen one workaround posted to the forums regarding creating a
stateful session per process invocation. I have a concern that this would
wreak havoc with persistence.
The other solution I have seen is to use a stateful session per thread. I
know that is not viable due to the fact that a thread may exit the session
due to use of an asynchronous domain specific language work item.
I see progress has been made on JBRULES-2837 though it has not been closed.
I have considered using a pool of stateful sessions as a stop-gap. Could be
viable? Would still be a pain persistence wise, but maybe doable?
Is there at least a plan in place for resolution? I want this to work.
Thanks!
--
View this message in context: http://drools.46999.n3.nabble.com/Resolution-to-JBRULES-2837-possible-tp2...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Strange java.lang.NoClassDefFoundError
by Benson Fung
Hi,
I have a GWT RPC method as follows :
public String validate(ApplicationData ad) {
Object dataObj = null;
KnowledgeAgent kagent =
(KnowledgeAgent)getServletContext().getAttribute("KNOWLEDGE_AGENT");
KnowledgeBase kbase = kagent.getKnowledgeBase();
StatefulKnowledgeSession sf = kbase.newStatefulKnowledgeSession();
FactType ft = kbase.getFactType("axaPMTPOCPackage", "ApplicationData");
try {
dataObj = ft.newInstance();
ft.set(dataObj, "name", ad.getName());
ft.set(dataObj, "sex", ad.getSex());
ft.set(dataObj, "minIssrdAge", ad.getMinIssrdAge());
ft.set(dataObj, "age", ad.getAge());
ft.set(dataObj, "boxname", ad.getBoxname());
sf.insert(dataObj);
RuleNameStartsWithAgendaFilter filter = new
RuleNameStartsWithAgendaFilter(ad.getRuleName());
sf.fireAllRules(filter);
sf.dispose();
} catch(Exception e) {
e.printStackTrace();
}
String returnMsg = (String)ft.get(dataObj, "returnMsg");
return returnMsg;
}
At the client side, I made 2000 times of the above ajax call to
validate 2000 fields.
However, I got the following java exception after making certain
number of calls.
2011-04-11 15:45:17,438 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/axa_pmt_poc]]
(http-127.0.0.1-8080-8) Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract java.lang.String
com.axa.pmt.poc.client.ExecuteRuleService.validate(com.axa.pmt.poc.data.ApplicationData)'
threw an unexpected exception: java.lang.NoClassDefFoundError:
axaPMTPOCPackage/ApplicationData
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:378)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:581)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:207)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:243)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
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.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(Thread.java:662)
Caused by: java.lang.NoClassDefFoundError: axaPMTPOCPackage/ApplicationData
at ASMAccessorImpl_19303314141302536715970.getValue(Unknown Source)
at org.mvel2.optimizers.dynamic.DynamicGetAccessor.getValue(DynamicGetAccessor.java:66)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:96)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:104)
at org.mvel2.MVEL.executeExpression(MVEL.java:1001)
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:103)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:917)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:856)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1071)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:785)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:761)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:226)
at com.axa.pmt.poc.server.ExecuteRuleServiceImpl.validate(ExecuteRuleServiceImpl.java:51)
at sun.reflect.GeneratedMethodAccessor275.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
... 25 more
Please help give me ideas what is going on.
Thanks
Benson
13 years, 8 months
real life implementations
by nch
Hello,
We're trying to implement a drools based app. As the number of rules increase
we're realising that the probability of having an infinite loop also increases,
and we find ourselves defining ever more complex control state.
How did you solve this sort of problem?
Kind regards.
13 years, 8 months
Puzzling behavior for null pointer verification in LHS
by Hezi Stern
I am puzzled with the following behavior regarding null pointer validation.
I have the flowing rule:
rule "Test"
when
$ee: ExecutableEvent($taskId: taskid, Type.SOAR == type)
$tt: TaskTicket($id: id == $taskId)
then
logger.info("Rule:test !!!"+$tt.toString());
if($tt.getScheduledTime() != null)
logger.info("Rule:test schedule is not null");
end
what I get when I execute the system are the two printouts indicated in the
rule, hence the scheduleTime is not null.
Now I wish to move the null verification to the LHS by modifying the rule to
(modification is marked in yellow):
rule "Test"
when
$ee: ExecutableEvent($taskId: taskid, Type.SOAR == type)
$tt: TaskTicket($id: id == $taskId, scheduledTime != null)
then
logger.info("Rule:test !!!"+$tt.toString());
if($tt.getScheduledTime() != null)
logger.info("Rule:test schedule is not null");
end
at this point running the system results in no printouts, hence the rule is
not true.
Any suggestion why this occurs and how to resolve this?
The origin of all of this is to add null pointer verification on fields that
I wish to use us in the LHS (not shown in the above example)
Thanks
Hezi
13 years, 8 months
difference between jBPM and drools?
by Stephan.Koops@We4IT.com
Hi,
I don't find much about the difference between jBPM and drools flow, only
that jBPM is the official one (
http://www.jboss.org/drools/drools-flow#Drools_Flow_and_jBPM, first
paragraph of the section) and rethinked. I'm interested for the practical
site.
Can anybody tell me about the advantages or disadvantages? What are the
main points to decide which one to use?
Maybe I missed a blog entry or something like that, but I don't find more.
A pointer or something else would be nice.
Thanks in advance.
Mit freundlichen Grüssen/Best regards
i. A.
Stephan Koops
Software Engineer
We4IT GmbH
***************************************************
Sie wollen aktuelle Informationen zu Lotus-Produkten? Dann besuchen Sie unseren Blog:
http://www.lotus-notes-domino-blog.de
***************************************************
We4IT GmbH
Technologiepark 11
33100 Paderborn
Tel: +49 5251 / 70993 - 24
Fax: +49 5251 / 70993 - 01
Mobil:
E-Mail: stephan.koops(a)we4it.com
Internet: http://www.we4it.com
HRB 20740, Amtsgericht Bremen
Geschäftsführer: Stefan Sucker, Vicente Diaz Fernandez
USt.-ID.-Nr. DE 220 859 831
Diese Nachricht ist vertraulich und ausschließlich für die adressierte Person und/oder Organisation bestimmt. Vertrauliche und/oder spezifische Informationen können hierin enthalten sein. Falls Sie ein nicht beabsichtigter Empfänger dieser Nachricht sind, sind das Kopieren, Verteilen und/oder das Aufnehmen aus dem Inhalt resultierender Handlungen untersagt. Haben Sie diese Nachricht fehlerhaft und/oder unvollständig erhalten, benachrichtigen Sie uns bitte umgehend unter unseren oben genannten Kontaktmöglichkeiten.
This message is confidential and intended solely for the person or organization to which it is addressed. It may contain privileged and confidential information. If you are not the intended recipient, you should not copy, distribute or take any action on reliance on it. If you have received this transmission in error, please notify us immediately by e-mail at the above address.
13 years, 8 months
Can Drools Flow Persistence Work without JTA
by Rui Tang
Hi list,
According to the documents and some test cases, I found that Drools Flow
persistence examples have to work with JTA to enable transaction management.
Is there some way to not use JTA as my transaction manager?
--
唐睿
13 years, 8 months
Hibernate session and 'from'
by Gareth Evans
Hello,
I am using Hibernate lazy loading in the facts I am inserting and am
noticing some odd behaviour when I use 'from'.
Here is a simplified example of my problem. In the first rule I just
want to populate the working memory with the Child objects, it uses
Hibernate lazy loading fine and inserts the facts, however in the
second rule I get an exception when accessing the GrandGrandChild
saying that the object does not have a session. If I add some debug
code to the first rule to access the GrandGrandChild I get the same
error.
This is using session-per-request and the Parent object was inserted
in the current session.
rule "get children - broken"
when
$parent : Parent( )
$child : Child( ) from $parent.children
then
insert($child);
end
rule "do stuff"
when
$child : Child( )
then
GrandChild grandChild = $child.getGrandChild();
# it blows up on the next line
GrandGrandChild grandGrandChild =
grandChild.getGrandGrandChild();
end
If I replace the first rule with the following everything works as
expected and I can match on Child objects and access whatever I wish,
so I know there should be a session available in the "do stuff" rule.
rule "get children - working"
when
$parent : Parent( )
then
for(Child child : $parent.getChildren()) {
insert(child);
}
end
I am able to use the "working" version in my code however the "broken"
version seems like the more correct way to do this in Drools. I'd like
to understand what is going on in case it is my fault or an issue I
need to be aware of. Could it be something to do with the from keyword
or the "cast" to Child( )? Is there some "magic" done in Drools which
could remove/invalidate the Hibernate proxy?
Thanks,
Gareth
13 years, 8 months
Re: [rules-users] Combination of conditions doesn't work
by FrankVhh
Hi Sariman,
The trick with "from entry-point", is quite unfamiliar to me. There might be
some problem with that, but I cannot tell by looking at it.
However, there are a few problems with the rules that you have printed out
for us.
1) The way I understand it, they do not do what they should be doing. You
said you do NOT want an action when all sensors evaluate to true. In your
case, you are evaluateing whether all sensors are false. This is pretty
useless if you already have a rule which evaluates the existence of at least
1 "true" sensor. The way I would put this is like this:
rule "Myrule"
when
#conditions
sensorEvent1: SensorEvent(booleanValue == true)
exists( SensorEvent(booleanValue == false) )
then
#actions
end
2) There are some errors in your rule. No idea whether this is a copy/paste
or a read/type, so I will just point them out.
- ";" is usually not needed in a LHS, I am not familiar with the from
entry-point syntax, but I assume it wouldn't be needed
- There is a ")" in excess in one of your conditions
3) I don't think it makes sense to put your rules as you did in the second
example. Even if you are trying to examine whether those three sensors are
false.
On a personal note: what does from entry-point do? I must have overlooked it
in the documentation.
Regards,
Frank
sariman wrote:
>
> To keep it short, I have three sensors providing me some values every x
> seconds. I am running an algorithm over those values and getting at the
> end a single value for each sensor. Next I check if this value is
> greater/less than a threshold value and creating an object and setting its
> booelan value to true/false. The last part looks like this:
>
> SensorEvent sensorEvent = new SensorEvent ();
> sensorEvent.setBoolean(booleanValue);
> sensorEvent.setSensorID(sensorID);
>
> I want to do some actions if one of the sensors has "true" and this works.
> But I want no action if all sensors have "true". And this part doens't
> work. If I only check one of the sensors if it is "false" it is ok but the
> combination doesn't work. It means this case seems naver to happen. No
> exception or error but no system print either. Here is the code snippet
> from my rules file:
>
> declare SensorEvent
> @role(event)
> end
>
>
> rule "All false"
>
> when
> #conditions
> sensorEvent1 : SensorEvent(sensorID == 1 , booleanValue == false) from
> entry-point "Default";
> sensorEvent2 : SensorEvent(sensorID == 5 , booleanValue == false) ) from
> entry-point "Default";
> sensorEvent3 : SensorEvent(sensorID == 6 , booleanValue == false) from
> entry-point "Default";
>
> then
> #actions
> System.out.println(" All false!! -> ");
>
> end
>
>
> I run the engine in stream mode and every single value (or object) is
> being inserted after I receieved the value. I also tried this variant but
> it didn't work either:
>
> rule "All false"
>
> when
> #conditions
> sensorEvent1 : SensorEvent(sensorID == 1 ) from entry-point "Default";
> sensorEvent2 : SensorEvent(sensorID == 5 ) from entry-point "Default";
> sensorEvent3 : SensorEvent(sensorID == 6 , booleanValue == false &&
> sensorEvent1.booleanValue == false && sensorEvent2.booleanValue == false))
> from entry-point "Default";
>
> then
> #actions
> System.out.println(" All false!! -> ");
>
> end
>
> Any suggestions?
>
--
View this message in context: http://drools-drools-expert-drools-fusion-guvnor-drools-planner.46999.n3....
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Help with Accumulate function
by dwipin
Hi,
I am having trouble implementing this rule with the accumulate function.
My rule requirement is -
Aggregate all PnlAttributionAmounts with a type of "UNEXPLAINED" for all
Positions for a given day.
Below is the code I have for this -
$position : Position(date == $currDate)
$posScn : PositionScenario(scenario == 'SCEN-EOD', position == $position )
$posScnGrp : PositionScenarioCurrencyGroup(positionScenario == $posScn,
currencyType == CurrencyTypes.TRANSACTIONAL)
$posPnlAmt : PositionPnlAmount(pnlAmountType == "DTD",
positionScenarioCurrencyGroup == $posScnGrp)
$attibAmtType : AttributionAmountType(attributionAmountType ==
"UNEXPLAINED/RESIDUALPNL")
$totalPnlAttibAmt : BigDecimal()
from accumulate(
PositionPnlAttributionAmount(positionPnlAmount ==
$posPnlAmt, attributionAmountType == $attibAmtType, $pnlAttibAmt :
financialValue)
,sum($pnlAttibAmt)
)
eval ($totalPnlAttibAmt > 1000)
When I do it this way, the rule gets executed 6 times, basically for every
fact that evaluated to true. How do I restrict this? The rule should be
executed only if the final eval results in true.
Thanks for any help,
Dwipin.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Help-with-Accumulate-...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 8 months