Guvnor 5.2 CR1 : problem with collect in guided editor
by Vincent LEGENDRE
Hi all
We gave a try with the CR1 version, and see that all "collect" clauses appears in grey and are not editable (such conditions are also not deletable). Everything was OK with the M2 version (rules were edited with this version).
It is quite strange because all the "collect" condition is greyed, just like a disabled field, and seems to be done by purpose. Is "collect" deprecated ?
Does anyone has the problem ?
13 years, 5 months
Agregate function count, the rule doesn't activates.
by Nicolás Sanchez
Hi,
I have written the next rule :
rule "Too many events in a short period of time"
dialect "mvel"
when
$user : User()
Number(intValue > 3) from accumulate($event : Event(userId == $user.id)
over window:time(1m) from entry-point Event , count($event))
then
//Java code...
end
And the events, I insert in the Event entrypoint, are 4 and have these
timestamps:
Calendar cal1 = Calendar.getInstance();
cal1.set(2010,9,23,10,30,00);
Calendar cal2 = Calendar.getInstance();
cal2.set(2010,9,23,10,30,05);
Calendar cal3 = Calendar.getInstance();
cal3.set(2010,9,23,10,30,10);
Calendar cal4 = Calendar.getInstance();
cal4.set(2010,9,23,10,30,15);
Has the rule any syntax or semantic problem, knowing that i aim to catch if
there has been more than 3 events in the last minute?
--
Nicolás Sanchez
13 years, 5 months
Drools/Camel Integration sending messages
by Andre
hi,
i´m new in the drools-dev family and just playing around: while playing, i
can´t get over the following problem:
i configurated drools/camel/activeMQ, i also receive messsages and can
maipulate the endpoints and so on but when i try to create a new exchange
(actually i´m copying on older one, because trying to type new JmsMessage()
ends in an "could not resolve constructor
org.apache.camel.component.jms.JmsMessage[]")
So at the end ,if i´m just manipulating an copied exchange, the exchange
will not be send by camel directly.
my Question is:
How do i use the drools/camel Integration Component to send
exchanges/messages out of the drl/then-part?
or which context can i use in the drl (e.g: DroolsEndpoint properties)/ is
there any context available?
thx, André
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Camel-Integration-sending-messag...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Is asterisk no longer valid in temporal constaints?
by Nathan Bell
In 5.1 this was valid syntax:
rule "OrderActiveInLast7Days"
when
$order : DrugOrder((start != null && start before $now),
(stop == null || stop after[-7d,*] $now))
then
#stuff
end
In 5.2.0.CR1 it complains about the asterisk. Is that no longer
supported?
The error I get is "no viable alternative at input '(' in rule
"OrderActiveInLast7Days"". If I remove the part of the constraint in
brackets "[-7d,*]" then it compiles.
Thank You,
Nathan Bell
13 years, 5 months
execute once for an accumulate
by dwipin
I have the following condition and consequence in one of my rules -
when
$position : PositionValuation() // returns 4 records
eval(helper.isSameDay($position.cobDate, $request.cobDate)) // filters 1,
so count =3
$pnl : PnL() from $position.pnl
$totalPnlValue : BigDecimal()
from accumulate(PnLTimeValue(type == "TOTAL", $pnlAmount : grc.value)
from $pnl.dtdAmount ,sum($pnlAmount))
then
logger.debug("variance :"+$totalPnlValue);
exception.setOrganisation($position.organisation);
exception.setCobDate($position.cobDate);
exception.setOrganisation($position.organisation);
exception.setTrade($position.trade);
$outputList.add(exception);
I want to have have the rule executed once for the accumulated value. How do
I achieve this?
Currently this gets executed 3 times.
Thanks,
Dwipin.
--
View this message in context: http://drools.46999.n3.nabble.com/execute-once-for-an-accumulate-tp305942...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Error opening process in Oryx editor (designer-1.0.0.052)
by Grzegorz Błaszczyk
Hi,
I started with a fresh JBoss installation:
* jbpm-5.0.0-installer-full.zip
** designer-1.0.0.052
** jboss-5.1.0.GA
** drools-guvnor 5.2.0.M1
** drools-5.2.0.M1
** eclipse-helios
There was a tiny problem with h2 artifact - it should be downloaded
from a different location (dedicated Nexus in JBoss.org network).
Things done after the installation:
1. samples in Guvnor installed
2. DRL and BPMN files of our process file and subprocesses from a
dedicated eclipse to Guvnor uploaded
3. package classes filtered out and package validated
4. package compiled
Up to now this went smootly.
After that when I open a process editor (Oryx) in Guvnor I get:
java.lang.IllegalArgumentException: No profile with the name drools
was registered
org.oryxeditor.server.EditorHandler.doGet(EditorHandler.java:286)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.intalio.web.filter.impl.PluggableFilter.doFilter(PluggableFilter.java:75)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
In JBoss console I get the same:
ERROR [EditorHandler] No profile with the name drools was registered
ERROR [[EditorHandler]] Servlet.service() for servlet EditorHandler
threw exception
java.lang.IllegalArgumentException: No profile with the name drools
was registered
at org.oryxeditor.server.EditorHandler.doGet(EditorHandler.java:286)
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(Thread.java:662)
I added a role in Guvnor named 'drools' with admin privileges but it
didn't solve the problem.
What should I configure to have a 'drools' profile and be able to open
the process in Oryx editor ?
Best regards,
Grzegorz Blaszczyk
13 years, 5 months
Using multiple Collect() From result in null pointer exception
by Hezi Stern
I have encountered the following issue when running a rule that has more
than 1 collect from a same collection.
I have the following two rules:
rule "filter sentences based on existence of attributes"
when
IPhoneQueryCmd(State.POPULATE == state,
$tidt: targetId)
$attributeFilteredSentences: ArrayList()
from collect (IPhoneSentences.Sentence(
( (descriptor.targetPrivatename == false) || (descriptor.targetPrivatename
== $cmt.sentenceFilters.targetPrivatename) ) &&
( (descriptor.targetSurename == false) || (descriptor.targetSurename ==
$cmt.sentenceFilters.targetSurename) ) &&
( (descriptor.targetFullname == false) || (descriptor.targetFullname ==
$cmt.sentenceFilters.targetFullname) ) &&
( (descriptor.requesterPrivatename == false) ||
(descriptor.requesterPrivatename ==
$cmt.sentenceFilters.requesterPrivatename) ) &&
( (descriptor.requesterSurename == false) || (descriptor.requesterSurename
== $cmt.sentenceFilters.requesterSurenamename) ) &&
( (descriptor.requesterFullname == false) || (descriptor.requesterFullname
== $cmt.sentenceFilters.requesterFullname) ) &&
( (descriptor.time == false) || (descriptor.time ==
$cmt.sentenceFilters.time) ) &&
( (descriptor.subject == false) || (descriptor.subject == $cmt.subject) )
))
then
end
rule "Iphone targets information update - QUERY_AVAILABILITY" extends
"filter sentences based on existence of attributes"
when
$qc: IPhoneQueryCmd(State.POPULATE == state, $tid:
targetId)
$cm: ConditionMatrix($taskId: taskId,
targetId ==
$tid,
contextIntention
== EContextIntention.QUERY_AVAILABILITY,
$timeConstraintType: requesterConstraint.constraintRequestType)
$targetResponse: ArrayList()
from collect
(IPhoneSentences.Sentence(descriptor.intentions.intention contains
EContextIntention.QUERY_AVAILABILITY.name)
from $attributeFilteredSentences)
then
//do something
End
This works fine but once I wish to add a second filtered ArrayList using
$attributeFilteredSentences I get a null pointer exception.
For example I will add an exact similar filter condition but change the
result var name (I called it $dummyVar)
rule "Iphone targets information update - QUERY_AVAILABILITY" extends
"filter sentences based on existence of attributes"
when
$qc: IPhoneQueryCmd(State.POPULATE == state, $tid:
targetId)
$cm: ConditionMatrix($taskId: taskId,
targetId ==
$tid,
contextIntention
== EContextIntention.QUERY_AVAILABILITY,
$timeConstraintType: requesterConstraint.constraintRequestType)
$targetResponse: ArrayList()
from collect
(IPhoneSentences.Sentence(descriptor.intentions.intention contains
EContextIntention.QUERY_AVAILABILITY.name)
from $attributeFilteredSentences)
$dummyVar: ArrayList()
from collect
(IPhoneSentences.Sentence(descriptor.intentions.intention contains
EContextIntention.QUERY_AVAILABILITY.name)
from $attributeFilteredSentences)
then
//do something
End
In this case I get the following exception stack:
org.drools.runtime.rule.ConsequenceException: rule: Iphone dialog sentence -
QUERY_AVAILABILITY
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleExcept
ion(DefaultConsequenceExceptionHandler.java:39)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:927)
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.j
ava:785)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.j
ava:751)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeS
essionImpl.java:218)
at
org.drools.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSess
ionImpl.java:302)
at
com.delegatecom.task.TaskStatelessSession.testRunRules(TaskStatelessSession.
java:122)
at
com.delegatecom.task.TaskStatelessSession.internalTestNextStep(TaskStateless
Session.java:98)
at
com.delegatecom.task.TaskStatelessSession.testNextStep(TaskStatelessSession.
java:76)
at com.delegatecom.test.AtoB.testStatelessRule(AtoB.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.
java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.j
ava:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.ja
va:41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.jav
a:20)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.jav
a:76)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.jav
a:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28
)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestRef
erence.java:46)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:3
8)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:197)
Caused by: java.lang.NullPointerException
at
org.drools.reteoo.AccumulateNode.getFirstMatch(AccumulateNode.java:967)
at org.drools.reteoo.AccumulateNode.splitList(AccumulateNode.java:920)
at
org.drools.reteoo.AccumulateNode.removePreviousMatchesForLeftTuple(Accumulat
eNode.java:874)
at
org.drools.reteoo.AccumulateNode.retractLeftTuple(AccumulateNode.java:205)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateRetractLeftTuple(
CompositeLeftTupleSinkAdapter.java:238)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateRetractLeftTupleDes
troyRightTuple(CompositeLeftTupleSinkAdapter.java:138)
at
org.drools.reteoo.AccumulateNode.retractLeftTuple(AccumulateNode.java:212)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateRetractLeftTuple(
CompositeLeftTupleSinkAdapter.java:238)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateRetractLeftTuple(Co
mpositeLeftTupleSinkAdapter.java:122)
at org.drools.reteoo.JoinNode.retractLeftTuple(JoinNode.java:163)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateRetractLeftTuple(Sin
gleLeftTupleSinkAdapter.java:217)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateRetractLeftTuple(Singl
eLeftTupleSinkAdapter.java:91)
at org.drools.reteoo.JoinNode.retractLeftTuple(JoinNode.java:163)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateRetractLeftTuple(Sin
gleLeftTupleSinkAdapter.java:217)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateRetractLeftTupleDestro
yRightTuple(SingleLeftTupleSinkAdapter.java:107)
at
org.drools.reteoo.AccumulateNode.retractLeftTuple(AccumulateNode.java:212)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateRetractLeftTuple(
CompositeLeftTupleSinkAdapter.java:238)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateRetractLeftTuple(Co
mpositeLeftTupleSinkAdapter.java:122)
at org.drools.reteoo.JoinNode.retractLeftTuple(JoinNode.java:163)
at
org.drools.reteoo.ModifyPreviousTuples.retractTuples(ModifyPreviousTuples.ja
va:111)
at
org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:176)
at
org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:14
42)
at
org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:13
49)
at
org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:18
3)
at
org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:19
6)
at
com.delegatecom.rules.drl.Rule_Iphone_dialog_sentence___QUERY_AVAILABILITY_0
.defaultConsequence(Rule_Iphone_dialog_sentence___QUERY_AVAILABILITY_0.java:
27)
at
com.delegatecom.rules.drl.Rule_Iphone_dialog_sentence___QUERY_AVAILABILITY_0
DefaultConsequenceInvoker.evaluate(Rule_Iphone_dialog_sentence___QUERY_AVAIL
ABILITY_0DefaultConsequenceInvoker.java:65)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:917)
... 33 more
Any idea what this can be?
Regards,
Hezi
13 years, 5 months
FW: Drools in non-eclipse environment
by Abhay B. Chaware
Any ideas folks ?
________________________________
From: Abhay B. Chaware
Sent: Friday, June 10, 2011 12:54 PM
To: 'Rules Users List'
Subject: RE: [rules-users] Drools in non-eclipse environment
The ride's real fun :)
Got apache harmony's beans.jar to work .. now , when I am reading the serialized knowledgebase object on android, quite obvious, it is throwing this error -
java.lang.UnsupportedOperationException: can't load this type of class file
since my serialized knowledgebase object is in java format .. and not dex. Can this serialized version be converted into .dex format using the "dx" utility - pre or post serialization ? I tried the "dx" tool on the serialized object, but it doesn't seem to understand the format.
-abhay
________________________________
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Thursday, June 09, 2011 6:37 PM
To: Rules Users List
Subject: Re: [rules-users] Drools in non-eclipse environment
http://meteatamel.wordpress.com/2010/08/25/android-api-and-java-beans-pac...
http://meteatamel.wordpress.com/2010/09/28/android-api-and-java-beans-pac...
Enjoy the ride ;)
2011/6/9 Abhay B. Chaware <Abhay.Chaware(a)kpitcummins.com<mailto:Abhay.Chaware@kpitcummins.com>>
woo hooo ! I got past that problem :) But a new one's here now.
Looks like MVEL is not liking something :)
W/dalvikvm(29977): VFY: unable to resolve static method 164: Ljava/beans/Introspector;.decapitalize (Ljava/lang/String;)Ljava/lang
/String;
W/dalvikvm(29977): threadid=1: thread exiting with uncaught exception (group=0x40020ac0)
E/AndroidRuntime(29977): FATAL EXCEPTION: main
E/AndroidRuntime(29977): java.lang.NoClassDefFoundError: java.beans.Introspector
E/AndroidRuntime(29977): at org.drools.core.util.asm.ClassFieldInspector.calcFieldName(ClassFieldInspector.java:298)
E/AndroidRuntime(29977): at org.drools.core.util.asm.ClassFieldInspector.addToMapping(ClassFieldInspector.java:216)
E/AndroidRuntime(29977): at org.drools.core.util.asm.ClassFieldInspector.processClassWithoutByteCode(ClassFieldInspector.ja
va:148)
E/AndroidRuntime(29977): at org.drools.core.util.asm.ClassFieldInspector.<init>(ClassFieldInspector.java:83)
E/AndroidRuntime(29977): at org.drools.core.util.asm.ClassFieldInspector.<init>(ClassFieldInspector.java:64)
E/AndroidRuntime(29977): at org.drools.base.ClassFieldAccessorFactory.getClassFieldReader(ClassFieldAccessorFactory.java:11
8)
E/AndroidRuntime(29977): at org.drools.base.ClassFieldAccessorCache$CacheEntry.getReadAccessor(ClassFieldAccessorCache.java
:168)
E/AndroidRuntime(29977): at org.drools.base.ClassFieldAccessorCache.getReadAcessor(ClassFieldAccessorCache.java:101)
E/AndroidRuntime(29977): at org.drools.base.ClassFieldAccessorStore.wire(ClassFieldAccessorStore.java:404)
E/AndroidRuntime(29977): at org.drools.base.ClassFieldAccessorStore.wire(ClassFieldAccessorStore.java:374)
E/AndroidRuntime(29977): at org.drools.common.AbstractRuleBase.readExternal(AbstractRuleBase.java:295)
E/AndroidRuntime(29977): at org.drools.reteoo.ReteooRuleBase.readExternal(ReteooRuleBase.java:236)
E/AndroidRuntime(29977): at org.drools.impl.KnowledgeBaseImpl.readExternal(KnowledgeBaseImpl.java:108)
E/AndroidRuntime(29977): at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2127)
E/AndroidRuntime(29977): at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:929)
E/AndroidRuntime(29977): at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2285)
E/AndroidRuntime(29977): at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2240)
E/AndroidRuntime(29977): at com.ts.DBconnector.execPackageByPath(DBconnector.java:219)
E/AndroidRuntime(29977): at com.first.FirstActivity.onCreate(FirstActivity.java:77)
E/AndroidRuntime(29977): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime(29977): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
E/AndroidRuntime(29977): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime(29977): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
E/AndroidRuntime(29977): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime(29977): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(29977): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(29977): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(29977): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(29977): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(29977): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime(29977): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime(29977): at dalvik.system.NativeStart.main(Native Method)
________________________________
From: rules-users-bounces(a)lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org> [mailto:rules-users-bounces@lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org>] On Behalf Of Michael Anstis
Sent: Thursday, June 09, 2011 4:51 PM
To: Rules Users List
Subject: Re: [rules-users] Drools in non-eclipse environment
Great news :)
Please do feedback... if you get it working I'll make a blog entry on your behalf as you are not the first (or last) to try Drools on Android.
With kind regards,
Mike
2011/6/9 Abhay B. Chaware <Abhay.Chaware(a)kpitcummins.com<mailto:Abhay.Chaware@kpitcummins.com>>
That's exactly what I am trying out at the moment .. option - b. Pre-compile, serialize and unserialize ...I'll share the results.
Also rule file's there at the location mentioned. So that's not a problem.
I've gone through the blog you mentioned ... and as you indicated, it's only jbpm .. no rules ...
thanks
abhay
________________________________
From: rules-users-bounces(a)lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org> [mailto:rules-users-bounces@lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org>] On Behalf Of Michael Anstis
Sent: Thursday, June 09, 2011 4:07 PM
To: Rules Users List
Subject: Re: [rules-users] Drools in non-eclipse environment
Preparing to be shouted down, but isn't it impossible to compile DRL on Android and the suggestion is to load pre-serialised KnowledgeBases?
Also, as another observation, are you sure the DRL was indeed found and the NPE is not caused by "com.ts.DBconnector.readKnowledgeBase(DBconnector.java:143)" perhaps passing a null to KnowledgeBuilder?
Have you looked at http://blog.athico.com/2011/03/jbpm5-lightweight-running-on-android.html, which might give some pointers - although it is only jBPM and not rules themselves.
With kind regards,
Mike
On 9 June 2011 11:11, Abhay B. Chaware <Abhay.Chaware(a)kpitcummins.com<mailto:Abhay.Chaware@kpitcummins.com>> wrote:
This is what I did.
Properties properties = new Properties();
properties.put("drools.dialect.java.compiler", "JANINO");
KnowledgeBuilderConfiguration kbConfig = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration( properties, (ClassLoader[]) null );
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(kbConfig);
kbuilder.add(ResourceFactory.newInputStreamResource(is), ResourceType.DRL);
I am getting same error with KnowledgeBuilderConfiguration ..
W/System.err(27303): java.lang.NullPointerException
W/System.err(27303): at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:47)
W/System.err(27303): at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1161)
W/System.err(27303): at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:637)
W/System.err(27303): at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:267)
W/System.err(27303): at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:459)
W/System.err(27303): at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
W/System.err(27303): at com.ts.DBconnector.readKnowledgeBase(DBconnector.java:143)
W/System.err(27303): at com.first.FirstActivity.onCreate(FirstActivity.java:64)
W/System.err(27303): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
W/System.err(27303): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
W/System.err(27303): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
W/System.err(27303): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
________________________________________
From: rules-users-bounces(a)lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org> [rules-users-bounces(a)lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org>] On Behalf Of Wolfgang Laun [wolfgang.laun(a)gmail.com<mailto:wolfgang.laun@gmail.com>]
Sent: Thursday, June 09, 2011 2:46 PM
To: Rules Users List
Subject: Re: [rules-users] Drools in non-eclipse environment
You might try this:
Properties props = new Properties();
props.put( "drools.dialect.java.compiler", "JANINO" );
KnowledgeBuilderConfiguration kbConfig =
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration( props, (ClassLoader[]) null );
Requires the janino jar in your classpath, which I have as
~/.m2/repository/janino/janino/2.5.15/janino-2.5.15.jar
-W
On 9 June 2011 10:29, Abhay B. Chaware <Abhay.Chaware(a)kpitcummins.com<mailto:Abhay.Chaware@kpitcummins.com><mailto:Abhay.Chaware@kpitcummins.com<mailto:Abhay.Chaware@kpitcummins.com>>> wrote:
I am using drools 5.1.0
Let me explain what I am trying to do. I am trying to write a drools app on to android platform. In my app, I have added following jars in the application classpath -
antlr-runtime.jar
drools-api.jar
drools-compiler.jar
drools-core.jar
mvel2.jar
Do I need any other jar files ?
upon drilling down into the Null Pointer Exception, it appears that it is throwing NPE at following line inside RuleBuilder.java
RuleConditionBuilder builder = (RuleConditionBuilder)context.getDialect().getBuilder(ruleDescr.getLhs().getClass());
and on further drilling, I found that "context.getDialect()" is retuning NULL.
Then I put some debug inside PackageBuilder.java
upon drilling down for the error, found out that it is not able to set the context's dialect.
ctr.getDialect(pkgRegistry.getDialect()) gives "null" ...
DialectCompiletimeRegistry ctr = pkgRegistry.getDialectCompiletimeRegistry();
RuleBuildContext context = new RuleBuildContext(this, ruleDescr, ctr, pkg, ctr.getDialect(pkgRegistry.getDialect()));
Is there any default setting /configuration that I am obviously missing ?
what could be the problem ?
-abhay
________________________________________
From: rules-users-bounces(a)lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org><mailto:rules-users-bounces@lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org>> [rules-users-bounces(a)lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org><mailto:rules-users-bounces@lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org>>] On Behalf Of Swindells, Thomas [TSwindells(a)nds.com<mailto:TSwindells@nds.com><mailto:TSwindells@nds.com<mailto:TSwindells@nds.com>>]
Sent: Thursday, June 09, 2011 1:40 PM
To: Rules Users List
Subject: Re: [rules-users] Drools in non-eclipse environment
Which version of drools is this?
For drools 5.0.1 we just use maven to resolve the dependencies for us and it works fine. I can't obviously see any eclipse compiler in the jars that we distribute with our application.
Thomas
> -----Original Message-----
> From: rules-users-bounces(a)lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org><mailto:rules-users-bounces@lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org>> [mailto:rules-users-<mailto:rules-users-><mailto:rules-users-<mailto:rules-users->>
> bounces(a)lists.jboss.org<mailto:bounces@lists.jboss.org><mailto:bounces@lists.jboss.org<mailto:bounces@lists.jboss.org>>] On Behalf Of Abhay B. Chaware
> Sent: 09 June 2011 08:06
> To: rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org><mailto:rules-users@lists.jboss.org<mailto:rules-users@lists.jboss.org>>
> Subject: [rules-users] Drools in non-eclipse environment
>
> Has anyone tried using drools in non-eclipse env ? meaning that
> org.eclipse.jdt.core_3.5.1.v_972_R35x.jar is not in the classpath ?
>
> Documentation says this :
>
> (http://docs.huihoo.com/drools/4.0.7/ch02s05.html)
>
> if you do not have Eclipse JDT Core in your classpath you must override the
> compiler setting before you instantiate this PackageBuilder, you can either
> do that with a packagebuilder properties file the ChainedProperties class will
> find, or you can do it programmatically as shown below; note this time I use
> properties to inject the value for startup.
>
> They also provide an example, but I am not able to figure out exactly how to
> use this example/info.
>
> Here is my code :
>
> KnowledgeBuilder kbuilder =
> KnowledgeBuilderFactory.newKnowledgeBuilder();
> kbuilder.add(ResourceFactory.newInputStreamResource(is),
> ResourceType.DRL);
>
> where "is" is input stream containing the rule file ( .drl)
>
> How do I override the compiler setting ?
>
> I am getting a null pointer exception ( see below ) and I suspect that
> overriding the packagebuilderconfiguration will fix it ?
>
> W/System.err(25511): java.lang.NullPointerException
> W/System.err(25511): at
> org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:47)
> W/System.err(25511): at
> org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1161)
> W/System.err(25511): at
> org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:637)
> W/System.err(25511): at
> org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java
> :267)
> W/System.err(25511): at
> org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder
> .java:459)
> W/System.err(25511): at
> org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.ja
> va:28)
> W/System.err(25511): at
> com.ts.DBconnector.readKnowledgeBase(DBconnector.java:146)
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org><mailto:rules-users@lists.jboss.org<mailto:rules-users@lists.jboss.org>>
> https://lists.jboss.org/mailman/listinfo/rules-users
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com<mailto:postmaster@nds.com><mailto:postmaster@nds.com<mailto:postmaster@nds.com>> and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org><mailto:rules-users@lists.jboss.org<mailto:rules-users@lists.jboss.org>>
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org><mailto:rules-users@lists.jboss.org<mailto:rules-users@lists.jboss.org>>
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users
This message contains information that may be privileged or confidential and is the property of the KPIT Cummins Infosystems Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins Infosystems Ltd. does not accept any liability for virus infected mails.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users
This message contains information that may be privileged or confidential and is the property of the KPIT Cummins Infosystems Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins Infosystems Ltd. does not accept any liability for virus infected mails.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users
13 years, 5 months
Drools 5.2.0.M2 is not compatible with JDK 1.5?
by style.x7
Hi all,
I'm just trying out the default Drools project created with Eclipse plugin
but already getting errors:
java.lang.NoSuchMethodError:
java.util.LinkedList.peekLast()Ljava/lang/Object;
at
org.drools.rule.builder.dialect.java.parser.JavaParser.addBlockDescr(JavaParser.java:249)
at
org.drools.rule.builder.dialect.java.parser.JavaParser.updateStatement(JavaParser.java:6934)
at
org.drools.rule.builder.dialect.java.parser.JavaParser.statement(JavaParser.java:6117)
at
org.drools.rule.builder.dialect.java.parser.JavaParser.blockStatement(JavaParser.java:5733)
at
org.drools.rule.builder.dialect.java.parser.JavaParser.block(JavaParser.java:5662)
at
org.drools.rule.builder.dialect.java.JavaExprAnalyzer.analyzeBlock(JavaExprAnalyzer.java:92)
at
org.drools.rule.builder.dialect.java.JavaDialect.analyzeBlock(JavaDialect.java:258)
at
org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.build(JavaConsequenceBuilder.java:90)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:98)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1546)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:653)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:295)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:471)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
...
peekLast() is a JDK 1.6 method.. so does that means from Drools 5.2x
onwards, I have to upgrade my JDK? Which sadly I can't cause my company is
using OSX Leopard, stuck with JDK 1.5 :(
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-5-2-0-M2-is-not-compatible-with-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months