Retrieving rule name in "then" clause
by Ronald Albury
Is there a simple way for me to be able to access the rule name in the
'then' clause?
When rules fail I want to pass the rule name into my internal error handler.
Thanks in advance
13 years, 1 month
Fusion : must declare @role(event) for all class hierarchy ?
by Vincent LEGENDRE
Hi all
We are using Fusion to make some simplification and grouping on some events.
We have several classes of events, all derivated from a top-level class .
With fusion version 5.3 (and 5.2 too), we must declare the @role(event) for the top-level class, but also for all its classes hierarchy , ie the role is not inherited by subclasses.
Is it done and purpose ?
Is it a bug ?
Thanks.
13 years, 1 month
Unclear error when rule name missing
by Ronald Albury
I guess I need to learn how to submit bugs. Any help is appreciated.
If you forget the name of the rule, instead of a clear error (like "Rule
name missing") you get a NullPointerException with no indication why.
Thanks
13 years, 1 month
RuleFlow WorkItem check for abort
by cherokee
Hello,
I am newbie to using drools and using version 5.1.1 for my ruleflow test
case.
Testcase:
In the workItemHandler for a workitem, whenever exception occurs I catch the
exception and
set manager.abortWorkItem(workItem.getId());
I have 2 questions:
1) Is there a way in the onExit of workItem i can check the state to
determine if it has been aborted or completed succesfully?
2) When does the "abortWorkItem" method on workItemHandler get called?
Appreciate your time in replying to my queries.
Thanks!
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/RuleFlow-WorkItem-che...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 1 month
Re: [rules-users] Guvnor Hates Me
by Ronald Albury
First - I'd like to thank everyone for their help. I am finding Guvnor
less intuitive than I had hoped and I will need your continued patience and
assistance to understand it.
Problem 1:
I added Sample.drl (which contains two rules) from inside Eclipse, and
Guvnor split it into two rules (HelloWorld and GoodBye). I later changed
Sample.drl and when I went to update it thru Eclipse the 'Update' selection
was not highlighted - only the Add was available. So I added it again.
Now in Guvnor I have the two rules from when I first added the file, and
now the Sample.drl file itself. The Sample.drl file has the changes in it
and the two rules do not.
Problem 2:
I modified the Sample.drl file inside Eclipse again and went to update it
in Guvnor. It wouldn't let me update it - I could only Add. So I went
ahead and did an add. I can not find the changes anywhere in Guvnor.
Problem 3:
When I go to validate a rule in Guvnor it complains that it has an error
importing com.scs.test.Message. That is one of the classes in the PoJo jar
file that I have in Guvnor. I wanted the rules to be in com.scs.test.rules
and the Java code to be in com.scs.test. Can someone explain to me where I
have to put the Model, and if the Java classes need to have the same
package as the rules.
I am also having general problems about when to Save things. I originally
thought that when I uploaded something into Guvnor that was enough ... but
it appears that (at least under some conditions) I have to Save as well.
Do I have to Save things I've uploaded from Eclipse too? Guvnor never
seems to have what I think it should have.
13 years, 1 month
Guvnor hates me
by Ronald Albury
Newbie issue:
I created a package, com.scs.test
I added a model to that package (a java Jar file with POJOs in it). The
jar contains com.scs.test.Message and com.scs.test.Person.
I edited the package's "Configuration: Imported Types" to include the two
objects from the model (com.scs.test.Message and com.scs.test.Person).
I go to the package assets and open a business rule. When I click on the
plus sign across from When I get the message "Note: No model has been
defined. Tip: you will want to import or define a model for this user
interface to work !".
I thought I had imported a model. When I look at the package assets, the
model is listed right there. The objects are listed as "Imported Types".
What am I doing wrong?
Thanks
13 years, 1 month
Re: [rules-users] string replace collision problem
by FrankVhh
Hi,
Sorry, but I fogot about you :-(.
It does not work because both wolfgang and I did get your question wrong.
If I were you, I would try to work from the opposite direction and check
whether a String matches S but not SF. Than replace that S by VOL.
A second rule could than safely check for SF and replace that by S.
In short, reverse your salience, check that S is not SF and make sure that
you replace the right S in the RHS of your rules. You do not want to update
the WM.
Regards,
Frank
fiitkar wrote
>
> Sorry, it does not work.
> For input SF I allways get VOLVOLFVOL.
>
> Once again: if the input is S the output should be VOL. But if the input
> string contains SF the output should be S and not VOL.
>
> For example:
> SF --> S
> SSF --> VOLS
> SFSF -> SS
> etc.
>
--
View this message in context: http://drools.46999.n3.nabble.com/string-replace-collision-problem-tp3518...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month
org.drools.compiler.DroolsParserException while adding Package from DRL
by ssprick
Hello,
let me give you some context at first:
I'm trying to update my drools engine and guvnor from 5.1M1 to 5.3Final.
I exported my existing rules package via Guvnor 5.1 GUI into xml and
imported it back into a fresh Guvnor 5.3. The package content looks fine in
Guvnor and a package binary can be built successfully.
Now something strange happens:
5.1 engine - 5.1 guvnor --> works fine
5.1 engine - 5.3 guvnor --> works fine
5.3 engine - 5.3 guvnor --> fail
(5.3 engine - 5.1 guvnor --> not tested yet)
Let's assume the case "5.3 engine - 5.3 guvnor":
At first all I got was an unexpected global exception -- the globals aren't
added to the rulebase while reading the package. So the system is right
throwing that exception.
But why aren't they added? I figured out that there were millions of errors
while parsing the URL rule package from DRL.
So many errors, that the parser itself gets into an unhandled state and
throws the exception mentioned below.
To mention that:
I retried the same scenario with an empty package, even without any fact
model inserted but got the same error while parsing the package during
creation of a knowledge session.
My questions is:
Why does the old 5.1 engine just do well with the package from the new 5.3
Guvnor while the new 5.3 engine fails?
As I see it, the binary package creation by the guvnor has to be correct
otherwise the old engine would fail too.
I appreciate any help on resolving if there is anything wrong on my side or
if it is a real error in the parser code as the exception intends. Thank
you!
url: http://127.0.0.1:8181/drools-guvnor/rest/packages/defaultPackage/binary
java.lang.IndexOutOfBoundsException: Index: 23, Size: 23
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:103)
at org.drools.lang.ParserHelper.reportError(ParserHelper.java:386)
at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:182)
at org.drools.compiler.DrlParser.compile(DrlParser.java:225)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:394)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
at
de.tiq.rules.drools.DrlUrlRuleResource.getKnowledgePackages(DrlUrlRuleResource.java:77)
at
de.tiq.rules.drools.DroolsEngine.createKnowledgeBase(DroolsEngine.java:264)
at de.tiq.rules.drools.DroolsEngine.run(DroolsEngine.java:95)
at de.tiq.rules.TIQRulesEngine.executeRuleResource(TIQRulesEngine.java:178)
at de.tiq.quartz.QuartzTaskExecutor.execute(QuartzTaskExecutor.java:173)
at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)
ERROR JobRunShell - Job TIQRULES_PROJECT4.TIQRULES_PROJECT4 threw an
unhandled Exception:
java.lang.RuntimeException: org.drools.compiler.DroolsParserException:
Unexpected exception raised while parsing. This is a bug. Please contact the
Development team :
Index: 23, Size: 23
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:692)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
at
de.tiq.rules.drools.DrlUrlRuleResource.getKnowledgePackages(DrlUrlRuleResource.java:77)
at
de.tiq.rules.drools.DroolsEngine.createKnowledgeBase(DroolsEngine.java:264)
at de.tiq.rules.drools.DroolsEngine.run(DroolsEngine.java:95)
at de.tiq.rules.TIQRulesEngine.executeRuleResource(TIQRulesEngine.java:178)
at de.tiq.quartz.QuartzTaskExecutor.execute(QuartzTaskExecutor.java:173)
at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)
Caused by: org.drools.compiler.DroolsParserException: Unexpected exception
raised while parsing. This is a bug. Please contact the Development team :
Index: 23, Size: 23
at org.drools.compiler.DrlParser.compile(DrlParser.java:242)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:394)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586)
... 8 more
ERROR ErrorLogger - Job (TIQRULES_PROJECT4.TIQRULES_PROJECT4 threw an
exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested
exception: java.lang.RuntimeException:
org.drools.compiler.DroolsParserException: Unexpected exception raised while
parsing. This is a bug. Please contact the Development team :
Index: 23, Size: 23]
at org.quartz.core.JobRunShell.run(JobRunShell.java:210)
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)
Caused by: java.lang.RuntimeException:
org.drools.compiler.DroolsParserException: Unexpected exception raised while
parsing. This is a bug. Please contact the Development team :
Index: 23, Size: 23
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:692)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
at
de.tiq.rules.drools.DrlUrlRuleResource.getKnowledgePackages(DrlUrlRuleResource.java:77)
at
de.tiq.rules.drools.DroolsEngine.createKnowledgeBase(DroolsEngine.java:264)
at de.tiq.rules.drools.DroolsEngine.run(DroolsEngine.java:95)
at de.tiq.rules.TIQRulesEngine.executeRuleResource(TIQRulesEngine.java:178)
at de.tiq.quartz.QuartzTaskExecutor.execute(QuartzTaskExecutor.java:173)
at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
... 1 more
Caused by: org.drools.compiler.DroolsParserException: Unexpected exception
raised while parsing. This is a bug. Please contact the Development team :
Index: 23, Size: 23
at org.drools.compiler.DrlParser.compile(DrlParser.java:242)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:394)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586)
... 8 more
applicationinstance: de.tiq.web.Application@312737
StatusProcessor: de.tiq.quartz.monitoring.StatusProcessor@1059849
--
View this message in context: http://drools.46999.n3.nabble.com/org-drools-compiler-DroolsParserExcepti...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month