Usage of global variables in decision table
by Mahadevappa, Shobha
Hi,
I have a scenario where I have to write a rule in decision table to find if a particular string is present in a collection of objects.
I was thinking of placing this collection as a GLOBAL variable and execute the contains method on this collection for the string that is passed.
I am not very clear as to how to realize this in a Decision table.
Any inputs towards this is greatly appreciated.
Regards,
Shobha M
______________________________________________________________________
Disclaimer:This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data. If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding
13 years, 5 months
Checking Template Columns matching with Excel columns
by himansu.nayak
Hi,
I am using drools template and spredsheet in my application.
my generic rules are maintain in template and rules data are maintained in
spreadsheet.
Currently i am declaring the columns name in my template file for using the
field of excel.
ex:
Inside template (drt)
template header
rulesName
Application
Admission
Permission
.
.
.
.
inside excel
rule(col 1), application(col2),admission(col3), permission(col4), . . . . .
i want to make sure the excel col name has to match with exact name inside
template. currently drools checks the order of the col declared in template
with excel columns but not the actual name with the excel columns.
Any possibility by which i can force drools to match the exact col name with
the col name defined inside template file?
Thanks...
-----
Thanks...
Himansu
--
View this message in context: http://drools.46999.n3.nabble.com/Checking-Template-Columns-matching-with...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Deploy Drools in AS7 as OSGi bundles
by Dan Seaver
I'd like to use Drools as OSGi services in the JBoss Adaptive Server (version
7.1.1).
I haven't found any specifics about how to do this in the drools
documentation (or anywhere else with my google searches), so I'm attempting
to deploy the jars mentioned in the droolsjbpm-integration-docs via the
JBoss Management console. The jars are:
knowledge-api
drools-core
drools-compiler
drools-templates
drools-decisiontables
All of the jars install ok, but when I try to enable them (start the
bundles), I run into problems.
knowledge-api seems to start fine.
However, the other bundles have dependencies on drools-core.
When I try to enable drools-core, I get exceptions claiming the required
bundle, org.drools.internalapi, is missing. So, I added the following
bundle:
knowledge-internal-api.jar
Now I get the exception that package com.google.protobuf is missing.
*Any guidance on how to install drools in AS7 as OSGi services would be
greatly appreciated!*
Stack trace snippet from JBoss console when trying to deploy drools-core:
12:45:43,783 ERROR [org.jboss.osgi.framework.internal.FrameworkEventsPlugin]
(MSC service thread 1-2) Framework ERROR:
org.osgi.framework.BundleException: Cannot resolve bundle resModule:
[org.drools.core:5.4.0.Final]
at
org.jboss.osgi.framework.internal.ResolverPlugin.resolve(ResolverPlugin.java:157)
[jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
at
org.jboss.osgi.framework.internal.AbstractBundleState.ensureResolved(AbstractBundleState.java:551)
[jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
at
org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBundleState.java:211)
[jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
at
org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBundleState.java:494)
[jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
at
org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleStartTracker.java:144)
[jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStartTracker.java:119)
[jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1416)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
org.jboss.msc.service.ServiceControllerImpl.access$2700(ServiceControllerImpl.java:49)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1954)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[rt.jar:1.6.0_26]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[rt.jar:1.6.0_26]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
Caused by: org.jboss.osgi.resolver.XResolverException: Unable to resolve
Module[org.drools.core:5.4.0.Final]: missing requirement
[Module[org.drools.core:5.4.0.Final]] package; (package=com.google.protobuf)
at
org.jboss.osgi.resolver.felix.FelixResolver.resolveInternal(FelixResolver.java:117)
[jbosgi-resolver-felix-1.0.13.Final.jar:1.0.13.Final]
at
org.jboss.osgi.resolver.spi.AbstractResolver.resolve(AbstractResolver.java:149)
[jbosgi-resolver-spi-1.0.13.Final.jar:1.0.13.Final]
at
org.jboss.osgi.framework.internal.ResolverPlugin.resolve(ResolverPlugin.java:155)
[jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
... 11 more
--
View this message in context: http://drools.46999.n3.nabble.com/Deploy-Drools-in-AS7-as-OSGi-bundles-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
No viable alternative at input since upgrade to 5.4.0.Final
by tekbrain
Hi,
We have rules in domain specific language that don't work anymore.
In our dsl mapping definition:
Language expression: COUNT\({attr:[A-Z][A-Z_\d]+}\)
{constraint:(>|>\=|<|<\=|\=\=|!\=)} {num:[\d\.]+}
Rule mapping: ArrayList( size {constraint} {num} ) from collect (Fact( name
== "{attr}", dataset == "0", ignore == "false" ))
Scope: condition (when)
[condition][]COUNT\({attr:[A-Z][A-Z_\d]+}\)
{constraint:(>|>\=|<|<\=|\=\=|!\=)} {num:[\d\.]+}=ArrayList( size
{constraint} {num} ) from collect (Fact( name == "{attr}", dataset == 0,
ignore == false ))
One of the rules:
rule 'BP - HOMULTIPLE'
agenda-group "user-rules"
no-loop true
when
COUNT(BP_HOCONDITION) >= 2
then
set BP_HOMULTIPLE
end
Expanded rule should be something like this:
rule 'BP - HOMULTIPLE'
agenda-group "user-rules"
no-loop true
when
ArrayList(size >= 2) from collect (Fact( name == "BP_HOCONDITION",
dataset == "0", ignore == "false" ))
then
insertLogical(new StateFact("BP_HOMULTIPLE"));
end
Everything was working with Drools 5.1 but with Drools 5.4.0.Final, we have
this kind of errors:
[3788,20]: [ERR 101] Line 3788:20 no viable alternative at input '>=' in
rule "BP - HOMULTIPLE"
Did we forget something?
Thanks,
Jean-Luc
--
View this message in context: http://drools.46999.n3.nabble.com/No-viable-alternative-at-input-since-up...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
switching off JIT compiler in 5.4.0.Final
by Willem van Asperen
Dear List,
Does anyone know of a way to disable JIT in 5.4.0.Final? There is a snag
in that version that seems to not play nice with my application. If
there is a way to disable it then I could just bridge the time until
5.4.1.Final is released.
I have tried the following:
-Dmvel.disable.jit=true
and
-Ddrools.permgenThreshold=0
but still the same issue.
Thanks,
Willem
13 years, 5 months
Declared Types with large number of fields
by Phani Saripalli
Hi.
I am using declared types in .drl rule rule. When I kept the number of
fields in a declared type low, drools works fine. When I am increasing the
number of fields in a declared type to 300 or even more, drools raising an
exception.
Particularly, it is giving this.
ava.lang.ClassFormatError: Too many arguments in method signature in class
file com/sample/Project
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at
org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.fastFindClass(JavaDialectRuntimeData.java:615)
at
org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:254)
at
org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:237)
at
org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:88)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at
org.drools.base.ClassTypeResolver.resolveType(ClassTypeResolver.java:155)
at
org.drools.compiler.PackageBuilder.processTypeDeclarations(PackageBuilder.java:2049)
at
org.drools.compiler.PackageBuilder.mergePackage(PackageBuilder.java:1218)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:829)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:467)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:673)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:45)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:34)
at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:67)
at com.sample.DroolsTest.main(DroolsTest.java:24)
I suspect, it is something to do with creating class, constructor with so
many arguments at run time. I am looking for a solution, something like
declared types, or a workaround. The purpose for which I am using Drools
limits to use the traditional Java classes, or defining a Java class.
Also, is there any way, to perform calculations, or value propagations.
That, Drools could assume some value to a variable given a certain
constraint on it.
For example, x > 6 && x < 9, Drools could assume x as 7 or 8 and fire rules?
Thank you.
Phani
--
View this message in context: http://drools.46999.n3.nabble.com/Declared-Types-with-large-number-of-fie...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Stateless session with pre-inserted facts
by Chris Selwyn
I have a need to execute a set of rules on a complicated hierarchical data structure where some of the rules use a bunch of reference facts.
At the moment I load the reference facts and the hierarchical structure into the WM of a stateless session on every execution.
There are a lot of reference facts and they start off in the same state on every execution though they can get modified as part of the rules execution.
I would really like to be able to save the WM after inserting the reference facts so that I can start each execution with those facts pre-loaded and thereby avoid loading them each time.
Is this an easy thing to do? Could someone give me some pointers?
Chris
13 years, 5 months
Inserting String Object and accessing it in Guvnor
by Manasi
Hi,
Currently in my application I want to insert a *String object* into a
StatefulKnowledgeSession.
I don't want to insert object of any *User defined type* ,as input parameter
contains only one string parameter.
I am able to insert String object into my StatefulKnowledgeSession, but
don't know how to access it in Guvnor , as I want to use value from this
string object to satisfy one of the rule in my Guvnor decision table. I want
to use this String object as one of the condition columns in Guvnor.
Below is some code I am using:
StatefulKnowledgeSession session = kbase.newStatefulKnowledgeSession();
String myString = new String("department");
session.insert(myString);
session.fireAllRules();
Is there any way to access this String object in Guvnor?
Thanks,
Manasi.
--
View this message in context: http://drools.46999.n3.nabble.com/Inserting-String-Object-and-accessing-i...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months