Re: [rules-users] Using work items in the Eclipse ruleflow editor
by Jeremy Ary
Mike,
I ran into a similar issue when I began working with ruleflows a few weeks ago. Some of this may not be necessary and it's certainly not all causal, but this was what I noted when working my issue out:
1) If you're working in JBoss Dev Studio, it's possible that you have a conflict between the code you added as a runtime and what's already there, so try the process with a fresh install of eclipse
2) Ensure that any projects you currently have open do not have build/lib/classpath issues (I had the drools projects checked out and open and build errors caused unnecessary complications for me)
3) Be sure that your project has a META-INF on the classpath and that it's set up correctly
4) Place your drools.rulebase.conf & custom definitions .conf that it looks for are both in your META-INF under resources (src/main/resources/META-INF )
5) Once you're sure this much is correct, give Eclipse a restart - my project did not pick up my custom WI's until I restarted
If you're still having issues, I'll be on the IRC channel for the next 5 hours or so as jary - feel free to reply here or look me up there.
(well, I'm heading to lunch very soon, so back in around an hour)
Jeremy
----- Original Message -----
From: "Mike Gill" <mgill(a)modusoperandi.com>
To: rules-users(a)lists.jboss.org
Sent: Monday, September 21, 2009 11:27:46 AM GMT -06:00 US/Canada Central
Subject: [rules-users] Using work items in the Eclipse ruleflow editor
I am using Eclipse to build my Drools rulefow file. I am trying to add custom work items, but I cannot seem to get anything (other than Email and Log) to show up in my Work Items palette.
Does anyone know how to get the existing work items (such as FileFinder or Exec) to show up on the palette in eclipse?
Eventually I will need to add custom work items to the flow, so this is make-or-break Drools functionality for my team.
In pursuit of a solution to this I have combed the documentation, this mailing list archive, as well as endless Google results to no avail. Any help would be very valuable!
Thanks,
Mike
_______________________________________________ rules-users mailing list rules-users(a)lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
14 years, 10 months
Problems with GWT WebProject and Drools5.0!
by vamshidhar reddy chitti
Hi All,
I have integrated drools rule engine 5.0 with GWT WebProject. When I try to call the rule engine from GWT Applicaiton Engine, I get following exception
java.security.AccessControlException: access denied (java.io.FilePermission C:\Documents and Settings\vamshidharc\drools.packagebuilder.conf read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:139)
at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
at java.io.File.exists(File.java:731)
at org.drools.util.ChainedProperties.loadProperties(ChainedProperties.java:243)
at org.drools.util.ChainedProperties.<init>(ChainedProperties.java:69)
at org.drools.util.ChainedProperties.<init>(ChainedProperties.java:41)
at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:167)
at org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:153)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:242)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:142)
at org.drools.builder.impl.KnowledgeBuilderProviderImpl.newKnowledgeBuilder(KnowledgeBuilderProviderImpl.java:29)
at org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:29)
at com.cura.test.server.RuleEngineInvoker.readKnowledgeBase(RuleEngineInvoker.java:72)
at com.cura.test.server.RuleEngineInvoker.invokeRuleEngine(RuleEngineInvoker.java:51)
at com.cura.test.server.GreetingServiceImpl.getDept(GreetingServiceImpl.java:25)
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 com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:121)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:54)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:313)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:844)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:644)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:205)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
does anyone hav idea?
tnx in advance
bye
vamshi
14 years, 10 months
Upgrade to Drools 5 - loss of performance
by Scott Reed
I just upgraded our app from Drools 4 to 5 libraries. We just use the
rules engine with DRL. The performance of the engine on our rulebase is
unacceptably slow. I assume there is something we need to do to our
rules or the way we are configuring the engine to fix this. I don't see
anything in the release notes about backwards compatibility issues. I
would very much appreciate it if someone would direct me to any
documentation that explains what needs to be done so our 4.0 rules
perform at least as well as they did before the upgrade?
Thanks,
Scott
14 years, 10 months
Drools 5.0 - can't make it use Janino compiler - always wants eclipse jar
by Martin Smith
Hi folks,
I'm doing some very basic evaluation of Drools and can't get past the
first hurdle - the hello world example. I get this:
......
Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not
in the classpath
at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:94)
at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:55)
at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:270)
I'm not using Eclipse, my IDE is netbeans 6.8. I get the same error
running the compiled jar from outside netbeans as well so I don't
think it's related to the IDE.
I modified the example by adding a knowledge builder config and then this:
kconfig.setProperty("drools.dialect.java.compiler", "JANINO");
This had no effect. I rewrote the example to use a package builder and
set the compiler property on it to JANINO. Again, it didn't work. I
also tried passing a -Dproperty with the same thing. Again, no effect.
I have the janino jar from the download on the classpath along with
the other jars it says are necessary.
It works if I download and add the eclipse jar to the classpath but I
don't want to do this as I don't want my runtime app to depend on
pieces of eclipse.
I'm out of time and ideas now so asking for help here. These are the
drools related jars I have in the project:
antlr-runtime-3.1.1.jar
drools-api-5.0.1.jar
drools-compiler-5.0.1.jar
drools-core-5.0.1.jar
joda-time-1.6.jar
mvel2-2.0.10.jar
janino-2.5.15.jar
xstream-1.3.1.jar
Thanks,
Martin
14 years, 10 months
How to check an array field from LHS of a rule
by orchid
Hi All,
I'm using Drools 5.x. I have the following class:
public class Machine{
...
private List rules = new ArrayList();
...
}
The 'rules' list holds strings. I would like from my rule to check whether
that list contains the string "rule2".
I've tried doing this in the following ways, but get compilation error:
rule "rule1"
when
/*1st attempt:*/ $m:Machine(rules contains "rule2")
/*2nd attempt:*/ $m:Machine(rules.contains("rule2") )
then
...
What am I doing wrong?
Thanks in advance !!!
--
View this message in context: http://n3.nabble.com/How-to-check-an-array-field-from-LHS-of-a-rule-tp104...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 10 months
Groovy in drools flow
by Todd Pagni
Is there any way to get Drools flow to use the GroovyClassLoader to load
Groovy classes? I am trying the following unsuccessfully.
Setting the GroovyClassLoader
GroovyClassLoader gcl = new GroovyClassLoader();
gcl.addClasspath("c:\\temp\\"); //the
com.datacert.apps.sampleapplication.models.Person Groovy class is in
c:\temp
KnowledgeBuilderConfiguration conf =
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null, gcl);
KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder(conf);
Flow Definition
RuleFlowProcessFactory factory =
RuleFlowProcessFactory.createProcess(_processName);
int nodeCount = 1;
factory.name("Migration Approval
Flow").version("1.0").packageName("com.datacert").variable("entity",
new
ObjectDataType("com.datacert.apps.sampleapplication.models.Person")).var
iable("entityId",
new
ObjectDataType(String.class.getCanonicalName())).variable("currentApprov
erName",
Runtime error in JBoss
10:55:17,982 ERROR [[WorkflowServer]] Servlet.service() for servlet
WorkflowServer threw exception
com.datacert.core.common.exception.BaseApplicationException:
org.drools.RuntimeDroolsException: Unable to resolve class
'com.datacert.apps.sampleapplication.models.Person' for identifier
'entity
at
com.datacert.core.operations.service.impl.OperationService.invokeOperati
on(OperationService.java:57)
at
com.datacert.core.presentation.presenter.impl.ScreenPresenter.performOpe
ration(ScreenPresenter.java:521)
at
com.datacert.core.presentation.presenter.impl.ScreenPresenter.performOpe
ration(ScreenPresenter.java:483)
at
com.datacert.core.presentation.controller.springmvc.impl.ItemScreenRende
rController.performOperation(ItemScreenRenderController.java:426)
at
com.datacert.core.presentation.controller.springmvc.impl.ItemScreenRende
rController.performItemScreenOperation(ItemScreenRenderController.java:1
12)
at
com.datacert.core.presentation.controller.springmvc.impl.ItemScreenRende
rController.performOperation(ItemScreenRenderController.java:205)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
Thanks,
Todd
14 years, 11 months
Drools in jBPM
by fraction8
I have problem in using drools in simple jBPM application. Every thing works
fine while it is runs under JUNIT but when I export it to jBPM i got
exception
org.jboss.resteasy.spi.UnhandledException:
org.drools.RuntimeDroolsException: Unable to resolve class
'myclass.jbpm.vrk.Claim'
org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:319)
org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:230)
org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:206)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:360)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
root cause
org.drools.RuntimeDroolsException: Unable to resolve class
'myclass.jbpm.vrk.Claim'
org.drools.base.ClassFieldAccessorCache.getClass(ClassFieldAccessorCache.java:269)
org.drools.base.ClassFieldAccessorCache.getReadAcessor(ClassFieldAccessorCache.java:241)
org.drools.base.ClassFieldAccessorStore.wire(ClassFieldAccessorStore.java:379)
org.drools.base.ClassFieldAccessorStore.merge(ClassFieldAccessorStore.java:270)
org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:466)
org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:379)
org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:121)
myclass.jbpm.drools.DroolsRulesManager.runDrlRule(Unknown Source)
My drl is very simple:
import myclass.jbpm.vrk.Claim;
rule "Rule 01"
when
$claim : Claim( $date : date, $elements : elements, $simpleClaim :
simpleClaim )
eval( $elements <= 10 )
then
$claim.setSimpleClaim( true );
System.out.println("It's a simple claim!: " + $date + ", elements: "
+ $elements + ", simple: " + $simpleClaim);
end
The only way to solve it is to write new ClassLoader and pass it to
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null,
myNewClassLoader);
, or this error is caused by something else?
--
View this message in context: http://n3.nabble.com/Drools-in-jBPM-tp103781p103781.html
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 11 months
Re: [rules-users] Drools Planner - Scheduling question work orders
by Geoffrey De Smet
I've answered this to the user mailing list, please post any follow ups
there
http://www.jboss.org/drools/lists.html
schumacv schreef:
> Hi Geoffrey,
>
> I currently working on a project to schedule several work orders in a closed time frame on different objects. I know that this is very similar to the ITC2007 examination example, but I have big problem with the only big difference.
>
Do you mean work orders for machine queues as in "work queue planning"?
> My problem is, that the work orders I have to schedule don't have the same duration. So it can be, that the duration differs from a couple of minutes to several hours. I saw in your example, that you have worked with a list of periods, in which the exams can take place. So maybe you might have an idea or a hint for me, how I could solve this problem. Thank you in advance.
>
One way that works well on vehicle routing and work queue planning is to
make smarter moves.
Take a look at the Move implementation in the smart version of the
TravelingTournament example.
Basically, the idea is to make a non-caching
SqueezeWorkOrderBetweenTwoOtherWorkOrdersMoveFactory
that creates SqueezeWorkOrderBetweenTwoOtherWorkOrdersMove.
Where the work order is taken away, the following work orders are pulled
forward,
where the work order is added, the following work orders are pushed into
the future.
> Kind regards,
>
> Volker Schumacher
>
>
With kind regards,
Geoffrey De Smet
14 years, 11 months
Problem with legacy rules- Conditional operators
by Henrique Neves do Nascimento
Hi,
I have this case in my rules:
rule "teste ID menor que zero ou null "
dialect "mvel"
#activation-group "grupo1"
when C100($id : id < 0 || id == null)
then
System.out.println("O valor de id eh: " + $id);
end
This kind of expression "($id : id < 0 || id == null)" works fine using
drools 4.0.7, but when i tried to update my project to use drools 5.0.1, it
breaks.
As it seems, the second part of the OR statement "id == null" overwrites the
first part "id < 0", making my tests fail.
I know the alternatives to solve this expression, but i would need to search
and change more than 1500 legacy rules in my project.
Do you guys have any kind of information about this??
Regards,
Henrique
14 years, 11 months