Re: [rules-users] Drools Planner changing problem fact

2012-07-18 Thread Geoffrey De Smet

Op 17-07-12 20:54, Garf schreef:
 last month, Ralph wrote: /All the examples in the drools-planner-examples
 seem to have a fixed list of problem facts (rooms, teachers, timeslots)
 which only should be combined optimally./

 Just to address this one unanswered point.
 The Cloud Balancing example does support changing the problem facts,
 specifically by removing computers (bins).

 The last section of the planner documentation (section 12.4) addresses
 realtime planning, through the Solver.addProblemFactChange() API. This works
 whether you are removing problem facts (as the example shows) or modifying
 their contents.

 This generally restarts the Solver -- but, if you are relatively optimized,
 the adjustment is found relatively fast.
Internally, it restarts the Solver, but not from scratch, it restarts 
starting from the best solution of the last run.
As a Solver user, you don't even notice this in your code, you just call 
addProblemFactChange().
And it only takes milliseconds to find a feasible solution, see the log 
below this video:
http://blog.athico.com/2011/07/real-time-planning-with-drools-planner.html
   (I'm curious, though -- does the
 Solver expressly prioritize doing moves associated with those problem facts
 that were just changed?)
Not really, unless you count this:
A construction heuristic will only assigning the unassigned entities,
so any entity that gets unassigned (because of the problem fact change) 
gets changed first.
For example a machine (=problem fact) got killed, so all it's processes 
(= entities) are unassigned and they get assigned first.
After that, normal localSearch kicks in.

But you could prioritize moves that affect those associated problem 
facts if you wanted to.
In 5.4 that's very hard to do, but 5.5.0.Beta1 will introduce an 
interface ProbabilitySelectionWeightFactory to make it easy to do such 
stuff.
I fear it's still going to require domain-specific code though, even if 
it's just a class implementing that interface.

 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Drools-Planner-changing-problem-fact-tp4018087p4018742.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


-- 
With kind regards,
Geoffrey De Smet




___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools-Guvnor integration with Webshere- Exception during startup...Please help!!!

2012-07-18 Thread Geoffrey De Smet
Instead of the guvnor jboss-as-7.0 war, use the guvnor tomcat-6.0 war, 
that one includes the weld jars.

Op 18-07-12 06:17, Ravikiran schreef:
 Hi,
 I am deploying drools-guvnor.war (version 5.3.0) into Websphere AS 7. The
 war file was working perfectly fine in JBoss AS 7. But i am getting below
 exception when launching the guvnor from browser...


 [18/07/12 12:09:02:101 SGT] 0032 SystemOut O ERROR 18-07
 12:09:02,101 (LoggingHelper.java:error:74) Service method 'public abstract
 org.drools.guvnor.client.rpc.UserSecurityContext
 org.drools.guvnor.client.rpc.SecurityService.getCurrentUser()' threw an
 unexpected exception: java.lang.IllegalStateException: CDI hasn't been
 properly started.
Make sure your IDE classpath is in sync with the real maven classpath.
The classpath should include weld-servlet.
 java.lang.IllegalStateException: CDI hasn't been properly started.
Make sure your IDE classpath is in sync with the real maven classpath.
The classpath should include weld-servlet.
   at
 org.drools.guvnor.server.SecurityServiceServlet.getCurrentUser(SecurityServiceServlet.java:66)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
   at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
   at java.lang.reflect.Method.invoke(Method.java:599)
   at 
 com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
   at
 com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
   at
 com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
   at
 com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
   at
 com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1663)
   at
 com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939)
   at
 com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
   at
 com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
   at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3826)
   at 
 com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
   at
 com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
   at
 com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
   at
 com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
   at
 com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:445)
   at
 com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:504)
   at
 com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:301)
   at
 com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
   at
 com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
   at
 com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
   at
 com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
   at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
   at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
   at
 com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
   at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
   at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1563)
 [18/07/12 12:09:02:101 SGT] 0032 webappI
 com.ibm.ws.webcontainer.webapp.WebApp log SRVE0296E:
 [drools-guvnor_war#drools-guvnor.war][/drools-guvnor][Servlet.LOG]:.Exception
 while dispatching incoming RPC
 call:.com.google.gwt.user.server.rpc.UnexpectedException: Service method
 'public abstract org.drools.guvnor.client.rpc.UserSecurityContext
 org.drools.guvnor.client.rpc.SecurityService.getCurrentUser()' threw an
 unexpected exception: java.lang.IllegalStateException: CDI hasn't been
 properly started.
Make sure your IDE classpath is in sync with the real maven classpath.
The classpath should include weld-servlet.
   at
 com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385)
   at 
 com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588)
   at
 com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
   at
 com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
   at
 

Re: [rules-users] Error on Build Package Click

2012-07-18 Thread paco
Hi Esteban,
I can't pass de source code of my rules because it's too much.
I've about 1600 rules. Too much to be passed.
Can you give me any suggestions?

King regards

Paco

--
View this message in context: 
http://drools.46999.n3.nabble.com/Error-on-Build-Package-Click-tp4018712p4018749.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools-Guvnor integration with Webshere- Exception during startup...Please help!!!

2012-07-18 Thread Ravikiran
Hi Geoffrey,

I couldn't find any weld related jar files available in
guvnor-5.3.0.Final-tomcat-6.0.war. Also i have tried wild card search like
weld*, but i couldn't find it.

Could you please check whether the below line from the error message might
give you some idea,

Service method 'public abstract
org.drools.guvnor.client.rpc.UserSecurityContext
org.drools.guvnor.client.rpc.SecurityService.getCurrentUser()' threw an
unexpected exception: java.lang.IllegalStateException: CDI hasn't been
properly started.

I am struck here without any success since yesterday, please help.

thanks.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Guvnor-integration-with-Webshere-Exception-during-startup-Please-help-tp4018745p4018750.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Guvnor integration GLOBAL/Remote HTTP resource caching error !!!

2012-07-18 Thread abhinay_agarwal
hello..i am using the following changeset : 

change-set xmlns=http://drools.org/drools-5.0/change-set; 
xmlns:xs=http://www.w3.org/2001/XMLSchema-instance; 
xs:schemaLocation=http://drools.org/drools-5.0/change-set.xsd
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd;
 add
  resource
source=http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Individual/LATEST;
type=PKG basicAuthentication=enabled username=admin
password=/

  /add
  /change-set

and my knowledge base was created using the following code :

KnowledgeAgentConfiguration kaconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
kaconf.setProperty( drools.agent.scanDirectories, 
false );
KnowledgeAgent kagent = 
KnowledgeAgentFactory.newKnowledgeAgent( test
agent, kaconf );

System.setProperty(drools.resource.urlcache, 
D:\\drools
runtime\\Cache);

ResourceFactory.getResourceChangeNotifierService().start();

ResourceFactory.getResourceChangeScannerService().start();

kagent.applyChangeSet(ResourceFactory.newClassPathResource(changeset.xml));


kbase=kagent.getKnowledgeBase();
}catch(Exception exp){
throw new Exception(exp);
}
return kbase; 






and i tried creating a Remote HTTP resource caching , since i was having
the following error beacuse of the GLOBAL ArrayList that i had used :

*java.lang.RuntimeException: Unexpected global [list]
at
org.drools.common.AbstractWorkingMemory.setGlobal(AbstractWorkingMemory.java:613)
at
org.drools.impl.StatefulKnowledgeSessionImpl.setGlobal(StatefulKnowledgeSessionImpl.java:332)
at com.sample.DroolsTest.main(DroolsTest.java:71)*i read smewhere that
creating a local copy will help irradicate the error...


but while creating a local copy i get a new error ... 

*(null: 8, 174): cvc-elt.1: Cannot find the declaration of element
'change-set'.
java.io.IOException: Server returned HTTP response code: 401 for URL:
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Individual/LATEST
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at org.drools.io.impl.UrlResource.grabStream(UrlResource.java:210)
at org.drools.io.impl.UrlResource.cacheStream(UrlResource.java:181)
at org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:142)
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:720)
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:679)
at
org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:979)
at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:774)
at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:646)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:192)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:174)
at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:126)
at com.sample.DroolsTest.main(DroolsTest.java:49)*





(null: 8, 174): cvc-elt.1: Cannot find the declaration of element
'change-set'.

i ve neglected this error !!!

Regards,
Abhinay 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-integration-GLOBAL-Remote-HTTP-resource-caching-error-tp4018751.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools-Guvnor integration with Webshere- Exception during startup...Please help!!!

2012-07-18 Thread Ravikiran
Hi Geoffrey  Other Gurus

To throw more light on the above error message, please find below the
getCurrentUser() method snippet that i have taken from the source of
SecurityServiceServlet.java. Please tell me in what cases the
securityService comes as null for causing this exception.

public UserSecurityContext getCurrentUser() {
if (securityService == null) {
// This is the first method called by the client.
// If CDI hasn't kicked in (theoretically impossible...), throw
a readable exception
throw new IllegalStateException(CDI hasn't been properly
started.\n +
  Make sure your IDE classpath is in sync with the real
maven classpath.\n +
  The classpath should include weld-servlet.);
}
return securityService.getCurrentUser();
}

Thanks a lot

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Guvnor-integration-with-Webshere-Exception-during-startup-Please-help-tp4018745p4018752.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools-Guvnor integration with Webshere- Exception during startup...Please help!!!

2012-07-18 Thread Geoffrey De Smet
Just realized:
We only use CDI, weld, seam 3 and arquillian since Guvnor 5.4.0
In Guvnor 5.3.0 we still use seam 2 (which does not use the CDI spec jars).

So how can you be running into errors that speak about weld-servlet?

Op 18-07-12 14:19, Ravikiran schreef:
 Hi Geoffrey  Other Gurus

 To throw more light on the above error message, please find below the
 getCurrentUser() method snippet that i have taken from the source of
 SecurityServiceServlet.java. Please tell me in what cases the
 securityService comes as null for causing this exception.

 public UserSecurityContext getCurrentUser() {
  if (securityService == null) {
  // This is the first method called by the client.
  // If CDI hasn't kicked in (theoretically impossible...), throw
 a readable exception
  throw new IllegalStateException(CDI hasn't been properly
 started.\n +
Make sure your IDE classpath is in sync with the real
 maven classpath.\n +
The classpath should include weld-servlet.);
  }
  return securityService.getCurrentUser();
 }

 Thanks a lot

 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Drools-Guvnor-integration-with-Webshere-Exception-during-startup-Please-help-tp4018745p4018752.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


-- 
With kind regards,
Geoffrey De Smet


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Gwt Error while integrating guvnor with custom application.

2012-07-18 Thread soumya
Hi,

I am new to drools, currently i have deployed drools-guvnor5.3 on jboss AS
5.1GA.
I want to use guvnor asset editor in my custom application. I have followed
the link 
http://ilesteban.wordpress.com/2010/11/23/guvnor-embed-assets-editor-in-your-application/.
I am using assetEditor.html, but when i click on submit button it says
Plugin failed to connect to Development Mode server at localhost:8080

The URL mentioned in my html is
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/standaloneEditorServlet?gwt.codesvr=localhost:8080;
as my server is running on localhost:8080.

Anybody come across this error and having solution?
Please help!!!

--
View this message in context: 
http://drools.46999.n3.nabble.com/Gwt-Error-while-integrating-guvnor-with-custom-application-tp4018754.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] DSL translatio problem for !ucfirst under 5.1.1

2012-07-18 Thread drdaveg
Thanks.  I downloaded 5.2 and there are no compilation errors.  I also need
to check to see if one decision table issue (that I had worked around) was
solved.  However, in 5.2 I get 

'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java:org.drools.rule.builder.dialect.java.JavaDialectConfiguration'
ArrowQueryBuilder.xls   /redoDesignReal/src/main/rules  Unknown Drools Error

once per file with rules, i.e., per decision table and dslr file.  Reading
posts on this error, I am updating Eclipse - which is still updating after
19 hours!  Any thoughts on a better approach?  This could be caused by other
plugins or the Eclipse installation (i.e., the EE version) and its JAR's. 
Thanks!

--
View this message in context: 
http://drools.46999.n3.nabble.com/DSL-translatio-problem-for-ucfirst-under-5-1-1-tp4018743p4018755.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools-Guvnor integration with Webshere- Exception during startup...Please help!!!

2012-07-18 Thread Ravikiran
Hi Joffrey,

I have downloaded the distribution shows Drools-guvnor 5.3.0, but when i see
the Guvnor version from web UI (Adminstration--About) it shows the version
as SNAPSOT 5.4.0. Now i too suspect that my Guvnor is of version 5.4.0 only,
that's why all those errors were coming.

I feel that you have understood the problem now, please tell me what should
i do to resolve this. If i required to add any new jar files, please also
let me know the location to download them as well. Because i didn't get any
related information on internet for this issue so far...you are the only
hope!

Thanks a lot...

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Guvnor-integration-with-Webshere-Exception-during-startup-Please-help-tp4018745p4018756.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Gwt Error while integrating guvnor with custom application.

2012-07-18 Thread Esteban Aliverti
Try removing the
'gwt.codesvr=localhost:8080http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/standaloneEditorServlet?gwt.codesvr=localhost:8080'
from the url. That parameter is only valid when GWT is running in dev mode.

Best Regards,



Esteban Aliverti
- Blog @ http://ilesteban.wordpress.com


On Wed, Jul 18, 2012 at 3:55 PM, soumya soumya.she...@tcs.com wrote:

 Hi,

 I am new to drools, currently i have deployed drools-guvnor5.3 on jboss AS
 5.1GA.
 I want to use guvnor asset editor in my custom application. I have followed
 the link

 http://ilesteban.wordpress.com/2010/11/23/guvnor-embed-assets-editor-in-your-application/
 .
 I am using assetEditor.html, but when i click on submit button it says
 Plugin failed to connect to Development Mode server at localhost:8080

 The URL mentioned in my html is
 
 http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/standaloneEditorServlet?gwt.codesvr=localhost:8080
 
 as my server is running on localhost:8080.

 Anybody come across this error and having solution?
 Please help!!!

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Gwt-Error-while-integrating-guvnor-with-custom-application-tp4018754.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] MVEL optimizer error

2012-07-18 Thread gboro54
I was able to reproduce this error locally by updating my version of java to
1.6_31(thought I had but I didn't) The stack trace doesn't give me any
information really to go off of. I have around 150 rules of which a dozen
will retract the object OrderSideContext. Is there a way to get a better
trace to figure out which rule may be causing this? After a retract I
thought all other activations on the agenda for the tuple should be
cancelled. Is this a wrong assertion? 


TIA


gboro54 wrote
 
 I am having an issue with an optimizer stack trace on my linux QA box that
 I can't seem to reproduce on my windows development box.  The stack trace
 is:
 
 13:01:50,188 ERROR [stderr] (Thread-123) Exception in thread Thread-123
 java.lang.RuntimeException: unable to invoke method:
 com.billing.domain.context.OrderSideContext.getPrimarySide: target of
 method is null
 13:01:50,188 ERROR [stderr] (Thread-123)at
 org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:66)
 13:01:50,189 ERROR [stderr] (Thread-123)at
 org.mvel2.optimizers.impl.refl.nodes.VariableAccessor.getValue(VariableAccessor.java:37)
 13:01:50,189 ERROR [stderr] (Thread-123)at
 org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)
 13:01:50,189 ERROR [stderr] (Thread-123)at
 org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:107)
 13:01:50,189 ERROR [stderr] (Thread-123)at
 org.mvel2.ast.And.getReducedValueAccelerated(And.java:34)
 13:01:50,189 ERROR [stderr] (Thread-123)at
 org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
 13:01:50,190 ERROR [stderr] (Thread-123)at
 org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:123)
 13:01:50,190 ERROR [stderr] (Thread-123)at
 org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:116)
 13:01:50,190 ERROR [stderr] (Thread-123)at
 org.mvel2.MVEL.executeExpression(MVEL.java:930)
 13:01:50,190 ERROR [stderr] (Thread-123)at
 org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:70)
 13:01:50,190 ERROR [stderr] (Thread-123)at
 org.drools.rule.constraint.MvelConditionEvaluator.ensureBranchEvaluation(MvelConditionEvaluator.java:113)
 13:01:50,191 ERROR [stderr] (Thread-123)at
 org.drools.rule.constraint.MvelConditionEvaluator.ensureCompleteEvaluation(MvelConditionEvaluator.java:106)
 13:01:50,191 ERROR [stderr] (Thread-123)at
 org.drools.rule.constraint.MvelConditionEvaluator.ensureCompleteEvaluation(MvelConditionEvaluator.java:90)
 13:01:50,191 ERROR [stderr] (Thread-123)at
 org.drools.rule.constraint.MvelConditionEvaluator.getAnalyzedCondition(MvelConditionEvaluator.java:82)
 13:01:50,191 ERROR [stderr] (Thread-123)at
 org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:214)
 13:01:50,191 ERROR [stderr] (Thread-123)at
 org.drools.rule.constraint.MvelConstraint.access$000(MvelConstraint.java:41)
 13:01:50,192 ERROR [stderr] (Thread-123)at
 org.drools.rule.constraint.MvelConstraint$1.run(MvelConstraint.java:201)
 13:01:50,192 ERROR [stderr] (Thread-123)at
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 13:01:50,192 ERROR [stderr] (Thread-123)at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 13:01:50,192 ERROR [stderr] (Thread-123)at
 java.lang.Thread.run(Thread.java:662)
 13:01:50,192 ERROR [stderr] (Thread-123) Caused by:
 java.lang.NullPointerException
 13:01:50,193 ERROR [stderr] (Thread-123)at
 sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
 13:01:50,193 ERROR [stderr] (Thread-123)at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 13:01:50,193 ERROR [stderr] (Thread-123)at
 java.lang.reflect.Method.invoke(Method.java:597)
 13:01:50,193 ERROR [stderr] (Thread-123)at
 org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:40)
 13:01:50,193 ERROR [stderr] (Thread-123)... 19 more
 
 
 
 We are using a CENTOS with Java 1.6._31 and drools 5.4.
 
 Thanks
 


--
View this message in context: 
http://drools.46999.n3.nabble.com/MVEL-optimizer-error-tp4018714p4018759.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] How to retract events that don't match any rules (without @expires())

2012-07-18 Thread Ladd
Is there a recommended way to remove events from working memory that don't
match and can't activate any rules?

For example, let's say I have two rules which should both fire when a person
with name Bob is encountered.  If a person with name Jim comes in he
stays in working memory forever even though he doesn't match any current
rules.

I know @expires() for Person events would work.  But I don't know what a
safe time would be since I don't know ahead of time what temporal rules
might be written for them.

From the 5.4.0 Drools Fusion docs (Chapter 2) I found these statements:

/In other words, one an event is inserted into the working memory, it is
possible for the engine to find out when an event can no longer match other
facts and automatically retract it, releasing its associated resources./

/Events may be automatically expired after some time in the working memory.
Typically this happens when, based on the existing rules in the knowledge
base, the event can no longer match and activate any rules. Although, it is
possible to explicitly define when an event should expire./

Based on this statement I would expect my Jim to be automatically expired
after some time.  Maybe it will be and I'm just not waiting long enough.

But then I found this quote from Edson:

/Any object type for which there are no explicit
expiration policy, nor temporal constraints from which to derive the
expiration offset will have an infinite expiration offset, i.e., will never
be automatically retracted./

So my question is, how can I retract events which don't match any rules?

Thanks in advance for any tips or suggestsions!!

- Ladd

--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-retract-events-that-don-t-match-any-rules-without-expires-tp4018760.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to retract events that don't match any rules (without @expires())

2012-07-18 Thread Wolfgang Laun
If a fact is to be matched right after insertion the solution is
simple: add a rule with low salience matching and retracting the fact.

If you expect/hope that it matches later and you have a time limit,
@expires is the answer.

The interesting case is when you don't have the time limit and still
hope for a match. If you have a convincing use case for that, I might
be enticed to develop a solution for that ;-)

-W


On 18/07/2012, Ladd l...@codemettle.com wrote:
 Is there a recommended way to remove events from working memory that don't
 match and can't activate any rules?

 For example, let's say I have two rules which should both fire when a
 person
 with name Bob is encountered.  If a person with name Jim comes in he
 stays in working memory forever even though he doesn't match any current
 rules.

 I know @expires() for Person events would work.  But I don't know what a
 safe time would be since I don't know ahead of time what temporal rules
 might be written for them.

 From the 5.4.0 Drools Fusion docs (Chapter 2) I found these statements:

 /In other words, one an event is inserted into the working memory, it is
 possible for the engine to find out when an event can no longer match other
 facts and automatically retract it, releasing its associated resources./

 /Events may be automatically expired after some time in the working
 memory.
 Typically this happens when, based on the existing rules in the knowledge
 base, the event can no longer match and activate any rules. Although, it is
 possible to explicitly define when an event should expire./

 Based on this statement I would expect my Jim to be automatically expired
 after some time.  Maybe it will be and I'm just not waiting long enough.

 But then I found this quote from Edson:

 /Any object type for which there are no explicit
 expiration policy, nor temporal constraints from which to derive the
 expiration offset will have an infinite expiration offset, i.e., will never
 be automatically retracted./

 So my question is, how can I retract events which don't match any rules?

 Thanks in advance for any tips or suggestsions!!

 - Ladd

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/How-to-retract-events-that-don-t-match-any-rules-without-expires-tp4018760.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to retract events that don't match any rules (without @expires())

2012-07-18 Thread Ladd
Thanks for the super fast reply W!

The problem with retracting with a low salience is that my rule set is
fairly dynamic.  Rules come and go.  And we have lots of event types and
lots of fields within them to match on.

Some rules may match an event immediately.  Ex:
when
   $p : Person( name == Bob )

Some may be ands, ors, etc.  Ex:
when
   $first : MyEvent( key == first )
   $person : Person( name == Bob )

Some rules may be temporal with time constraints which I don't know in
advance.  Ex:
when
   $first : MyEvent( key == first )
   $second : MyEvent( key == second, this after [ 0s 10s ] $first )

Some may be temporal with no time constraints.  Ex:
when
   $first : MyEvent( key == first )
   $second : MyEvent( key == second, this after $first )

I don't see how I can use @expires() since I don't know at compile time what
the maximum temporal time limit will be.  Best I could do is create one (say
1 week) and rule developers would have to live within that limit.

And I can't use retract() since any event may be part of a compound rule
that's waiting for the other condition(s) to be met.

As for the use case with no time limit, would your workaround for the
window.length(1) bug be an example?

when
f1 : MyEvent( key == faultType1, value == ALARM )
 not MyEvent( key == faultType1, this after f1 )
f2 : MyEvent( key == faultType2, value == ALARM )
 not MyEvent( key == faultType2, this after f2 )
then
System.out.println(  BOTH FAULTS ARE ACTIVE! )

We need to detect when multiple events are in a given state at the same
time.  Order doesn't matter.  Time between events doesn't matter.

Again, thanks for taking the time to help!

- Ladd

--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-retract-events-that-don-t-match-any-rules-without-expires-tp4018760p4018762.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to retract events that don't match any rules (without @expires())

2012-07-18 Thread Davide Sottara
If your rules are dynamic, would you still want to retract a fact not
matching any of your current rules,
knowing that a new rule might appear later, which would be activated by that
fact?

This said, the problem here is garbage-collecting facts which have been
insert, but are in a zombie 
status, since there is no pattern matching them - not even partially. This
could be a useful feature (Mario?),
you could open a feature request JIRA and let the developers discuss it.

For now I would suggest this: whenever you insert an object, you will get
back a FactHandle. 
Cast it to org.drools.common.InternalFactHandle and look at
getFirstLeftTuple() and getFirstRightTuple().
I haven't checked it completely, but I would say that if the fact does not
participate in any tuple, it 
might be worthy retracting.

Best
Davide

ps your case second after first is a well known problem... and not only
for drools! If your first
matches your conditions, it will have to stay there waiting for a
second... You'll have to 
close the horizon explicitly to remove those firsts which have been
there for too long, whatever
that means for you :)

--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-retract-events-that-don-t-match-any-rules-without-expires-tp4018760p4018763.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Compiled rules differ KnowledgeAgent vs ResourceChangeScanner

2012-07-18 Thread lhorton
I wrote a method to compile these rules using the KnowledgeBaseBeanFactory,
but the unit tests using it did not fail (i.e. did not repro the bug).  Here
is my method:

public static KnowledgeBase createKnowledgeBaseUsingBeanFactory(String path)
throws Exception {
ListDroolsResourceAdapter resourceAdapters = new
ArrayListDroolsResourceAdapter();
KnowledgeBaseBeanFactory factory = new KnowledgeBaseBeanFactory();
if (path.endsWith(.drl)) {
resourceAdapters.add(new DroolsResourceAdapter(path, 
ResourceType.DRL));
} else if (path.endsWith(.xls)) {
DecisionTableConfiguration dtconf =
KnowledgeBuilderFactory.newDecisionTableConfiguration();
dtconf.setInputType(DecisionTableInputType.XLS);
resourceAdapters.add(new DroolsResourceAdapter(path, 
ResourceType.DTABLE,
dtconf));
} else {
throw new IllegalArgumentException(unknown knowledge base type 
for path
' + path + ');
}
factory.setResources(resourceAdapters);
factory.afterPropertiesSet();
return (KnowledgeBase) factory.getObject();
}

These rules started life as an Excel spreadsheet.  I have tried compiling
the spreadsheet to DRL (using DecisionTableFactory) and also, as I said
above, compiling it to PKG format, and all three versions of these rules
exhibit the problem behavior (I thought the pkg format worked, but for my QA
testers the pkg file exhibited the bug: it did not load properly at server
start time (via Spring) but did load correctly on hot deploy (via Change
Scanner).

Short of completely starting over with the spreadsheet I don't know what
else to try.  I did scan the DRL for non-printable characters, in case Excel
was creating something strange, but the only invisible characters I saw
were CRLF and Tabs, which are normal in DRL.

I'll attach the DRL version of the rules here in case anyone can spot
something questionable with it.

http://drools.46999.n3.nabble.com/file/n4018764/documentListTable.drl
documentListTable.drl 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Compiled-rules-differ-KnowledgeAgent-vs-ResourceChangeScanner-tp4018608p4018764.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to retract events that don't match any rules (without @expires())

2012-07-18 Thread Ladd

Davide Sottara wrote
 
 If your rules are dynamic, would you still want to retract a fact not
 matching any of your current rules,
 knowing that a new rule might appear later, which would be activated by
 that fact?
 

That's a good question.  Smaller memory footprint by retracting.  But we
lose the immediate activation of future rules.  Maybe I'll make it an option
and let somebody else decide.  ;)


Davide Sottara wrote
 
 For now I would suggest this: whenever you insert an object, you will get
 back a FactHandle.
  Cast it to org.drools.common.InternalFactHandle and look at
 getFirstLeftTuple() and getFirstRightTuple().
  I haven't checked it completely, but I would say that if the fact does
 not participate in any tuple, it
  might be worthy retracting. 
 

That's great info!!  Worked like a charm.

Once again, thanks guys!  You've been extremely helpful.

- Ladd

--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-retract-events-that-don-t-match-any-rules-without-expires-tp4018760p4018765.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users