Counting Number of Items in NESTED LIST
by aliosha79
I have this use case: an Order can contain one or more items... each item is
characterized by one or more measures. They are described by this simple
pojo class.
public class Order{
protected List<Item> itemList;
public void setItemList (List<Item> itemList) { ... }
public List<Item> getItemList() { ... }
}
public class Item {
protected List<Measure> measureList;
public void setMeasureList (List<Measure> measureList) { ... }
public List<Measure> getMeasureList() { ... }
}
public class Measure {
protected int measure;
public getMeasure() { ... }
public setMeasure() { ... }
}
Supposing i have in my Working Memory an Order containing 2 items. The first
item contains 5 measures, the second one instead contains 12 Measures.
I'd like to write a rule using MVEL (for the assumptions), specifying
WHEN each ITEM has more than 11 measures THEN system.out.println ("order is
valid");
How can i write the assumption? It's important to use MVEL ... (is it
necessary to use accumulate? from? or what?)
Really thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/Counting-Number-of-Items-in-NESTED-LIST...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 11 months
Drools-Guvnor integration with Webshere- Exception during startup...Please help!!!
by Ravikiran
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] 00000032 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] 00000032 webapp I
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
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)
Caused by: 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)
... 26 more
-----------------------------------------------------------------------------------------------
I have tried commenting the
org.drools.guvnor.server.repository.SafeWeldListener listener in web.xml,
<listener>
<listener-class>org.drools.guvnor.server.repository.SafeWeldListener</listener-class>
</listener>
but still i am getting the same above mentioned exception..
Anybody...please help...
thanks a lot.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Guvnor-integration-with-Webshere...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 11 months
Jboss As7.0.2 (linux): designer-2.2.Final-jboss7 request to guvnor-5.4.0.Final-jboss-as-7.0: connection refused
by rodolphio
Hi all,
following error appears on trying to save a bpmn2 process:
15:21:28,408 SEVERE
[org.jbpm.designer.web.repository.impl.UUIDBasedJbpmRepository]
(http--192.168.0.67-8080-3) Unable to connect to Gunvor. Is it running?
[Connection refused]
15:21:28,701 SEVERE [org.jbpm.designer.web.server.ServletUtil]
(http--192.168.0.67-8080-2) Connection refused
15:21:28,819 SEVERE [org.jbpm.designer.web.server.DictionaryServlet]
(http--192.168.0.67-8080-2) Connection refused
designer configuration file jbpm.xml :
<externalloadurl protocol="http" host="localhost:8080"
subdomain="guvnor/org.drools.guvnor.Guvnor/oryxeditor" usr="admin"
pwd="admin"/>
guvnor configuration file preferences.properties :
#Designer configuration
designer.url=http://localhost:8080
#Do not change this unless you know what are you doing
designer.context=designer
designer.profile=jbpm
guvnor configuration file beans.xml :
<security:IdentityImpl>
<s:modifies/>
<security:authenticatorClass>org.drools.guvnor.server.security.DemoAuthenticator</security:authenticatorClass>
</security:IdentityImpl>
subdomaines in Jboss-Server:
-designer
-guvnor
Can anybody help me please. Thanks a lot
--
View this message in context: http://drools.46999.n3.nabble.com/Jboss-As7-0-2-linux-designer-2-2-Final-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 11 months
Drools-expert: Memory Leak with org.mvel2.MVELRuntime
by jsoula
Hello,
I am using Drools Expert v5.30 with mvel-2.1.0-drools4.jar.
In my program, i run drools in a specific classloader (child first
urlClassloader) and i maybe detect a memory Leak with the class
org.mvel2.MVELRuntime.
In the method resetDebugger, the content of the threadLocal is never set to
null, so i have a reference in the main thread to this instance.
After call debuggerContext.set(null) with the magic of instropection, the
memory leak disappear (and i can reload my specific classloader).
Is this bug already checked? (I have scan google with no result)
Does it concerns drools or mvel?
For what this class is useful?
Thanks for help
Jérémy SOULA
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-expert-Memory-Leak-with-org-mvel...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 11 months
Deploying Guvnor 5.4.0.Final on JBossAS 7.1.2.Final
by Cristiano
Hi all,
I'm currently testing
Guvnor(guvnor-distribution-wars-5.4.0.Final-jboss-as-7.0.war) on AS 7.1 and
it seems to work fine apart from logging. I tried to play around with
jboss-deployment-structure.xml to include and exclude the logging libraries
from Jboss and also removing the logging jar's from WEB-INF/lib without
success. Also tried to tweak the log4j.xml on WEB-INF/classes.
Did someone else faced the same problem? I couldn't get any log on stdout or
on any other logger.
Any advice on how could it be fixed?
Thanks in advance ;)
--
View this message in context: http://drools.46999.n3.nabble.com/Deploying-Guvnor-5-4-0-Final-on-JBossAS...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 11 months
Guvnor integration GLOBAL/Remote HTTP resource caching error !!!
by 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/...">
<add>
<resource
source="http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Indi..."
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/Indi...
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-r...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 11 months
DSL translatio problem for !ucfirst under 5.1.1
by drdaveg
I have solved this problem before, and think it is a JAR issue, but can't
seem to remember which JAR solves my problem. The DSL sentence
[consequence][]Set {field} of {object} to
{value}={object}.set{field!ucfirst}({value});
is not working since !ucfirst is being ignored. I am using 5.1.1 because of
a reoccurring bug with the in-place DSL editor of more recent versions of
DROOLS (there are JIRA's opened, closed, reopened and commented on the bug.)
What JAR would I have wrong or be missing that causes !ucfirst to not be
processed, ie converting {field} to its setter? Thanks!
--
View this message in context: http://drools.46999.n3.nabble.com/DSL-translatio-problem-for-ucfirst-unde...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 11 months
Error on Build Package Click
by paco
I got the following error when I tryed to build the default sample repository
after starting guvnor the first time.
I then tried to build my own package, and got the same error:
400 Sorry, a technical error occurred. Please contact a system
administrator.
Service method 'public abstract org.drools.guvnor.client.rpc.BuilderResult
org.drools.guvnor.client.rpc.PackageService.buildPackage
(java.lang.String,boolean,java.lang.String,java.lang.String,java.lang.String,boolean,java.lang.String,
java.lang.String,boolean,java.lang.String)
throws com.google.gwt.user.client.rpc.SerializationException' threw an
unexpected exception: [Error: illegal escape sequence: .] [Near : {...
".aaaa.bbbb.\.[1-4]" ....}] ^ [Line: 1, Column: 22] [Error: illegal escape
sequence: .] [Near : {... ".oooo.ppp\.[1-4]" ....}] ^ [Line: 1, Column: 22]
Please
Suggest
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Error-on-Build-Package-Click-tp4018712....
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 11 months