Exposing rules as services
by Sumeet Karawal
Hi,
I am using Drools Guvnor to maintain the rule sets. I need to publish the
rules as stand-alone web services. Is it possible to do that? How can this
be done...
Thanks and regards,
Sumeet Karawal
Mailto: sumeet.karawal(a)tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
13 years, 5 months
Evals in 5.2
by jkrupka
Should evals be supported in 5.2 with the same syntax that was used in 5.1?
I commented on https://issues.jboss.org/browse/JBRULES-3055, but I'm
wondering if this is a bug or just an undocumented change due to the parser
work in 5.2...?
I haven't tested to see what usage of evals break in 5.2 that worked in 5.1,
I just know that I had multiple compile errors using 5.2.0CR1 on rules that
worked in 5.1 (and even in 5.2.0M2) that had a standalone eval pattern. The
jira mentions the usage of && in the eval as the thing that causes it to
break, but I haven't confirmed that.
--
View this message in context: http://drools.46999.n3.nabble.com/Evals-in-5-2-tp3043452p3043452.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Exception while save rule
by Satyendra Sharma
I am getting error message while trying to save newly created rule or update
the existing one and click save in BRMS
06:43:51,260 INFO [STDOUT] ERROR 09-06 06:43:51,260
(BundleDbPersistenceManager.java:logException:1404) rollback failed
06:43:51,260 INFO [STDOUT] ERROR 09-06 06:43:51,260
(BundleDbPersistenceManager.java:logException:1406) Reason:
Closed Conn
06:43:51,260 INFO [STDOUT] ERROR 09-06 06:43:51,260
(BundleDbPersistenceManager.java:logException:1407) State/Code:
null/17008
06:43:51,792 INFO [STDOUT] ERROR 09-06 06:43:51,792
(ConnectionRecoveryManager.java:logException:453) could not execute
statement, reaso
06:43:51,792 INFO [STDOUT] ERROR 09-06 06:43:51,792
(BundleDbPersistenceManager.java:storeBundle:1210) failed to write
bundle: 2a
java.sql.SQLException: Data size bigger than max size for this type: 4011
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:95)
at
oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2414)
at
oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1134)
at
oracle.jdbc.driver.OraclePreparedStatement.setBytes(OraclePreparedStatement.java:2170)
at
oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2823)
at
oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:3015)
at
org.apache.jackrabbit.core.persistence.bundle.ConnectionRecoveryManager.executeStmtInternal(ConnectionRecoveryManager.java:368)
at
org.apache.jackrabbit.core.persistence.bundle.ConnectionRecoveryManager.executeStmtInternal(ConnectionRecoveryManager.java:298)
at
org.apache.jackrabbit.core.persistence.bundle.ConnectionRecoveryManager.executeStmt(ConnectionRecoveryManager.java:261)
at
org.apache.jackrabbit.core.persistence.bundle.ConnectionRecoveryManager.executeStmt(ConnectionRecoveryManager.java:239)
at
org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.storeBundle(BundleDbPersistenceManager.java:1207)
at
org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.putBundle(AbstractBundlePersistenceManager.java:6
at
org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.storeInternal(AbstractBundlePersistenceManager.ja
at
org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.store(AbstractBundlePersistenceManager.java:502)
at
org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.store(BundleDbPersistenceManager.java:561)
at
org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:734)
at
org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:1140)
at
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:351)
at
org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:354)
at
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:326)
at
org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:328)
at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1141)
at org.drools.repository.UserInfo.save(UserInfo.java:198)
at
org.drools.guvnor.server.repository.UserInbox.save(UserInbox.java:176)
at
org.drools.guvnor.server.repository.UserInbox.recordUserEditEvent(UserInbox.java:171)
at
org.drools.guvnor.server.repository.RepositoryStartupService$1.afterCheckin(RepositoryStartupService.java:83)
at
org.drools.repository.events.StorageEventManager.doCheckinEvents(StorageEventManager.java:95)
at
org.drools.repository.VersionableItem.checkin(VersionableItem.java:589)
at
org.drools.guvnor.server.ServiceImplementation.checkinVersion(ServiceImplementation.java:795)
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:585)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
at
org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at
org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at
org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at
org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at
org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:157)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at
org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
at
org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
at
org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
at
org.drools.guvnor.server.ServiceImplementation_$$_javassist_3.checkinVersion(ServiceImplementation_$$_javassist_3.java)
at
org.drools.guvnor.server.RepositoryServiceServlet.checkinVersion(RepositoryServiceServlet.java:170)
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:585)
at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:188)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:224)
at
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
at
org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:53)
at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
06:43:51,792 INFO [STDOUT] ERROR 09-06 06:43:51,792
(BundleDbPersistenceManager.java:logException:1404) rollback failed
06:43:51,792 INFO [STDOUT] ERROR 09-06 06:43:51,792
(BundleDbPersistenceManager.java:logException:1406) Reason:
Closed Conn
06:43:51,792 INFO [STDOUT] ERROR 09-06 06:43:51,792
(BundleDbPersistenceManager.java:logException:1407) State/Code:
null/17008
06:43:52,339 INFO [STDOUT] ERROR 09-06 06:43:52,323
(UserInfo.java:save:201) Unable to save
javax.jcr.RepositoryException: Unable to update item: node
/drools:repository
at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1147)
-----
Satyendra Sharma
--
View this message in context: http://drools.46999.n3.nabble.com/Exception-while-save-rule-tp3043377p304...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
What is contract between Heap Size and PermGen space
by Satyendra Sharma
In my server Ram is 16GB but when
1. I tried to set max heap size to 2048MB in run.bat file and when started
jboss server it thrown exception as "Could not reserve enough space for
object heap" it accepted max 1336 mb.
2. and also JBoss server did not accept more than 128MB PermGen space but
when I reduce the heap size from 1336 to 1024 it accepted PermGen space to
max 256MB.
Please let me know the reason when I have enough memory why it is not
accepting heap size as 2048 and what is contract between heap size and
PermGen space as reducing heap size helped PermGen space to increase.
-----
Satyendra Sharma
--
View this message in context: http://drools.46999.n3.nabble.com/What-is-contract-between-Heap-Size-and-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Re: [rules-users] DROOLS PLANNER - computation times and comparison
by ge0ffrey
KD wrote:
>
> I went through some presentations on bin packing/cloud balance problems.
> I am interested in knowing about computational results relating to these
> problems, specially related to the size of the instances tackled and
> computational times. So how well do the methods scale with problem size?
>
They scale very good, both in data and in constraints.
In my experience, local search (tabu search, SA, ...) is the best up-scaling
algorithm out there.
Getting StartingSolutionInitializer right and setting a
minimalAcceptedSelection so a step is done every 1-2 seconds is critical
though.
Join the webinar next week:
http://blog.athico.com/2011/05/drools-planner-webinar-on-wednesday.html
If I have time I 'll include some graphs to prove how it scales out.
Or try it yourself in the examples: run the *Importer (classes with main())
and they 'll output you how big each dataset it. Then use the *Benchmarker
to get a graph which the results for each dataset.
KD wrote:
>
> Could you also comment on performance/computational times with other
> commercial solvers?
>
Publishing benchmarks of some of the commercial solvers is illegal under
their license terms.
Some notes:
- Micro benchmarks are generally worthless and cheatable (see JavaOne/Devoxx
presentations of Cliff Click, Joshua Bloch, ...).
- Benchmarking N-queens is stupid: it's not NP complete. It's very cheatable
and besides the Drools Planner implementation is an unoptimized tutorial.
- Benchmarking pure TSP is ok but short-sighted. You need to be able to
scale in data AND constraints. (I am working on a TSP example in Planner but
it's not finished yet).
- Competitions such as ITC2007, RAS, ... are great benchmarks: they use
real-world data, real constraints, ...
I finished 4th in ITC2007 track 1 (much has improved since then) and all of
the other finalists were researchers that wrote their experimental solvers
from scratch as far as I know.
--
View this message in context: http://drools.46999.n3.nabble.com/DROOLS-PLANNER-computation-times-and-co...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Re: [rules-users] DROOLS PLANNER - creating starting solution
by ge0ffrey
KD wrote:
>
> Hi,
>
> Reading the manual I came across "Creating a starting Solution". Is there
> a way to not provide this? For a combinatorial linear model heavy with
> hard constraints and with resonably large number of binary variables,
> implementing a method that will generate this intial solution in
> reasonable amount of time is already an achievement.
>
For now, you have to implement the StartingSolutionInitializer (copy paste
adjust one of the examples).
For 5.3 I am working on out-of-the-box support for that. The prototypes are
working already (see my fork on github) and doing great, I just have to
implement phasing so they can be run before tabu search/SA.
--
View this message in context: http://drools.46999.n3.nabble.com/DROOLS-PLANNER-creating-starting-soluti...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Drools in non-eclipse environment
by Abhay B. Chaware
Has anyone tried using drools in non-eclipse env ? meaning that org.eclipse.jdt.core_3.5.1.v_972_R35x.jar is not in the classpath ?
Documentation says this :
(http://docs.huihoo.com/drools/4.0.7/ch02s05.html)
if you do not have Eclipse JDT Core in your classpath you must override the compiler setting before you instantiate this PackageBuilder, you can either do that with a packagebuilder properties file the ChainedProperties class will find, or you can do it programmatically as shown below; note this time I use properties to inject the value for startup.
They also provide an example, but I am not able to figure out exactly how to use this example/info.
Here is my code :
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newInputStreamResource(is), ResourceType.DRL);
where "is" is input stream containing the rule file ( .drl)
How do I override the compiler setting ?
I am getting a null pointer exception ( see below ) and I suspect that overriding the packagebuilderconfiguration will fix it ?
W/System.err(25511): java.lang.NullPointerException
W/System.err(25511): at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:47)
W/System.err(25511): at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1161)
W/System.err(25511): at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:637)
W/System.err(25511): at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:267)
W/System.err(25511): at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:459)
W/System.err(25511): at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
W/System.err(25511): at com.ts.DBconnector.readKnowledgeBase(DBconnector.java:146)
13 years, 5 months
DSL Question
by jstroup
Hi,
This might be a dumb question but I've been experimenting with DSLs and
DSLRs (apart from the Guvnor) and had some limited success with creating
simple English-ish rules like this one:
rule "cheese_location_rule"
when
Cheese is "cheddar" and is from Italy
then
Add the message "Cheddar is from Italy"
end
One of the language we are seeking to model is Arden via MLMs. I know based
on other posts that Arden is not really popular as a candidate for seamless
integration into DROOLS
http://drools.46999.n3.nabble.com/Arden-Syntax-support-in-Drools-Guvnor-t...
But if one can only express whatever "language" in either the WHEN or the
THEN, then I guess I don't see the utility of it except as a grammatical
fragment of an overall language. We were hoping to use the Guvnor as a rule
authoring tool for Arden and possibly other languages. But MLMs are very
specific and procedural and (on the whole) don't match the WHEN/THEN form.
But is there any other way to author an Arden MLM from within the Guvnor (or
any arbitrary rule file for that matter) so that we can take advantage of
the grammar aware features of the editor and it's content management
abilities?
Or is it the case that the WHEN simply acts as the trigger for the rule
execution and the when can somehow "#INCLUDE" a separate flat file
containing the MLM that is editable via the Guvnor?
Thanks,
Jeff
--
View this message in context: http://drools.46999.n3.nabble.com/DSL-Question-tp3040701p3040701.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
error while trying to put kbase in cache
by sdinoo
I am trying to put kbase object into Grid
DurGridDAO dao = new DurGridDAO("durtest");
Object o = dao.getVAlue("durKnowledgeBase1");
System.out.println(o);
//
if(o==null){
System.out.println("Knowledgebase not found in cache kbase = " + o);
o = readKnowledgeBase();
System.out.println(o);
dao.putVAlue("durKnowledgeBase1", o);//
}
KnowledgeBase kbase = (KnowledgeBase)o;
Caused by: java.lang.ClassCastException: [B cannot be cast to
com.gemstone.gemfire.cache.Operation
at
com.gemstone.gemfire.internal.cache.tier.sockets.command.Put65.cmdExecute(Put65.java:85)
at
com.gemstone.gemfire.internal.cache.tier.sockets.BaseCommand.execute(BaseCommand.java:133)
at
com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.doNormalMsg(ServerConnection.java:758)
at
com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.doOneMessage(ServerConnection.java:879)
at
com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.run(ServerConnection.java:1103)
--
View this message in context: http://drools.46999.n3.nabble.com/error-while-trying-to-put-kbase-in-cach...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months