Re: [rules-users] firing rules without modifying activations

2008-09-23 Thread Fermion

Wow!

This is quite an idea! Actually I AM using insertLogical() already but I
never thought about using them for this particular problem.

I actually think that your Idea is quite brilliant as it not only solves my
initial problem but also introduces the possibility to split "detaction" and
"action". As you already stated, it is absolutely true, that we will
probably have a list of problem indications (detections) and a separate list
of problem solutions (action) which can have more than just ono-to-one
links.

Thanks for the fast response and this great idea!

I'm currently in the final stages of my PhD thesis, but once I'm done, I'll
gladly put some information about our project on the webpage you mentioned.
-- 
View this message in context: 
http://www.nabble.com/firing-rules-without-modifying-activations-tp19623537p19629221.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] firing rules without modifying activations

2008-09-23 Thread Fermion

Hi,

I'm doing an expert system for a highly complex high energy physics detector
(CERN->ATLAS->Pixel Detector->Detector Control System).
In principle the detector is a complex machine with a rather hierarchical
structure.

The idea is to use a Drools based expert system to inform the operator of
the Detector about what to do in case of a problem. The system itself is
controlled by something that we call a "Finite State Machine" which is
reducing the complex operation of the detector to a number of simple
button-actions.
As the Finite State Machine does not suggest, what to do, if something goes
wrong, the expert system should do that.

In order to do so, the expert system shall display "solution advices" to the
Detector operator. As there can be many unrelated problems at the same time,
we use a tree-structure to show, where in the Detector the problem happened.
If a rule gets activated by a fact (in my case a process parameter of the
detector, e.g. a temperature), the corresponding node in the tree is being
highlighted by a dedicated icon. Once the facts change and the activation is
cancelled, we remove the highlighting icon, so that the tree only shows the
current activations (we don't need logging here, as this is done elsewhere).

This works absolutely fine for us, BUT:
We can't FIRE the activations, as this would immediately remove them from
the agenda, which in turn would remove them from our tree => no operator
would see them.
At first I thought, that NOT-FIRING those activations wouldn't hurt, as we
just wrote the "solution" on the RHS of the rule and parsed this RHS by
ourselves. This way, we displayed the solution belonging to a given
activation as long as it was still on the agenda.

You can see, that the main problem of this is that one CANNOT do things
like:

PrintSolution("Reason for problem is a over-temperature of: " + $temp + "°C
on Module: " + $moduleName);

In our case we could still parse the code, but would be unable to access the
local variables $temp and $moduleName (example) without actually firing the
rule.
Firing the rule on the other hand would cancel it's activation, rendering
our display tree useless.

I think the thing that would be most usefull for us would be a way to fire a
rule "silently", without notifying the agenda about it (so that the
activation would NOT be removed).

I'm not sure whether I was able to explain the problem sufficiently, but
maybe someone has an idea how to handle the situation.

Thanks very much!
-- 
View this message in context: 
http://www.nabble.com/firing-rules-without-modifying-activations-tp19623537p19623537.html
Sent from the drools - user mailing list archive at Nabble.com.


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] activationCancelled() not being executed?

2008-09-22 Thread Fermion

I don't think that I can add something of value to the discussion from this
point on as my expertise concerning Drools is quite limited. 

I followed Edson's advice and used ruleflow-groups instead of agenda
filters. This works like a charm and enables me to have my rules react as I
want.

>From my limited point of view, it would probably make sense to stick to what
might be a new users expectation of an agenda filter:


Drools Manual, 2.5.7.3. Agenda Filters wrote:
> 
> "Filters are optional implementations of a the filter interface which are
> used to allow/or deny an activation from FIRING."
> 

After I read this section of the manual, I was under the impression, that
the ONLY thing an agenda filter would do, was to prevent a rule from FIRING.
This would be the case if the "fire an "activation cancelled/skipped" for
the rules filtered out" fix would be implemented, as the rules filtered out
would then be treated as any other rule, apart from the fact that they do
not fire.

The other suggested solution might have it's own benefits, that I can't
judge at the moment. If the "not remove filtered out activations from the
agenda" fix should be implemented, I think that the manual should be updated
in order to inform people about the fact, that it is not only the FIRING
that is prevented by the agenda filter.


Edson Tirelli-3 wrote:
> 
> "
> As it is now, a call to fireAllRules() will always remove all the
> activations from the agenda, but will simply skip over the rules that do
> not
> match the filter. Since I don't think the semantics for the agenda filters
> were ever spec'd, we need to do it in order to decide if the "fix" for
> this
> is to fire an "activation cancelled/skipped" for the rules filtered out or
> if the "fix" is to not remove filtered out activations from the agenda.
> "
> 

-- 
View this message in context: 
http://www.nabble.com/activationCancelled%28%29-not-being-executed--tp12387991p19609068.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] activationCancelled() not being executed?

2008-09-21 Thread Fermion

After Edson helped me sort some things out, it came clear, that the actual
problem is the use of agenda filters in my test.

If one uses them, the "activation cancelled" events will not reach the
listeners (I don't know whether the activations are cancelled or not).

Disabling the agenda filters, the activation cancelled events will be
propagated to the listeners.

According to Edsons suggestion I filed a JIRA bug report that can be found
at JBRULES-1775.

I will try to avoid the problem by using agenda groups instead. 

After finding out, what caused the problem, it was possible to reduce the
test code by quite a bit:

http://www.nabble.com/file/p19598702/smaller_test.zip smaller_test.zip 
-- 
View this message in context: 
http://www.nabble.com/activationCancelled%28%29-not-being-executed--tp12387991p19598702.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] activationCancelled() not being executed?

2008-09-21 Thread Fermion

Hi!

It's been quite a while and we tried several other approaches but in the end
it all comes back to the old problem:

a) fact creates activation
b) fact changes to a value that does NOT fulfill the LHS of the formerly
activated rule
c) activation does NOT get cancelled
d) fact changes again to a value that DOES fulfill the LHS of the still
activated rule
e) fact creates ANOTHER activation (!)

I tested this behaviour with the test code that can be found in the test.zip
archive a few mails earlier in this thread.

IT DOES NOT DEPEND on whether one uses property change support or update() .
The only activation cancellations I'm able to get correspond to the fact,
that update first retracts the fact from the working memory and the
reinserts it afterwards (something the property change obviously does not).

But even with the retraction-cancellations of the update(), the problem
remains the same:

I have ONE fact that changes over time. Let's say all 5 seconds. If that
leads to a new activation every 5 seconds, I will quickly end up with an
enormous amount of activations for basically the same thing.

I would expect that if one gets and activation A for a value of -15°C
(example from test.zip) and the temperature value changes to -16°C creating
another activation B, that activation A would be cancelled (as its facts are
no longer existing).

I really need a way to limit the number of activations caused by the same
fact to ONE.

Sorry to bother you again with this.
-- 
View this message in context: 
http://www.nabble.com/activationCancelled%28%29-not-being-executed--tp12387991p19597177.html
Sent from the drools - user mailing list archive at Nabble.com.


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Initiating global in rule

2008-05-06 Thread Fermion

Hi!

I know that this topic has been partially covered in this:
http://www.nabble.com/Initialize-Global-to13388685.html#a13388685
thread.

Nevertheless I think that the geiven answers are only partially satisfying.

Basically the main problem is still unsolved:

One has a global variable inside the DRL and wants to initialize it in a
rule (most likely the initial rule). Althoug several posts in the above
thread point out, that this should be easily possible doing this:

global String test

rule "Initial Rule"
when
then
> session.setGlobal("test", "Hello World");
> System.out.println(test);

will lead to infinite recursions of this initial rule without the code ever
reaching the println()!

I tried several variations of the above. At least of of the ones that have
been used in the aforementioned thread: using no-loop true, using
initialization from Java application using a function call, testing for null
pointer with eval(test == null) and so on.

I'm using Drools 4.0.3 and I have the strong impression that this is a bug,
as all the code examples mentioned in the other thread DO NOT SOLVE the
problem. The recursion still exists.

Thanks for any help in advance!
-- 
View this message in context: 
http://www.nabble.com/Initiating-global-in-rule-tp17081556p17081556.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Type-Casting in when-part of rule

2008-04-11 Thread Fermion

Hi!

I'm using pattern matching on Java objects in the when part of my rules. One
example might be:

CommonDataObject($name : name matches ".*STATUS_D.._B..\.fsm.*", type ==
Type.STRING, $stringValue : stringValue != "OK" && stringValue != "UNKNOWN")

So you can see, that my Java object "CommonDataObject" has at least 3
members: name, type and stringValue.

This works all fine.

Unfortunately my object could also hold a Float or an Integer value.

The current implementation uses additional "floatValue" and "integerValue"
members in order to access them from the rules.

I would prefer very much to remove my "stringValue", "floatValue" and
"integerValue" members at all. As I already have a "type" member (which can
be Type.STRING, Type.FLOAT or Type.INTEGER), I would like to just store one
member called "value" which would then just be an Object.
As the rules have access to the type-member, they should then be able to
cast the value-member to the correct type:

CommonDataObject($name : name matches ".*STATUS_D.._B..\.fsm.*", type ==
Type.STRING, $value : (String)value != "OK" && (String)value != "UNKNOWN")


Unfortunately it seems, that a direct type-cast is not possible in the when
part of a rule.

Maybe someone knows a way to realize this functionality...

Thanks in advance!
-- 
View this message in context: 
http://www.nabble.com/Type-Casting-in-when-part-of-rule-tp16628142p16628142.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Using the audit viewer in own panels

2007-12-10 Thread Fermion

Hi!

I really like the audit viewer that you get if you use the drools
perspective in eclipse. It would be great if one could use the audit viewer
and the possibility to open old log files within a java user application.

Is there a possibility to integrate / use the audit viewer in my own java UI
application? If so, how would I do that (as I don't find any fitting classes
in the API-doc)?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Using-the-audit-viewer-in-own-panels-tp14250616p14250616.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


re[rules-users] trieving the RHS of a rule at run-time

2007-10-19 Thread Fermion

Hi!

I want to display all my current activations in a JTable object. On
selection of one of the hereby created rows (each representing an activated
rule by its name), I want to display additional info on this rule.

It is no problem to retrieve the rule from the RuleBase, as I know the
Package and Rule names. Unfortunately the toString()-output of the
associated Consequence is not really what I want.

What I really want is the RHS of the rule in analogy to the Rule.getLHS()
method. Unfortunately there is no such method for the RHS.

Is there a work-around for this? I would really like to avoid parsing the
rule file just to get the RHS of a rule.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/retrieving-the-RHS-of-a-rule-at-run-time-tf4653148.html#a13294400
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] activationCancelled() not being executed?

2007-10-17 Thread Fermion

Hi,

I tested the now really self contained code on a colleagues machine. He
isn't using Eclipse which has the nice side-effect of proving that it's not
something with my IDE settings...
We were able to reproduce the bug with the 6 files included in the attached
.zip.

http://www.nabble.com/file/p13253739/test.ZIP test.ZIP 

Short description of the files:
Test.java: The main class including the main.
CommonDataObject: My POJO used for storing the test fact. It automatically
notifies the rule engine in case of a value change by the use of the
firePropertyChange() method. 
Types.java: A very simple enumeration object used in CommonDataObject.
XPS_AgendaFilter: Very simple agenda filter.
Rules.drl: My two very simple rules. The agenda filter used in
XPS_AgendaFilter ensures that only the first rule is fired.
Rules.dsl: An even more simple dsl file. Temperatures are good if -10.0 < T
< 40.0.


What the test app does:
It creates a temperature fact and sets its values to -15.0, 15.0, -25.0 and
25.0 with a little delay of 2 seconds in between.
An activation is created for the first value. Nothing happens after the
second value (15.0) comes in. -25.0 creates another activation, which is
again not canceled by the 4th value modification.

I might remember you that you'll need to change that one line in the code of
Test.java that specifies the location of the rules.

Thank you very much,

Fermion
-- 
View this message in context: 
http://www.nabble.com/activationCancelled%28%29-not-being-executed--tf4348054.html#a13253739
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] activationCancelled() not being executed?

2007-10-17 Thread Fermion

Oh, yes! Of course, stupid enough! That's the problem if one does not
actually test something that is meant to be self contained on another
machine...

I'll first test it on the machine of a colleague of mine and then I'll post
ALL the necessary files. Promised.

Until then: of course it was not possible for you to see this (as the file
was missing) but actually I'm (at least trying) to use automatically
updating objects. Instead of calling an update() method, I referred to the
manual and used a firePropertyChange().
But as you will see once I managed to get you all the files (shame on me),
this is not the problem, as data IS updated...

I'll post again, once it really is "self contained".

Thanks for the fast help,... again!

Fermion


-- 
View this message in context: 
http://www.nabble.com/activationCancelled%28%29-not-being-executed--tf4348054.html#a13252596
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] activationCancelled() not being executed?

2007-10-17 Thread Fermion

Hi!

Self-contained test is available. See last post.

Thanks,

Fermion



Edson Tirelli-3 wrote:
> 
>It is really difficult to answer that since your understanding seems
> correct. Is it possible for you to provide a self contained test showing
> the
> problem?
> 
>[]s
>Edson
> 
> 

-- 
View this message in context: 
http://www.nabble.com/activationCancelled%28%29-not-being-executed--tf4348054.html#a13249572
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] activationCancelled() not being executed?

2007-10-15 Thread Fermion

Hi again!

Finally I realized that it would be best to do what I was asked for: supply
some self-contained test code.
Although it was a rather painful process, it was worth it, as the strange
behavior is still present.

I'm far from saying that this is a bug. On the contrary, I'm quit sure it's
just a very stupid thing in my code.

But at least it should be easier for someone else to have a look now...

Just download the 3 following files and copy them into the same directory.

As I was to lazy to include something more clever, I hardcoded this path, so
that you'll need to modify the line

String absoluteFilePath = "C:/Dokumente und
Einstellungen/Henss/workspace/DeploymentTest/";

to point to your folder.

If you use Eclipse and the Drools plugin, you should also be able to browse
this directory for the created log files (of course after running the small
app at least once) using the "Audit View".

I hope this helps to narrow it down a bit.

Thanks,

fermion

http://www.nabble.com/file/p13214347/Test.java Test.java 
http://www.nabble.com/file/p13214347/Rules.drl Rules.drl 
http://www.nabble.com/file/p13214347/Rules.dsl Rules.dsl 
-- 
View this message in context: 
http://www.nabble.com/activationCancelled%28%29-not-being-executed--tf4348054.html#a13214347
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] activationCancelled() not being executed?

2007-10-15 Thread Fermion

I did some major code-cleaning in the meantime and I feel a bit more
comfortable now...

Unfortunately this still didn't help me with my two problems:
a) I still have the problem that my activations don't get canceled.
b) I don't think that I'll be able to distill the code in order to get a
self-contained project out of it.

So instead I had a closer look at the "Manners" example and I found only two
obvious differences from my code:

1. Manners uses a "StatefulSession" object, whereas I used a "WorkingMemory"
instance. I changed my code to use a StatefulSession as well, but the
strange behavior didn't disappear.

2. Manners uses the standard ClassLoader while I'm using an URLClassLoader
in order to access my rule files (I plan to deploy my application as a
single executable .jar file (created with "Fat Jar" eclipse plugin), but I
want to have my rule files in a separate folder). 
Changing this didn't help either.

So this basically means, that there is another difference that I've missed
so far.


What I HAVE seen is, that the fact IDs of my rules change (I think this is a
good thing):
If I insert a fact with a temperature value of (e.g.) "-15 °C", a
temperature-out-of-range rule gets activates (not fired).
In my little table an activation is added caused by the fact with the fact
ID 21:34.
Now I change the temperature of this fact back to something "in range"
(e.g.) "20°C". Instead of the activation being canceled and therefore
disappearing from my table, it just stays there.
Now I change the temperature back to something that is out of range: "-30
°C". A NEW activation is inserted into my table with a fact ID of 21:38. At
the same time, the fact ID of the first (still persistent) activation
changes to 21:38 as well!

I hope that this means that drools realizes that the fact value of the first
value has changed. But if this is true, then drools also noticed that the
value changed before, without cancelling the activation.
To my knowledge this also proves that my implementation of the fact beans
hashCode() and equals() methods is working correctly.

There has to be an error in my reasoning.

Thanks again,

fermion
-- 
View this message in context: 
http://www.nabble.com/activationCancelled%28%29-not-being-executed--tf4348054.html#a13211834
Sent from the drools - user mailing list archive at Nabble.com.


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] activationCancelled() not being executed?

2007-10-11 Thread Fermion

Hi,

as you might have noticed, I'm trying to avoid supplying a self-contained
test package.

The problem with that is, that my application code has grown quite a bit and
it will not be very easy to extract the code.

Nevertheless I will provide such a test package, should I not succeed in
finding the error myself very soon. As  I have next to no experience in
Java, I just want to rule out that it is no stupid Java-beginner mistake.

Actually I'm quite sure that it is; otherwise the bug would most likely be
known to someone in the community.

Therefore I will first clean up my code a bit more.

Thanks for the help anyway and I'll report back...

fermion
-- 
View this message in context: 
http://www.nabble.com/activationCancelled%28%29-not-being-executed--tf4348054.html#a13162482
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] activationCancelled() not being executed?

2007-10-11 Thread Fermion

It's been a while since I had time to investigate this problem.

I followed your advice and hooked up the DebugAgendaEventListener to my
workingMemory instance.

This clearly shows, that my activations are created but never canceled. So
at least it is consistent with what I'm observing in my application.

But before I start even considering it being a bug (I'm quite sure it is
not), maybe it's better to understand what is happening in my code:

I think that I nailed my problem down to an issue with my fact IDs:

If I have, for example, a real world value (lets say a temperature) that is
connected to a java bean, my understanding is, that the fact ID of this
value inside the workingMemory should not change, even if I change the real
world value (temperature rises)(and thus the java beans value).
In fact the change is propagated to the working memory (as I call
"firePropertyChange" inside my bean), but a NEW rule is activated by the
changed fact, having a DIFFERENT fact ID!

I'm quite sure that this is the reason for my problem with the missing
cancellations. I'd assume that for a rule to be canceled the fact with the
CORRECT fact ID would have to be changed.

Now, in my application, it seems that every modification creates a NEW fact
inside the working memory (which is of course not, what I want).

I had the hope, that calling the firePropertyChange from inside the beans
"setters" would notify the working memory automatically about the correct
fact-ID.

I checked my "equals()" and "hashCode()" methods but the hash code is always
constant and equals is correspondingly true. I also checked that I don't
accidentally re-assert the fact on modification.

So what I don't understand is WHY the working memory thinks that the fact ID
has changed...

See you,

fermion
-- 
View this message in context: 
http://www.nabble.com/activationCancelled%28%29-not-being-executed--tf4348054.html#a13158335
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Basic questions about rule deployment

2007-10-11 Thread Fermion

Thanks for the warning!

I tested this with a path that contains spaces. For some reason I don't have
any problems with the corresponding URLs. Nevertheless I tried to convert
those URLs into URIs and THEN I see the problem of the spaces not being
accepted.

As the URLClassLoader takes URLs, this is not really an issue for me so far.

Still I don't really understand what is going wrong, as I had the impression
that URLs are a SUBSET of URIs. But this relationship seems not to be
strict...

The only thing I can say is that my app works with spaces inside the path
without the need of the described URI-workaround.
-- 
View this message in context: 
http://www.nabble.com/Basic-questions-about-rule-deployment-tf4601653.html#a13155173
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Basic questions about rule deployment

2007-10-11 Thread Fermion

Thank you very much!

I followed your advice and created URLs for my .drl and .dsl files.
Then I created a new URLClassLoader instance with these two URLs.
Finally I assigned this class loader to my packager builder using:

myPackageBuilder.getPackageBuilderConfiguration().setClassLoader(myURLClassLoader);

Absolute path names seem to be Ok, as long as one uses "file:" as a prefix
to the URL string. I plan to use a config file to specify the locations of
my rule files (dsl and drl). The location of the config file itself will
then be defined by a command line argument.

Thanks again!
-- 
View this message in context: 
http://www.nabble.com/Basic-questions-about-rule-deployment-tf4601653.html#a13152365
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Basic questions about rule deployment

2007-10-10 Thread Fermion

Hi,

I've finished my first small application using JBoss Rules. My current
deployment "strategy" is that I want to have a single executable .jar file
containing my application and an external (not included in the .jar) folder
that contains the rules that should be used.

Unfortunately, this seems to be harder, than I thought, as my application
refuses to use .drl or .dsl files that are outside of the package.

I'm quite sure that it's just my misunderstanding of the manual that leads
to the problem, as this seems to be one of the most basic deployment
approaches, as stated by the manual:

"
Chapter 7. Deployment and Testing
7.1. Deployment options

Once you have rules integrated in your application (or ideally before) you
will need to plan how to deploy rules along with your application. Typically
rules are used to allow changes to application business logic without
re-deploying the whole application. This means that the rules must be
provided to the application as data, not as part of the application (eg
embedded in the classpath).
"

Unfortunately I have quite some problems understanding the rest of the
chapter. So I just used and modified on of the given examples.

CODE/*

//read in the source
Reader source = new
InputStreamReader(JBossRules.class.getResourceAsStream(KNOWLEDGE_FILE));

//read in the DSL
Reader dsl = new
InputStreamReader(JBossRules.class.getResourceAsStream(DOMAINSPECIFICLANGUAGE_FILE));

//Use package builder to build up a rule package.
//An alternative lower level class called "DrlParser" can also be used...
PackageBuilder builder = new PackageBuilder();

//Use the following instead of above if you are using a DSL:
builder.addPackageFromDrl(source, dsl);

*/CODE

If I use

KNOWLEDGE_FILE = "/Rules_withDsl.drl";
DOMAINSPECIFICLANGUAGE_FILE = "/Rules_withDsl.dsl";

it all works wonderfully... but then the rules are within my .jar :-(

So I tried to change this into a folder outside the package:

KNOWLEDGE_FILE = "C:/test/Rules_withDsl.drl";
DOMAINSPECIFICLANGUAGE_FILE = "C:/test/Rules_withDsl.dsl";

Now, it doesn't work any more, because the "getResourceAsStream" returns
null pointers...

Any idea?

Thanks
-- 
View this message in context: 
http://www.nabble.com/Basic-questions-about-rule-deployment-tf4601653.html#a13138467
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] activationCancelled() not being executed?

2007-08-30 Thread Fermion

Hi!

I'm using a JTable to display rules that have been activated.

My goal is to have the table display a set of activations ordered by their
salience. The user should then choose which one of them to fire (if you want
to know why, be invited to read the background).

Of course this makes only sense as long as the activations are valid. Rules
whose activation has been cancelled should still be displayed, but in a
different style (like greyed out).

In order to accomplish this, I want to use an implementation of the
AgendaEventListener-interface, implementing the
activationCancelled()-method.
The Listener itself works, as I use the activationCreated()-method to add
the rule as a row to my table (which works fine).

Unfortunately the activationCancelled()-method doesn't seem to be executed
at all!


I assume that I have a fundamental misunderstanding of what should trigger
an activationCancelled() event?


Background: (just if you're curious...)
I'm working as a PhD student in physics at the CERN international
high-energy physics laboratory, for the ATLAS experiment.
As a member of the Detector Control System (DCS) group, I'm going to write
an expert system in order to assist the shift crew with the detector
operation.

The operation of the detector is a difficult task, because more than 7
parameters (like voltages, currents and temperatures) have to be controlled.
A Finite State Machine (FSM) computes a defined and limited number of states
from the given parameters (like ON, OFF, STANDBY,...).

I'm going to synchronize the expert system application to ERROR states of
the FSM, in order to extract the relevant parameters from the system (as it
would be impossible to feed all parameters into the XPS all the time).
This is handled by quite some control rules that decide which data has to be
requested, released and so on.
Once all necessary data has been received, this might lead to activations of
the (more interesting) user rules.
Those rules have an explanatory character like "The temperature of this XYZ
is too high, so please try ABC."

For a given set of facts I assume more then one rule to be activated. Whilst
the rule engine should take care of the execution (firing) of all control
related rules, the execution of the user rules should be under direct user
control.

Displaying all activations in a GUI will allow the user to pick one (try it)
and rate it (the proposed solution solved the problem "yes/no"). Changing
the rules salience according to the answer, will allow the system to
dynamically reflect the current system status. (Rules that are related to
broken connections / wrongly connected cables are likely to be found at the
beginning of the experiment but hopefully only on rare occasion later on.)

In order to ensure that no information is lost during the absence of DCS
experts (which will not always be around), a log file should be written for
each major FSM-ERROR. At the moment the WorkingMemoryFileLogger seems to be
predestined for this job. This way I hope to collect large amounts of ERROR
data during the initial phase of the experiment that helps to extract rules
for numerous error conditions.
This will become especially handy, as such errors have a tendency to come
back, even if the original detector experts are gone for years...
-- 
View this message in context: 
http://www.nabble.com/activationCancelled%28%29-not-being-executed--tf4348054.html#a12387991
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users