taskService restart problem (urgent response needed)
by KiranP
i m having 2-3 tasks in my flow the flow works fine in the normal conditions
the tasks are handled by the MinaTaskServer and MinaTaskClient but the
problem is that it uses the command and the call back mechanism using the
map of tasks request (if i m not wrong) hence when the taskservice restarts
all the callback refrence is lost and completing any task wont updated to
the MinaTaskServer (even if the task is available)
can any one hint me who i can achieve trans-restart task completion.....
till today none of my posts got a reply..............i think u r all
busy............if some one gets time plz help....
bcoz now it has become a grave matter.........it urgent...
thanks
-----
Keep Working >>:working:
KiranP
--
View this message in context: http://n3.nabble.com/taskService-restart-problem-urgent-response-needed-t...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 9 months
Instructions for upgrading designer.war?
by Han Ming Low
Hi,
I understand that the designer.war is a project by intalio.
When looking at the source for the war at
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/contrib/designer/desi...,
I saw the changes to be made to make it compatible with Drools.
I think I can do some of the steps like
1) changing the web.xml to use tomcat instead of jetty
2) added slf4j library
3) move lib/bpmn2 library to web-inf/lib
4) changes to oryx.js that involve
- commenting out the header
- commenting out the log
- change the repository url from "/designer/uuidRepository?uuid="+ uuid to
"/drools-guvnor/org.drools.guvnor.Guvnor/guvnorAPI?action=load&uuid="+ uuid
However, I'm not sure what is the BPMN2 import/export classes to replace in
WEB-INF/classes
Can someone could tell me which are the classes?
I can also help to update the designer. :)
Thanks.
Han Ming
13 years, 9 months
How do I prevent the package registry from being null in my package builder?
by retoy
I just installed Drools and wanted to build a simple RuleFlow.
But When I add any process containing constraints or rules to my
Knowledgebuilder, I'm always getting a NullPointerException, because the
"package registry" seems to be null.
.....
java.lang.NullPointerException
at org.drools.compiler.ProcessBuilder.buildProcess(ProcessBuilder.java:119)
at
org.drools.compiler.ProcessBuilder.addProcessFromFile(ProcessBuilder.java:223)
at
org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:447)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:503)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)
.....
ProcessBuilder.java:118 PackageRegistry pkgRegistry =
this.packageBuilder.getPackageRegistry(process.getPackageName());
ProcessBuilder.java:119 org.drools.rule.Package p =
pkgRegistry.getPackage();
.....
The ruleflow is successfully validated though when i press that button in
eclipse... Can somebody give me a hint what's missing?
Thanks!
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-do-I-prevent-the-...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 10 months
Trying to get Eclipse Java code to call Guvnor
by John Peterson
I'm using the example code from the Red Hat Magazine -
http://magazine.redhat.com/2008/08/12/jboss-drools-how-to-tuning-guvnor-
part-1/ - to try to get the sample code to work, but I keep getting the
following error:
Exception in thread "main" java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Unknown Source)
at java.util.Properties.load0(Unknown Source)
at java.util.Properties.load(Unknown Source)
at
org.drools.agent.RuleAgent.loadFromProperties(RuleAgent.java:299)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:256)
at test.GuvnorTest.main(GuvnorTest.java:15)
It appears to be unable to find my 'Guvnor.properties' file, but I have
it in the classpath (I actually have it in several different places on
my C: drive as I tried to figure out why it couldn't find it). Does
anyone have any thoughts on what's wrong here?
I'd appreciate any guidance. It seems like this should be a simple
answer but I haven't been able to figure it out.
13 years, 10 months
About for and inheritance
by Chris Woodrow
Hi,
I recently find out a few issues using for, and I wanted to share it with
you. I made a simple exemple to illustrate my purpose.
My classes are (I did not represent accessors & constructors):
public class Cheese {
protected String name;
}
public class FrenchCheese extends Cheese{
private String smell;
}
public class Person {
private Cheese likes;
}
Here is my rule set :
package rules
rule "likes cheese"
when
$person : Person ()
Cheese( ) from $person.getLikes()
then
System.out.println("likes cheese");
end
rule "likes french cheese"
when
$person : Person ()
FrenchCheese( ) from $person.getLikes()
then
System.out.println("likes french cheese");
end
First test :
Cheese cheese = new FrenchCheese("good", "camembert");
Person person = new Person();
person.setLikes(cheese);
Output :
likes french cheese
likes cheese
Wich is expected...
Second test :
Cheese cheese = new Cheese();
Person person = new Person();
person.setLikes(cheese);
Output :
likes french cheese
likes cheese
That's the first strange thing. As far as I am concerned, rule "likes french
cheese" should not match (since a Cheese is not a FrenchCheese).
I made a change to the second rule :
rule "likes french cheese"
when
$person : Person ()
FrenchCheese( smell == "good" ) from $person.getLikes()
then
System.out.println("likes french cheese");
end
Third test :
Cheese cheese = new Cheese();
Person person = new Person();
person.setLikes(cheese);
output :
It throwed an exception : Exception in thread "main"
java.lang.ClassCastException: rules.Cheese
I am not saying the ClassCastException is not to expect in such a case but I
think I would simply expect it not to match (as far as a Cheese is not a
FrenchCheese).
Chris
13 years, 10 months
Upload an existing .drl for the Guvnor dynamically
by Vandewilly
Is there any api available that allows me to load an existing file drl for
the Guvnor repository. In my case, I can not upload through the web
interface, only in a dynamic way through a java class.
--
Vandewilly Oliveira
13 years, 11 months
Drools 4.0, Support for multiple pattern in accumulate source pattern
by Juergen
It appears as if accumulate does support only a single pattern CE as
source pattern, e.g.:
Number() from accumulate(
Cheese(
price : price
),
sum( price )
)
Is it possible to have more than one pattern in the source pattern, e.g.:
Number() from accumulate(
Cheese(
price : price,
type : type
)
Person(
favouriteCheese == type,
age > 30
),
sum( price )
)
The same could be said for collect, but there the problem to specify
which item of a matching tuple is to be collected, but this could be
handled recreating collect via accumulate, e.g.:
Collection() from accumulate(
cheese : Cheese(
type : type
)
Person(
favouriteCheese == type,
age > 30
),
collect( cheese )
)
13 years, 11 months
BuildError: Unable to resolve ObjectType
by BS
Hi all,
I'm quite new to Drools and have a problem with the guided editor of the
Eclipse plugin. I'm using Drools 5.0.1.
These are the two BuildErrors for "TestGuided.brl" in Eclipse:
1) BuildError: Unable to build expression for 'consequence': Failed to
compile: 1 compilation error(s): - (1,1) unqualified type in strict mode
for: p ' update( p );
2) BuildError: Unable to resolve ObjectType 'Produkt'
In "drools.package" I have all necessary imports and also the package
statement. This is the BRL source of "TestGuided.brl":
<rule>
<name>TestGuided</name>
<modelVersion>1.0</modelVersion>
<attributes/>
<metadataList/>
<lhs>
<fact>
<factType>Produkt</factType>
<boundName>p</boundName>
</fact>
</lhs>
<rhs>
<modify>
<fieldValues/>
<variable>p</variable>
</modify>
</rhs>
</rule>
When I use the generated DRL output of the guided editor in a DRL file, I do
not get any error message. The DRL file looks like this and compiles
perfectly in Eclipse:
package com.test
rule "TestGuided"
dialect "mvel"
when
p : Produkt( )
then
update( p );
end
Adding the BRL from above to Guvnor does not throw any error. The BRL
validates and compiles perfectly in Guvnor.
So, why is it only in the guided editor of Eclipse not working but in the
guided editor of Guvnor as well as DRL file? Maybe something in my
configuration is errorneous?
Any help is appreciated, many thanks
Bernd
--
View this message in context: http://n3.nabble.com/BuildError-Unable-to-resolve-ObjectType-tp702633p702...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years
Drools and Java EE
by ljnelson
Hello; I've made a JCA resource adapter for Drools.
I've had to hack quite a bit to get it so that the KnowledgeAgent- and
resource-scanning-related parts don't use Threads, but, instead, use the
JCA-supplied WorkManager and BootstrapContext#createTimer() for asynchronous
operations (like resource scanning and notifying).
Here are some changes it would sure be nice to see, that I needed to hack
around in order to make it so that a KnowledgeAgent-produced KnowledgeBase
could be shared by Java EE components in a specification compliant manner:
1. ResourceChangeNotifierImpl#ProcessChangetSet is an inner class that is
marked as public static, but which has a package-protected constructor. I
have to create a new instance of this in order to create a
ResourceChangeNotifierImpl subclass that doesn't use threads. I hope this
constructor could be made public instead. Right now I'm calling
setAccessible(true). Yecch.
2. ResourceFactory#setFactoryService(): sure do wish this were public, or
that there were another way to install a ResourceFactoryService. I need to
do this so that the scanner and notifier are under my control (and don't use
Threads, but instead use Timers as provided by the JCA BootstrapContext
class). It appears that I do have some control here in Drools 5.1 with the
(undocumented) ServiceRegistry interface (how do I get an instance of it?
what does it do? is it used pervasively?), but I don't know, since it's
undocumented, whether it's the preferred way to do this sort of thing or
not.
3. All this indirection is really quite clunky, especially given the
META-INF/services facility. Was there a good reason this was not used? I'm
sure there was something, because having to consult a factory for a service
to get a provider to produce an instance of something is a bit much.
Hacking around those limitations, I was able to produce a Drools resource
adapter that vends KnowledgeBase instances as its user connection factories.
This means to use it in a spec-compliant manner, you do this in your
stateless (or stateful) session bean:
@Resource
private KnowledgeBase kb;
...and you get injected a wrapper KnowledgeBase that uses the Java EE
container's JCA machinery to invoke operations on the shared KnowledgeBase.
Is this something that would be interesting to other people? If so I am
happy to open source it.
Thanks for a great toolkit.
Best,
Laird
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-and-Java-EE-tp...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years