validation error on Template
by kurrent93
Hi
I'm tryiing to create a template in Guvnor.
When I try to add a template key, guvnor appends _na to the variable name.
And also says there are validation errors.
Is this something I am doing wrong?
the template looks like this:
1. | rule "TestTemplate_0"
2. | dialect "mvel"
3. | when
4. | Account( accountBalance > account_balance_na )
5. | then
6. | insertLogical( new TradeOrder() );
7. | end
Thanks
Anton
--
View this message in context: http://drools.46999.n3.nabble.com/validation-error-on-Template-tp4022828....
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
org.xmlpull.v1.XmlPullParserException [Planner 5.5.0.Final]
by André Fróes
I'm receiving this exception when trying to run a model from web browser.
I'm able to run it when I simulate in a class the data, but when I try it
in my browser, i get this exception. I have no clue of why's that
happening. (pom.xml is at the end of the email)
-------------
SEVERE: Error Rendering View[/protected/crud/planner.xhtml]
javax.el.ELException: /protected/crud/planner.xhtml:
java.lang.NoClassDefFoundError: org/xmlpull/v1/XmlPullParserException
at
com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:88)
at
com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
at com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:183)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
at
com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304)
at
com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105)
at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
at
com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304)
at
com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105)
at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1757)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
at
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
at
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
at
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at
org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at com.my.proj.view.listener.LoginFilter.doFilter(LoginFilter.java:40)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at
com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at
com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at
com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NoClassDefFoundError:
org/xmlpull/v1/XmlPullParserException
at com.thoughtworks.xstream.XStream.<init>(XStream.java:343)
at
org.drools.planner.config.XmlSolverFactory.buildXstream(XmlSolverFactory.java:39)
at
org.drools.planner.config.XmlSolverFactory.<init>(XmlSolverFactory.java:49)
at
org.drools.planner.config.XmlSolverFactory.<init>(XmlSolverFactory.java:53)
at com.my.proj.planner.plan.ExecutePlan.doPlan(ExecutePlan.java:221)
at com.my.proj.planner.plan.ExecutePlan.planWorkOrders(ExecutePlan.java:211)
at com.my.proj.planner.plan.ExecutePlan.executePlanning(ExecutePlan.java:80)
at
com.my.proj.view.controller.crud.PlannerCrud.runPlanner(PlannerCrud.java:187)
at
com.my.proj.view.controller.crud.PlannerCrud.attributeResourceById(PlannerCrud.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at javax.el.BeanELResolver.invokeMethod(BeanELResolver.java:779)
at javax.el.BeanELResolver.invoke(BeanELResolver.java:528)
at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:257)
at com.sun.el.parser.AstValue.getValue(AstValue.java:134)
at com.sun.el.parser.AstValue.getValue(AstValue.java:183)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:224)
at
org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
at
com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(ELText.java:227)
at
com.sun.faces.facelets.el.ELText$ELTextComposite.writeText(ELText.java:150)
at
com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85)
... 52 more
Caused by: java.lang.ClassNotFoundException:
org.xmlpull.v1.XmlPullParserException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 75 more
WARNING: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service()
for servlet Faces Servlet threw exception
java.lang.ClassNotFoundException: org.xmlpull.v1.XmlPullParserException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:343)
at
org.drools.planner.config.XmlSolverFactory.buildXstream(XmlSolverFactory.java:39)
at
org.drools.planner.config.XmlSolverFactory.<init>(XmlSolverFactory.java:49)
at
org.drools.planner.config.XmlSolverFactory.<init>(XmlSolverFactory.java:53)
at com.my.proj.planner.plan.ExecutePlan.doPlan(ExecutePlan.java:221)
at com.my.proj.planner.plan.ExecutePlan.planWorkOrders(ExecutePlan.java:211)
at com.my.proj.planner.plan.ExecutePlan.executePlanning(ExecutePlan.java:80)
at
com.my.proj.view.controller.crud.PlannerCrud.runPlanner(PlannerCrud.java:187)
at
com.my.proj.view.controller.crud.PlannerCrud.attributeResourceById(PlannerCrud.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at javax.el.BeanELResolver.invokeMethod(BeanELResolver.java:779)
at javax.el.BeanELResolver.invoke(BeanELResolver.java:528)
at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:257)
at com.sun.el.parser.AstValue.getValue(AstValue.java:134)
at com.sun.el.parser.AstValue.getValue(AstValue.java:183)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:224)
at
org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
at
com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(ELText.java:227)
at
com.sun.faces.facelets.el.ELText$ELTextComposite.writeText(ELText.java:150)
at
com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85)
at
com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
at com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:183)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
at
com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304)
at
com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105)
at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
at
com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304)
at
com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105)
at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1757)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
at
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
at
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
at
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at
org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at com.my.proj.view.listener.LoginFilter.doFilter(LoginFilter.java:40)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at
com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at
com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at
com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
My pom:
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>${org.drools.version}</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>${org.drools.version}</version>
</dependency>
<dependency>
<groupId>org.drools.planner</groupId>
<artifactId>drools-planner-core</artifactId>
<version>${org.drools.version}</version>
</dependency>
11 years, 9 months
The buss pass example of inference results in compilation errors, how to solve these?
by ajklunder2
Hi,
In the Drools documentation is "the buss pass" example of how to use
inference.
rule "Infer Adult"
when
$p : Person( age >= 18 )
then
insert( new IsAdult( $p ) )
end
However, when I try this myself I get compilation errors on IsAdult and a
missing ";" after the insert statement. (I am using the Drools plugin in
Eclipse)
Here is an example of my own what has the same issue:
//list any import classes here.
import com.example.vdc.VdcLandingPage;
import com.invoicestore.domain.Debtor;
//declare any global variables here
global VdcLandingPage UI;
rule "Infer bad debtor"
when
$debtor : Debtor( isBadDebtor() == true )
then
insert( new IsBadDebtor( $debtor ) );
end
BuildError: Unable to Analyse Expression drools.insert( new IsBadDebtor(
$debtor ) );:
[Error: Failed to compileShared: 1 compilation error(s):
- (1,16) could not resolve class: IsBadDebtor]
[Near : {... drools.insert( new IsBadDebtor( $debtor ) ); ....}]
^
[Line: 23, Column: 0]
I have studied the Drools documentation and cannot find anything what might
lead to a solution. I have tried to set the dialect to "mvel" but that is
not solving the problem.
Any suggestions how to solve this?
--
View this message in context: http://drools.46999.n3.nabble.com/The-buss-pass-example-of-inference-resu...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
Selective TSP?
by rengana
Hi,
i'm evaluating Drools Planner as a solver for a "normal" OP problem but i
can't find any example of drools usage on problems with partial set as a
feasible solution, all drools examples and use cases seems to always try to
plan every object even if that makes the solution unfeasible.
I was able to model a OP problem using a modified version of the vehicle
routing example using two vehicles, one for containing the customers visited
(real solution) and a second vehicle for containing customers not visited.
It works OK but this approach seems very dirty...
Doesn't Drools Planner support a partial set solution that is feasible but
doesn't have to contain all problem facts? Maybe a parameter to allow
partial set solutions, and if so, be able to define the minimal problem
facts needed to consider a posible solution.
I was expecting that at least in the contruction phase the planner found
some feasible solutions, since each step it is putting one element in the
solution and then evaluating score, but found that the best solution passed
to local seach isn't the best feasible solution of the contruction phase but
always a unfeasible solution because somehow it's forcing to contains all
problem facts.
Is this correct?
Best regards,
Rui
--
View this message in context: http://drools.46999.n3.nabble.com/Selective-TSP-tp4022903.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
How can I select planning-entities in the accumulate source-pattern based on a list of planning-variables?
by Michiel Vermandel
Hi,
I am kind of stuck in writing a rule :
I have PeopleMatch facts in working memory.
Each PeopleMatch has a number of persons: PeopleMatch().getPeople = List<Person>
I have planning-entities (Tasks) which have a planning-variable Person.
Now I would like to create a rule to loop over the PeopleMatch objects, gather all Tasks for the people of this match and do some calculation with all tasks.
This is what I have for the moment:
rule "matchPeopleTasks"
when
$match : PeopleMatch()
$people : List() from $match .people
$match: Number( intValue < 0 )
from accumulate( $task : Task(handler == $people),
init( Matcher matcher = $match.getMatcher()),
action( matcher.addTask( $task ); ),
reverse( matcher.removeTask( $task ); ),
result( matcher.getMatch() ) );
then
...
end
The problem area is of course the "accumulate( $task : ProjectTask(handler == $people),"
How do I select all tasks in the accumulate function, based on a list of people?
Thanks,
Michiel
-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials
11 years, 9 months
Rule activation when using from
by wumb
Hi,
is there a way to make drools re-evaluate the LHS of a rule when using
from? What I try to achieve is, that following rule is evaluated for
every call of fireAllRules() :
global java.util.Calendar cal
rule "test"
when
java.util.Calendar() from cal
then
System.out.println("here we go");
end
Drools evaluates the rule only in the first call of fireAllRules().
Kind regards
11 years, 9 months
lua
by jigna
Is it possible to use sliding window with 'exists' conditional element?
I need to write if pattern existing has ocuured in last one hour, how should
this be written?
For eg. following is the pattern with 'exists' CE which I need to check if
has occured in last one hr.
rule "Fault"
when
exists(
ErrorPatternData
(
(errorCode(=="1200007" || =="1190002" || =="1944" || =="2a23"))
)from entry-point ErrorEntryPoint
&&
ErrorPatternData
(
(errorCode == "76004101")
)from entry-point ErrorEntryPoint
)
then
System.out.println("Fault - Rule-Has Passed");
end
--
View this message in context: http://drools.46999.n3.nabble.com/lua-tp4022851.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months