JPAKnowledgeService with ProtobufMarshaller
by Dilyan Dokov
Hi,
everybody.
Can I use Google's Protobuf instead of java.io.Serialization for automatic
knowledge session persistence?
I'm trying to figure this out for several hours now and I think I'm missing
something.
I'm using drools 5.5.0 and JPAKnowledgeService for automatic persistence of
the knowledge session in a mysql database. Ofcourse, there are backward
compatability problems because it is using vanilla java serialization. I can
see there is a ProtobufMarshaller implementation in the sources but can I
configure JPAKnowledgeService to use it instead.
Best regards,
Dilyan Dokov.
--
View this message in context: http://drools.46999.n3.nabble.com/JPAKnowledgeService-with-ProtobufMarsha...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
do I have to use temporary variable to overcome data casting issue ?
by Martin Minka
I continue to play with the code attached to
https://issues.jboss.org/browse/DROOLS-136 in src.zip. Updated invoice.drl
is attached in this mail.
I changed the rule "calculate totalPrice per item" to MVEL and trying to
calculate and set totalPrice with one liner:
((DataItemPrice)$v).setTotalPrice(((DataItemPrice)$v).getQty()*((DataItemPrice)$v).getUnitPrice());
but that fails with message: java.lang.IllegalArgumentException: object is
not an instance of declaring class
On the other hand using temporary variable of type Double will work. Here
is the complete rule which works up to the comment "// THIS IS DOESN'T
WORK":
rule "calculate totalPrice per item"
salience -10
no-loop
when
$q:Message(id=="item", answered==true,
value instanceof DataItemPrice, $v:value
)
then
System.out.println("setting totalPrice on item: " +
((DataItemPrice)$v).getName());
System.out.println("qty*unitPrice=" +
((DataItemPrice)$v).getQty()*((DataItemPrice)$v).getUnitPrice());
* Double d =
((DataItemPrice)$v).getQty()*((DataItemPrice)$v).getUnitPrice();
((DataItemPrice)$v).setTotalPrice(d);
* System.out.println("setting via temporary variable worked");
// THIS IS DOESN'T WORK
*
((DataItemPrice)$v).setTotalPrice(((DataItemPrice)$v).getQty()*((DataItemPrice)$v).getUnitPrice());
*
System.out.println("setting directly works ???");
update($q);
end
Am I again wrongly hoping that MVEL will simplify data types casting ? Or
should I fail a bug ?
12 years, 8 months
is property type casting into variable supported ?
by Martin Minka
I filled bug https://issues.jboss.org/browse/DROOLS-136 because the way I
tried to use # symbol hangs Drools.
I would like to ask the group if following type casting is supported in
Drools in Java or in MVEL:
rule "calculate totalPrice per item"
salience -10
no-loop
dialect "java"
when
$q:Message(id=="item", answered==true, $v:value#DataItemPrice)
then
System.out.println("this works: " + ((DataItemPrice)$v).getName());
// will this also work ? at least in MVEL
System.out.println("will this work ?: " + $v.getName());
end
thank you,
Martin Minka
12 years, 8 months
Room to optimize or bug? Unnecessary calls to unused method
by Sonata
Hi, I am using 5.5.0.final on jdk7(64bit). To repeat the test, simply create
a new Drools project in Eclipse. Tick the option to create a default Hello
World project. Go to the DroolsTest.java file, edit main() to
and edit getMessage() to
Next, remove the two rules in Sample.drl, use this simple rule instead
Then you can see the output
Which means, getMessage() is called 4 times in this simple rule. I really
wonder why. Is this a bug? Some non-optimized routine? An edge case?
Now try this
and the output is
Just once. It seems all good. Because getMessage() is needed to call once to
check with null, which is very fair to me.
Now something really funny
and the output
An extra call to getMessage() at the end, total 5 times!
TBH, I really only expect calling getMessage() once in all these tests.
Please put it to my face and tell me my test is so flawed.
--
View this message in context: http://drools.46999.n3.nabble.com/Room-to-optimize-or-bug-Unnecessary-cal...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
[Planner] Planning problem - looking for tips, and advices for complicated case
by Mz
Hello,
I'm having a problem to plan my solver, I'm wondering if it's possible to
configure the solver, so that it picks the best solution from multiple
collections of planning variables. Here is an example, to be more precise:
I have 3 planning variables: X, Y, Z. and many collections of values of
these variables. For example, collection A contains three X values, five Y
values, and two Z values; other collection would contain different values
etc. And the problem is that the values from different collections can't be
mixed with each other, and I don't know how to prevent that.
I have tried different approaches but with no luck... Tried to mix all of
the values together identifying them with a collection ID, and setting in
rules a negative score for the ones that are not from the same collection,
but its very inefficient, and the solver never stops (despite the fact that
the timeout was set for 120sec).
I was thinking about using multiple @PlanningEntities, but as far as I know
it is not supported, so I have resigned from this idea.
I have also tried using @ValueRange type FROM_PLANNING_ENTITY_PROPERTY, and
in MoveFactory I have changed planningEntityProperty according to the
collection I was using, but it led to exception "Corrupted Undo Move", and
all in all I think it was a bad idea.
My last idea, which I have not tested yet, is to make two different solvers,
one would find best solution for the given collection, and from all of the
best solutions from these collections, the next solver would pick the best
one, but I think this might be a very inefficient way of doing it.
I'm really sorry if I made this post very hard to understand, but my problem
is a bit more complicated then it sound, and its hard to describe it :P I
would appreciate any tips/ideas how I could configure/plan my solver, and
rules so it would work better.
Thanks in advance,
Mateusz
--
View this message in context: http://drools.46999.n3.nabble.com/Planner-Planning-problem-looking-for-ti...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
Agenda-group in fact insert time
by Sonata
Hi, I just noticed that even I have different agenda-groups, all groups are
evaluated during fact inset time.
In an extreme case, if I have 1000 rules in agenda-group "A", and 1 rule in
agenda-group "B"
even though I just want to fire the 1 rule in agenda-group "B" by adding
AgendaFilter in fireAllRules()
all those 1000 rules in agenda-group "A" will be evaluated (i.e. methods in
the "when" part are being called)
even worst if I have complex logic in the "when" part for these 1000 rules,
e.g. accumulate/from, not to mention eval
Isn't that quite a performance impact? And forcing people to put their
logic/checking/matching in the "then" part?
How would you justify this? Or is there something I've missed that you can
actually evaluate the rule in agenda-group "B" ONLY, when fact is being
inserted?
Thank you
--
View this message in context: http://drools.46999.n3.nabble.com/Agenda-group-in-fact-insert-time-tp4023...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
Deploying guvnor 5.5.1 Snapshot on websphere AS 7.0
by abhinay_agarwal
While Deploying guvnor 5.5.1 -Snapshot on websphere 7.0 i am getting the
following error
[5/9/13 12:11:18:521 IST] 00000007 AdminHelper A ADMN1009I: An attempt
is made to start the drools-guvnorEAR application.
[5/9/13 12:11:18:568 IST] 00000007 CompositionUn A WSVR0190I: Starting
composition unit WebSphere:cuname=drools-guvnorEAR in BLA
WebSphere:blaname=drools-guvnorEAR.
[5/9/13 12:11:51:421 IST] 00000007 ApplicationMg A WSVR0200I: Starting
application: drools-guvnorEAR
[5/9/13 12:11:51:421 IST] 00000007 ApplicationMg A WSVR0204I: Application:
drools-guvnorEAR Application build level: Unknown
[5/9/13 12:11:51:811 IST] 00000007 webapp I
com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0169I: Loading Web
Module: JBoss Guvnor for Drools.
[5/9/13 12:11:52:076 IST] 00000007 InjectionProc E CWNEN0044E: A resource
reference binding could not be found for the BeanManager resource reference,
defined for the JBoss Guvnor for Drools component.
[5/9/13 12:11:53:074 IST] 00000007 FfdcProvider W
com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident
emitted on D:\Program
Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.52.5753476655115778206616.txt
com.ibm.ws.injectionengine.InjectionEngineImpl.processBindings 480
[5/9/13 12:11:53:121 IST] 00000007 InjectionEngi E CWNEN0011E: The
injection engine failed to process bindings for the metadata.
[5/9/13 12:11:53:215 IST] 00000007 FfdcProvider W
com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident
emitted on D:\Program
Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.53.1839095875068220164390.txt
com.ibm.ws.util.ComponentNameSpaceHelper.populateJavaNameSpace 640
[5/9/13 12:11:53:215 IST] 00000007 ComponentName E CNTR0125E: Unable to
process injection information for class: [class
org.drools.guvnor.server.repository.SafeWeldListener].
[5/9/13 12:11:53:386 IST] 00000007 FfdcProvider W
com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident
emitted on D:\Program
Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.53.2612645496587947147575.txt
com.ibm.ws.webcontainer.webapp.WebGroup 131
[5/9/13 12:11:53:386 IST] 00000007 webapp E
com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0015E: Failure to
initialize Web application JBoss Guvnor for Drools
[5/9/13 12:11:53:558 IST] 00000007 FfdcProvider W
com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident
emitted on D:\Program
Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.53.3864474793422569466133.txt
com.ibm.ws.webcontainer.WebContainer 736
[5/9/13 12:11:53:651 IST] 00000007 FfdcProvider W
com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident
emitted on D:\Program
Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.53.5581434492717138337900.txt
com.ibm.ws.runtime.component.WebContainerImpl.install 124
[5/9/13 12:11:53:683 IST] 00000007 DeployedAppli W WSVR0206E: Module,
drools-guvnor.war, of application,
drools-guvnorEAR.ear/deployments/drools-guvnorEAR, failed to start
[5/9/13 12:11:53:683 IST] 00000007 ApplicationMg W WSVR0101W: An error
occurred starting, drools-guvnorEAR
[5/9/13 12:11:53:683 IST] 00000007 ApplicationMg A WSVR0217I: Stopping
application: drools-guvnorEAR
[5/9/13 12:11:53:714 IST] 00000007 FfdcProvider W
com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident
emitted on D:\Program
Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.53.7148569466503349536987.txt
com.ibm.ws.wsaddressing.urimap.EndpointMappingListener 1:196:1.8
[5/9/13 12:11:54:010 IST] 00000007 ApplicationMg A WSVR0220I: Application
stopped: drools-guvnorEAR
[5/9/13 12:11:54:322 IST] 00000007 FfdcProvider W
com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident
emitted on D:\Program
Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.54.0106549968453388597889.txt
com.ibm.ws.runtime.component.ApplicationMgrImpl 1449
[5/9/13 12:11:54:322 IST] 00000007 CompositionUn E WSVR0194E: Composition
unit WebSphere:cuname=drools-guvnorEAR in BLA
WebSphere:blaname=drools-guvnorEAR failed to start.
[5/9/13 12:11:54:447 IST] 00000007 DMAdapter I
com.ibm.ws.ffdc.impl.DMAdapter getAnalysisEngine FFDC1009I: Analysis Engine
using data base: D:\Program
Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\properties\logbr\ffdc\adv\ffdcdb.xml
[5/9/13 12:11:54:556 IST] 00000007 FfdcProvider W
com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident
emitted on D:\Program
Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.54.3535465789859844096183.txt
com.ibm.ws.management.AdminServiceImpl.invoke 679
[5/9/13 12:11:54:556 IST] 00000007 AppManagement W Unable to start:
drools-guvnorEAR using:
WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=BHUKRK286014DNode01,version=7.0.0.11,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=BHUKRK286014DNode01Cell,spec=1.0
exception is: javax.management.MBeanException: Exception thrown in
RequiredModelMBean while trying to invoke operation startApplication
[5/9/13 12:11:54:619 IST] 00000007 FfdcProvider W
com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident
emitted on D:\Program
Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.54.6198303816507559970350.txt
com.ibm.ws.management.application.AppManagementImpl.startApplication 1332
Any idea about this error ?
Thanks,
Abhinay
--
View this message in context: http://drools.46999.n3.nabble.com/Deploying-guvnor-5-5-1-Snapshot-on-webs...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
Use of the binding variable
by IPatel
Hi,
I am having little bit difficulty in understanding "binding variable"
concept in the guvnor. During our POC a business user asked me question
around this and i was able to save myself by telling them that the binding
variable is used in case you want use the fact again in Then statement.
(This is how i see it in the examples of rules).
Can anyone please explaining me the real use of the binding variable so that
i can help my business partner understand it properly?
Thank you for your help in advance
Isha
--
View this message in context: http://drools.46999.n3.nabble.com/Use-of-the-binding-variable-tp4023744.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
Odd behavior on timeInMillis after[15m, 96h] otherTimeInMillis
by ScalaEnthusiast
I am attempting to use the after[start, end] construct with two time values
being returned in milliseconds.
We are effectively using Drools 5.3 (BRMS 5.3.1).
Here is what I have (field names changed, etc due to nature of data):
//---------------------------------------------
global String someInsertedConstant;
global Calendar myCurrentTime; // calculated just before inserting as
global.
rule "compare time in millis"
dialect "java"
when
$someObject : SomeObjectClass ( field1 == someInsertedConstant,
field2 == null,
myCurrentTime.timeInMillis after[15m, 96h]
someObject.getTime().getTimeInMillis ) from entry-point "SomeEntryPoint"
then
System.out.println("Boo-yah!!!");
//-------------------------
This does not send out a Boo-yah!!! as I would expect, when myCurrentime is
15 minutes or more past someObject.getTime(). However, I have another rule
just like this, where the only difference is the after is [0m,15m] instead,
and it gives a Boo-yah!!! as it should when myCurrentTime is up to 15
minutes past someObject.getTime(). Both rules are together in the same
package.
Am I missing something here? In the first case, "after[15m, 96h]", I can
change that line to manually subtract the two times as longs and compare
against being >= 900000 and it fires as it should. This appears to be a bug,
but I am not entirely sure as I am fairly new to the rule world.
What am I missing?
Thanks,
ScalaEnthusiast
--
View this message in context: http://drools.46999.n3.nabble.com/Odd-behavior-on-timeInMillis-after-15m-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
Grid Node Null Pointer Exception
by Jason Barto
I am attempting to, using Camel, receive AMQP messages from RabbitMQ and
pass them into a Drools Fusion engine. As my starting point I have a 4
line bit of Java code that instantiates Camel and passes it the camel XML
pasted below. Is it apparent to anyone where I've gone wrong that I
receive a NPE while the system is calling the init method for 'node1'?
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rabbit="http://www.springframework.org/schema/rabbit"
xmlns:drools="http://drools.org/schema/drools-spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/rabbit
http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd
http://drools.org/schema/drools-spring
http://drools.org/schema/drools-spring.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="droolsPolicy" class="org.drools.camel.component.DroolsPolicy"
/>
<drools:grid-node id="node1"/>
<drools:kbase id="kbase1" node="node1">
<drools:configuration>
<drools:mbeans enabled="true"/>
</drools:configuration>
<drools:resources>
<drools:resource type="DRL"
source="classpath:drools-rules.drl"/>
</drools:resources>
</drools:kbase>
<drools:ksession id="ksession1" type="stateful" name="ksession1"
kbase="kbase1" node="node1"/>
<bean id="drools" class="org.drools.camel.component.DroolsComponent"/>
<bean id="jsonMessageConverter"
class="amqp.spring.converter.XStreamConverter"/>
<bean id="textMessageConverter"
class="amqp.spring.converter.StringConverter"/>
<bean id="messageConverter"
class="amqp.spring.converter.ContentTypeConverterFactory">
<property name="converters">
<map>
<entry key="application/json"
value-ref="jsonMessageConverter"/>
<entry key="application/xml"
value-ref="textMessageConverter"/>
</map>
</property>
<property name="fallbackConverter" ref="textMessageConverter"/>
</bean>
<rabbit:connection-factory id="connectionFactory" host="127.0.0.1"
port="5672" />
<rabbit:template id="amqpTemplate"
connection-factory="connectionFactory" message-converter="messageConverter"
reply-timeout="60000"/>
<rabbit:admin connection-factory="connectionFactory"/>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="stream:in?promptMessage=Enter something: "/>
<to uri="spring-amqp:cml.direct:a.b.c?type=direct"/>
</route>
<route>
<from uri="spring-amqp:cml.direct:springd:a.b.c?type=direct" />
<transform>
<simple>${body.toUpperCase()}</simple>
</transform>
<to uri="spring-amqp:cml.topic:a.b.c"/>
</route>
<route>
<from uri="spring-amqp:cml.topic:springt:#?type=topic" />
<to uri="stream:out"/>
</route>
</camelContext>
</beans>
I'm still extremely new to Drools, Camel, BRMS and my ultimate goal is to
have BRMS running, receiving events from RabbitMQ. This is one step along
my learning to achieve that goal so any help that can be offered is very
much appreciated.
It's potentially worth noting that the JAR files I'm running for this are
from the Drools-jBPM Integration 5.5 distribution.
Sincerely,
Jason
12 years, 8 months
How to write Hibernate query lang(HQL) in .DRL file
by zeeshan
Hi !
According to my requirement I need to fetch and Insert data from database
using Hibernate Query from .DRL file.
I have idea how to execute HQL in Plain Java class but according to my
requirement,I need to fire query to database from .DRL file which I tried
but unable to get output instead I was getting errors.
Can anyone suggest me process to execute Hibernate Query from DRL file
or please provide me some sample code or any link.
Thanks !!
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-write-Hibernate-query-lang-HQL-i...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
Performing Hibernate NativeSQLQuery in Drools
by Roopa
Hi,
I need some inputs on integrating Hibernate with Drools platform.
Please do help me executing nativeSQLQuery of Hibernate in Drools DRL file
In Java file, setting the session as global parameter in Drools
droolsSession.setGlobal("hibernateSession", session);
and in the DRL file, in when clause I am trying to execute the Native SQL
Query
Order() from hibernateSession.createSQLQuery("SELECT id FROM
Order").list(); // this query will give the list of orderId s from RDBMS.
Here, Order() is a POJO class (Entity) mapping to Order table.
When executed, I found the Order() entity is not populated with the id
values from the query.
Can some one help me with the tutorial which speaks about Quering DB via
Hibernate NativeSQL Query in Drools.
--
View this message in context: http://drools.46999.n3.nabble.com/Performing-Hibernate-NativeSQLQuery-in-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
new Kie API and RuleMatrixSheetListener()
by Ramon Buckland
Hi,
I am looking at the new Kie API and I am trying to work out how I tell it / Drools that I have a RuleMatrixSheet ..
https://github.com/droolsjbpm/drools/blob/master/drools-decisiontables/sr...
This was the old way (a bit manual)
final SpreadsheetCompiler converter = new SpreadsheetCompiler();
final InputStream stream = this.getClass().getResourceAsStream( "/path/to/spreadsheet.xls" );
final String drl = converter.compile( stream,
InputType.XLS,
new RuleMatrixSheetListener() );
Is there an example of a matrix style Spreadsheet being used to generate the rules, with the new Kie APIs ?
I can't seem to find similar concepts on the ResourceFactory API, or on "Resource"
Version 5 and version 6 don't really "support" the Configuration object understanding the Matrix Style Rules table.
If it were to be implemented, it looks like :
org.kie.api.builder.KieFileSystem
needs some changes, to support the compilation of a Rule Matrix where write* is taking a Resource,
If there is not an Example, what do I need to "wire" together for this.
Any pointers are much appreciated.
Kind regards
Ramon
Ramon Buckland
ramon(a)thebuckland.com
12 years, 8 months
Using XMLGregorianCalendar for @timestamp metadata
by ScalaEnthusiast
I have an object that comes into a stream as an event and I want to use
@timestamp to specify the event time from the object.
Then field that has this information is an XMLGregorianCalendar called
timeStamp. If I specify this attribute with @timestamp(timeStamp) I get and
error saying that conversion to long from the XMLGregorianCalendarImpl is
not supported. Ok, I get that.
now, I can get a java Date by calling the following method chain on the
timeStamp object:
timeStamp.toGregorianCalendar().getCalendarDate()
specifying this in the @timestamp does not validate, presumably because
@timestamp is looking for an attribute (or chain of attributes) and not a
chain of method calls.
Is there anyway to specify a timestamp in the rule using an
XMLGregorianCalendar?
--
View this message in context: http://drools.46999.n3.nabble.com/Using-XMLGregorianCalendar-for-timestam...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
Drools Accumulate function
by lyally
Hi,
I am new to Drools so please excuse me if this is a simple question.
I currently have several rules that look as follows (one for each entry
point):
The intention of these rules is to average the speed, occupancy and flow of
traffic at a particular road location over a 30 second sliding window. The
rule works fine as it is, however it is not very scalable since I currently
need a similiar rule and associated input stream for each road location that
I am monitoring. There may be 100s of these.
What I was really after was one rule that would perform the same averaging
calculations over the 30 second window. My first thoughts were that I would
need to lose the individuall input streams per location and thereby place
all of the TrafficData facts from all locations into working memory. But
then I was unsure how I would change the rule to group relevant TrafficData
instances by their location (Note that the TrafficData instance has a
location identifier within it) together before doing the averaging.
Any assistance would be much appreciated.
Regards,
Steve
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Accumulate-function-tp4023718.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
Restricting the items included in a snapshot
by Lance Leverich
I am aware of how Guvnor can be told to only include assets with a given
state, during the build process. What I haven't been able to figure out is
a way to tell Guvnor to only include the items that were part of the latest
build, when creating a snapshot. Is there a way to do this? I am using
Guvnor 5.3.5.Final.
~ Lance
12 years, 8 months
How to find rules, that use special fields in their Condition
by mdzaebel
Hi,
the following code traverses rules and their conditions. However, I did not
find a method to find conditions, that match over a certain field of a
declared class. I know, that the rule API should be hidden for good reasons
(Mark Proctor).
for(Rule ruleDef : kb.getKnowledgePackages().iterator().next().getRules()) {
for(RuleConditionElement rce :
((RuleImpl)ruleDef).getRule().getLhs().getChildren()) {
for(Map.Entry<String, Declaration> entry :
rce.getInnerDeclarations().entrySet()) {
??
Thanks, Marc
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-find-rules-that-use-special-fiel...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
Ways to list the globals
by Sonata
Hi, I am trying to list out the globals but I am confused, please help.
I wrote this line in my drl file
((MapGlobalResolver)drools.getKnowledgeRuntime().getGlobals()).getGlobals()
this gives me ONLY the globals that I have added in drl through
drools.getWorkingMemory().setGlobal()
this does not list out the globals that I have added in java before firing
the rules.
Then I tried this line in my drl file
drools.getKnowledgeRuntime().getKnowledgeBase().getKnowledgePackages().getGlobalVariables()
this gives me BOTH the globals that I have added in drl through
drools.getWorkingMemory().setGlobal()
AND the globals that I have added in java before firing the rules.
My question is, to list the useable globals in the current rule, what is the
correct method call?
Thank you
--
View this message in context: http://drools.46999.n3.nabble.com/Ways-to-list-the-globals-tp4023616.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
Drools 5.5 run time exception from the library code but no impact to the rule evaluation result
by Sean Su
Just want to put the exception out here in case it is meaningful to the
development or whoever ran into this before. It occurred but does not
impact the result of the process.
Exception in thread "Thread-6" java.lang.NullPointerException
at java.lang.String.<init>(String.java:210)
at org.mvel2.ast.ASTNode.toString(ASTNode.java:426)
at org.mvel2.ast.Or.toString(Or.java:59)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at
org.drools.rule.constraint.ConditionAnalyzer.analyzeNode(ConditionAnalyzer.java:247)
at
org.drools.rule.constraint.ConditionAnalyzer.analyzeSingleCondition(ConditionAnalyzer.java:106)
at
org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:99)
at
org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:70)
at
org.drools.rule.constraint.MvelConditionEvaluator.getAnalyzedCondition(MvelConditionEvaluator.java:83)
at
org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:270)
at
org.drools.rule.constraint.MvelConstraint.access$200(MvelConstraint.java:51)
at
org.drools.rule.constraint.MvelConstraint$ConditionJitter.run(MvelConstraint.java:250)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Sean
12 years, 8 months
Consequence Exception with too many events
by Jason Barto
I am new to Drools (Expert and Fusion) and have been reading through the
materials over the last few days. After going through some of the tutorial
code I wrote a very quick and dirty to perform a base assessment of the
speed of Fusion / Expert. My code is below. The strange thing I'm
currently receiving is, if I insert 100k events the test completes
successfully, if I insert 150k events, I receive a ConsequenceException
caused by an NPE. Being new to Drools I must be doing something wrong, can
anyone please provide some guidance?
(Main function)
Counter cc = new Counter ();
session.insert (cc);
for (int i = 0; i < 150000; i++) {
entryPoint01.insert (new MyEvent ());
}
(Counter Class)
public class Counter {
private long total = 0;
// get / set total
public void addValue (int val) {
total += val;
}
}
(MyEvent Class)
public class MyEvent {
private int value = 1;
// get / set value
}
(DRL file)
declare MyEvent
@role (event)
@expires (1s)
end
rule "Count the rules"
when
$ev : MyEvent () from entry-point entryPoint01
$pc : Counter ()
then
$cc.addValue ($ev.getValue ());
end
12 years, 8 months
Camel get ksession results
by mauro
Hi,
I'm using Drools integration with Camel and have to be able to get the
objects that were validated by a rule in a stateless ksession later in the
Camel route.
My camel-server.xml has something similar to this:
<policy ref="droolsPolicy">
<bean ref="createList" />
<to uri="drools:node1/ksession1" />
<bean ref="afterRules" />
</policy>
in the "createList" bean I create a list of java objects and call
CommandFactory.newBatchExecution(commandList);
My Drools rule responds as expected. So far so good.
But then later when execution reaches "afterRules" bean, the exchange body
has empty lists for both "facts" and "results".
What I want at this point is to be able to get all the objects which were
compatible with the rule (a simple sysout). The ones that didn't match the
rule, are simply disposed.
How can I solve that?
Drools v5.5.0 Final
Camel 2.10.4
Thanks!
Mauro
--
View this message in context: http://drools.46999.n3.nabble.com/Camel-get-ksession-results-tp4023670.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
GSOC project - Realtime Collaborative Editor for Drools Decision Tables using Errai OT/EC
by Mark Proctor
Errai has recently added OTEC support, which is a web based system for collaborative editing. I thought this would be really interesting project, working on cutting edge web technologies for anyone doing a GSOC submission. Or actually anyone looking for an engaging task :)
https://community.jboss.org/wiki/GSOC13Ideas#Realtime_Collaborative_Edito...
Errai OTEC (Operationaly Transformed, Eventually Consistent Data Syncrhonization) facilitates builing Google Wave and Google Docs type applications, with multiple authors in real time on the same document. Two videos showing OTEC editing working in real time for collaboritive authoring:
https://www.youtube.com/watch?v=ChCasRr0cZc
https://www.youtube.com/watch?v=Wvf5pbOM920
Drools has extensive Decision Table support, which provides a spreadsheet like authoring tool for rules. Errai OTEC can allow two authors to work on the document at the same time. It would provide the following features:
-Current cursor/edit location for each user in the document.
-Edits to Cells to appear as they happen.
-Cell locking, so only one Cell can be updated by one user at a time.
Knowledge prerequisite:
Java, GWT, Errai
Skill level: Medium
Contact(s): Michael Anstis
Mentor(s): Michael Anstis
Associated project(s): Drools, Guvnor, Errai
Notes:
12 years, 8 months
"drools" key word
by rjr201
I was looking for a way to get a rule's name within the 'then' condition of
the rule.. found an old post on another forum that recommended this (which
works):
drools.getRule().getName()
My question is, what is this 'drools' keyword? could anyone point me to
documentation that outlines what else can be done with it.
Thanks in advance.
Rich.
--
View this message in context: http://drools.46999.n3.nabble.com/drools-key-word-tp4023662.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
Re: [rules-users] Some Puzzles in planner
by ge0ffrey
erere121 wrote
> Hello every one ,I study the drool.plannar recently and both tried the
> planner 5.5 and planner 6.0(optaplanner) to solve my problem. I found
> something puzzles:
>
> 1 Is there any big difference between planner 5.5 and planner 6.0. I run
> the same process in both planner 5.5 and planner 6.0 with the same config,
> I find planner 5.5 gives the solution with 19hard broken while planner 6.0
> give the solution with 502hard broken !!!!! I am not sure why it happens.
>
> 2 When I open the demo in optaplanner in eclipse, I find every
> "scoreHolder.addConstraintMatch(....);" have the error like this:The
> method addConstraintMatch(kcontext,..) in the type SimpleScoreHolder is
> not applicable for the arguments (RuleContext, int)", can anybody help me.
>
> 3 The problem has a solution which breaks no rules while both planner 5.5
> and 6.0 never found it using the tabu search and hill climb search. I
> wonder is it right or is there any other global search method in planner.
1. That should not happen. Turn on enviromentMode FAST_ASSERT to validate
you don't have any score corruption.
2. Sounds like your eclipse is using the wrong optaplanner-core jar on it's
classpath to compile
3. It could be that there's no feasible solution (= 0 hard constraints
broken) to your solution, but I 'd only start believing this if
environmentMode doesn't find any score corruption. If it's a really tiny
problem, you can use the configuration <bruteForce> to be 100% sure. (Note:
Tabu search currently doesn't automatically scale down to tiny problems (=
less than 10 planning entities), you have to manually lower the
planingEntityTabu configuration setting.
--
View this message in context: http://drools.46999.n3.nabble.com/Some-Puzzles-in-planner-tp4023580p40236...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
[Planner]
by Mats Norén
Hi,
I've got a really simple problem that I can't seem to fix. :-)
I'm trying to use a simplified model for a room planning problem.
The planning entity is a Topic and the planning variables are Room and
TimeSlot.
A Person is tied to a Topic as a moderator.
Each Person can have multiple Topics as an interest.
The hard constraints are that a Person cannot be moderator in two Topics at
the same TimeSlot and that there cannot be multiple Topics in the same Room
at the same TimeSlot.
rule "conflictingModeratorInSameTimeslot"
when
$leftTopic : Topic($leftId : id, $leftTimeslot : timeSlot, timeSlot
!= null, $leftModerator: moderator)
$rightTopic : Topic(timeSlot == $leftTimeslot, moderator ==
$leftModerator, id > $leftId)
then
scoreHolder.addHardConstraintMatch(kcontext, -1);
end
rule "multipleTopicsInSameRoomAndTimeslot"
when
$leftTopic : Topic($leftId : id, $leftTimeslot : timeSlot, timeSlot
!= null, $leftRoom: room)
$rightTopic : Topic(timeSlot == $leftTimeslot, room == $leftRoom,
id > $leftId)
then
scoreHolder.addHardConstraintMatch(kcontext, -1);
end
The soft constraint that I have a problem with is that a Person has
multiple Topics as interests and I would like to penalize the Solution with
the number of Topics in the Persons interests collection with the number of
Topics that are allocated at the same TimeSlot.
Any ideas on how to go about this?
Regards,
Mats
12 years, 8 months
Re: [rules-users] KnowledgeAgent to update knowledge base built with Guvnor pkg
by Roger Swanson
I also had an issue at one point where the agent detected new knowledge but it didn't seem to load within the current knowledge base. I was able to fix it via the agent config:
KnowledgeAgentConfiguration agentConfig = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
agentConfig.setProperty("drools.agent.newInstance", "false");
KnowledgeAgent agent = KnowledgeAgentFactory.newKnowledgeAgent("myagent", agentConfig);
-----Original Message-----
From: riri [mailto:irina.adam@gmail.com]
Sent: Wednesday, May 01, 2013 6:25 AM
To: rules-users(a)lists.jboss.org
Subject: Re: [rules-users] KnowledgeAgent to update knowledge base built with Guvnor pkg
Nobody has any ideas on how to solve this? I am willing to try anything that might work short of re-creating the knowledge base everytime I start a new session.
And when using the changeSet() method for the knowledge agent, how would one set the knowledge base properties? Like functioning in STREAM mode and not CLOUD.
Please, anyone, I really need your help.
--
View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgent-to-update-knowledge-base...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
Is there a way to add a JAR to a knowledBuilder
by Charles Moulliard
Hi,
Is there a way to add a JAR to a knowledgeBuilder with a method like that ?
kbuilder.add(ResourceFactory.newUrlResource("file:///model-1.0-SNAPSHOT.jar"),ResourceType.JAR);
Regard,
--
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
12 years, 8 months
Drools Guvnor - Testing rules
by Alan
Hi guys,
I'm validating some features of Drools Guvnor and I would like to have some
directions.
We've got a project that has a lot of rules(its not on drools already, but
we pretend to migrate it) and we would like to use Drools Guvnor to host
those rules and run some analysis on it.
I've seen some features but it still not clear, so I will list my doubts and
you can say, ok it does or no it doesn't do it.
*Do drools guvnor validate missing ends on rules? Ex: when age > 15 and sex
== 'F' then Y();(note that it doesn't cover age <= 15)
*Do it validate/find infinite loops?
*Do it validate duplicate cases?(ex: when age > 15 then Y(); when age > 14
then Y();)
Is there some resource (documentation) that covers what cases drools guvnor
can handle on rules validation?
Also, is there some more examples(projects) to deploy on Guvnor to test and
have some fun?
Thanks a lot,
Alan Araya
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Guvnor-Testing-rules-tp4023594.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
getWorkingMemoryEntryPoint returns null - two rules with same name
by ScalaEnthusiast
All,
I was getting a null returned when requesting an entrypoint using
getWorkingMemoryEntryPoint("myEntryPoint") in BRMS 5.3.1 (Drools 5.3). To be
clear "myEntryPoint" is an entry point defined in my technical rule.
What was causing my issue was that there were two rules of the same name
(cut-n-paste error), one with the entry-point and one without. As soon as I
changed the name of one of the rules, I no longer received the null pointer
error - I was able to get the entry point from the session.
I am posting this for others who may run into this [edge] case and to see if
this would be considered a bug. The package source shows that the rule
without the entry point came first and the one with the entry-point was
second. Not sure how the system handles loading rules but I wouldn't think
two rules with the same name should be allowed. Is this a validation issue
that Guvnor needs to deal with?
Any thoughts from those in the know?
Thanks,
ScalaEnthusiast
--
View this message in context: http://drools.46999.n3.nabble.com/getWorkingMemoryEntryPoint-returns-null...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
5.5.0-Final, persistence to MySQL
by Vytautas Gimbutas
Hello,
i'm having an issue with Drools 5.5.0-Final, stateful sessions and persistence to MySQL.
I have successfully configured and everything seems to work fine (session is persisted & updated to database), however
sometimes after i kill (not after each kill) and start again application I'm unable to load back session.
I get this exception when I try to load session:
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
> at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:115)
> at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.loadStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:83)
> at org.drools.persistence.jpa.JPAKnowledgeService.loadStatefulKnowledgeSession(JPAKnowledgeService.java:131)
> at lt.mokejimai.ss.engine.Engine.getSession(Engine.java:57)
> at lt.mokejimai.ss.engine.Engine.insert(Engine.java:38)
> at lt.mokejimai.ss.api.rest.endpoint.InspectEndpoint.inspectTransactions(InspectEndpoint.java:61)
> 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.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155)
> at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257)
> at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222)
> at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211)
> at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
> at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
> at org.eclipse.jetty.server.Server.handle(Server.java:349)
> at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
> at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:884)
> at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:938)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
> at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
> at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
> at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
> at java.lang.Thread.run(Thread.java:680)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:100)
> ... 45 more
> Caused by: java.lang.RuntimeException: Unable to load session snapshot
> at org.drools.persistence.SessionMarshallingHelper.loadSnapshot(SessionMarshallingHelper.java:96)
> at org.drools.persistence.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:253)
> at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:195)
> ... 50 more
> Caused by: java.lang.NullPointerException
> at org.drools.common.ConcurrentNodeMemories.getNodeMemory(ConcurrentNodeMemories.java:63)
> at org.drools.common.AbstractWorkingMemory.getNodeMemory(AbstractWorkingMemory.java:1034)
> at org.drools.rule.SlidingTimeWindow$BehaviorExpireWMAction.<init>(SlidingTimeWindow.java:460)
> at org.drools.marshalling.impl.PersisterHelper.deserializeWorkingMemoryAction(PersisterHelper.java:101)
> at org.drools.marshalling.impl.ProtobufInputMarshaller.readActionQueue(ProtobufInputMarshaller.java:426)
> at org.drools.marshalling.impl.ProtobufInputMarshaller.readSession(ProtobufInputMarshaller.java:260)
> at org.drools.marshalling.impl.ProtobufInputMarshaller.readSession(ProtobufInputMarshaller.java:158)
>> at org.drools.marshalling.impl.ProtobufMarshaller.unmarshall(ProtobufMarshaller.java:117)Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
>
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
> Hibernate: select sessioninf0_.id as id0_0_, sessioninf0_.lastModificationDate as lastModi2_0_0_, sessioninf0_.rulesByteArray as rulesByt3_0_0_, sessioninf0_.startDate as startDate0_0_, sessioninf0_.OPTLOCK as OPTLOCK0_0_ from SessionInfo sessioninf0_ where sessioninf0_.id=?
<…>
--
Vytautas Gimbutas
12 years, 8 months
Decision table -1 java file per rule - optimization
by jalex
Hi,
I noticed that each row in the decision table speadsheet is converted to a
separate java file during runtime (ex:
Rule_Pricing_bracket_352_941a618e0e72407d89d04664d5809e7f.java) . This will
lead to the number of classes increasing as the number of rules grow. Is
there a way to optimize such that all rules in 1 spreadsheet gets converted
to a single java file?
Sample logs during runtime, each "rule applied" log corresponds to firing
of a single row
04/29/2013 15:33:22,434 DEBUG [http-9080-1]
(Rule_Pricing_bracket_352_941a618e0e72407d89d04664d5809e7f.java:8)
aa410236-727c-4d48-8761-79088dca9b31 Rule applied: Default_A_rule40
04/29/2013 15:33:22,435 DEBUG [http-9080-1]
(Rule_Pricing_bracket_201_e2c74982a30d4e8eb128f07fbba73803.java:8)
aa410236-727c-4d48-8761-79088dca9b31 Rule applied: Default_B_rule40
04/29/2013 15:33:22,436 DEBUG [http-9080-1]
(Rule_Pricing_bracket_50_5de087aa5a3345adbc06748474dc53b3.java:8)
aa410236-727c-4d48-8761-79088dca9b31 Rule applied: Default_C_rule40
--
View this message in context: http://drools.46999.n3.nabble.com/Decision-table-1-java-file-per-rule-opt...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
having trouble using accumulate to create a list of non null objects
by burmanator
I have 2 objects, Foo and Bar. Foo can store an instance of Bar. I am trying
to create a list of all the Bar objects that correspond to all the Foo
objects with a given name.
the line in my rule I am using is:
Foo($name : Name)
$list : List() from accumulate( Foo( Name == $name, $b : Bar != null),
collectList($b))
Yet when I print out the list, it includes null elements. But if I instead
make the rule:
$list : List() from accumulate( Foo( Name == $name, $b : Bar != null),
collectList($b!=null))
I get false for all the null Bar objects.
Am I missing something?
--
View this message in context: http://drools.46999.n3.nabble.com/having-trouble-using-accumulate-to-crea...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months
KnowledgeAgent to update knowledge base built with Guvnor pkg
by riri
Hello everyone,
I am trying to take advantage of the automatic uploading that the
KnowledgeAgent provides and am using the 5.5.Final Drools version. The
Drools Expert documentation states that one can use an existing knowledge
base to create an agent, and the agent will subscribe to the resources that
it finds (Example 3.26. Using an existing KnowledgeBase).
I am at first creating the knowledge base using a set of .drl files defined
in a change-set file and also a Guvnor url :
http://127.0.0.1:8080/guvnor/org.drools.guvnor.Guvnor/package/<package-name>/LATEST.
I then create the knowledge agent as shown in Example 3.26 of the
documentation. The problem is that if I modify the Guvnor package (add or
remove a rule) and then rerun a stateful knowledge session, the knowledge
base is not updated. I thought that I needed to build the package in Guvnor
every time I modify it but doing so does not solve the problem. Modifying
the rules in the change-set files seems to update the knowledge base.
I start the ResourceChangeScanner and ResourceChangeNotifier and if I call
isMonitorChangeSetEvents() and isScanResources() they return true. And also,
whenever I create a session, I use the getKnowledgeBase() method and am not
caching it somewhere in my program. Should I not be creating the agent with
an existing knowledge base and instead use the applyChangeSet() method? If
so, how would I be able to configure the knowledge base to use
AssertBehaviorOption.EQUALITY?
Thany you very much for any help or tips to point me in the right direction.
Best regards
--
View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgent-to-update-knowledge-base...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months