Re: [rules-users] "Negative" Rules
by Wolfgang Laun
Have you looked at insertLogical()?
"Changes made" is a very general term, could be anything...
-
-W
2010/12/15 Diego San Esteban <diego.sanesteban(a)coremain.com>
> Greetings,
>
>
>
> How is it possible to implement a "rollback" in the KB?
> Suppose that when retracting a fact, I want to undo the changes made.
> Writing a negative (opposite) rule isn't efficient, it means declaring the rule twice effectively. Also the negative rule is usually using lots of OR’s and NOT's which isn't fast.
>
>
> Any help?
>
> Thanks
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
13 years, 11 months
Automatic unsubscribing from a Guvnor resource
by Chris Selwyn
My Guvnor is setup to save its repository in an Oracle database.
However, the DBAs have a schedule that takes the database down at night
for backup.
I am finding that, if I set up the ResourceChangeNotifier/Scanner system
then the resource gets unloaded from the KnowledgeBase when the database
is down.
Is this really a sensible behaviour?
I would like to think that there would be a distinction between the
resource disappearing from the repository (in which case it would
expected that the rules disappear from the KB) and the repository not
being accessible (in which case I would hope that the rules would remain
cached in the KB).
I am using JBoss Rules 5.0.
Chris
13 years, 11 months
Updated rules recovery from rule engine
by aditya chitre
Hi All,
We are using drl files to load the rules in the rules engine. In our
application, we can dynamically add, modify and delete rules from the rules
engine. Is it possible to get these updated rules back into a text file from
the rules engine using java?
Regards,
Aditya
13 years, 11 months
About ExtensibleXmlParser
by tangrui.cn@gmail.com
Hi list,
In the method resolveSchema of ExtensibleXmlParser class, I think there's a
problem.
I'm using a changeset.xml, which has such a header
<change-set xmlns="http://drools.org/drools-5.0/change-set"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/drools-5.0/change-set *
/META-INF/schema/change-set-1.0.0.xsd*">
I want to fetch the xsd file from the path /META-INF/schema, but failed.
According to the method statement following, to find a xsd file name, the
systemId was substring-ed using lastIndexOf method. In this case no matter
what path I use to replace the bold text, only change-set-1.0.0.xsd will be
picked. Then the method will find the file under /META-INF, META-INF and
class path. That means even I've written the path
/META-INF/schema/change-set-1.0.0.xsd, but /META-INF/change-set-1.0.0.xsd
will be used.
String xsd;
int index = systemId.lastIndexOf( "/" );
if ( index == -1 ) {
index = systemId.lastIndexOf( "\\" );
}
if ( index != -1 ) {
xsd = systemId.substring( index + 1 );
} else {
xsd = systemId;
}
--
唐睿
13 years, 11 months
Problem with FROM and temporal operators
by Harris
Hi,
I'm trying to get the following rule running:
import foo.bar.Device;
import foo.bar.Signal;
declare Signal
@role( event )
@timestamp( time )
end
rule "No red signal within the last 3 days before job start for type=4
devices .."
salience 1000
when
$p : Device( type == "4" )
$e : Signal( status == "red", this before[24h,0s] $p.jobTime) from
$p.getSignalBuffer()
then
// do something ...
end
For a special kind of device it should be checked whether there have been
alarms raised within a certain time interval.
A couple of "devices" are inserted as facts. Each device has a buffer with
its n past "signals".
public class Device {
String type;
List<Signal> signalBuffer = new ArrayList<Signal>();
Date jobTime = new Date();
// Getters and Setters
}
public class Signal {
Date time;
String status;
// Getters and Setters
}
These classes are generate by JAXB/xjc according to a given XML Schema.
Although the rule looks OK to me, I'm getting the exception:
java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be
cast to org.drools.common.EventFactHandle
I assume that "From" doesn't really work with the temporal operator and
events.
Is there a way to get this working?
Kind regards
Harris
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Problem-with-FROM-and...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 11 months
Help required for Rule Creation
by kiran.nair@rsa.com
Hi,
I want to create a rule for the following scenario:
1. Event 1 : A file was created under the directory "/root/ " (Comment:
I have implemented this using 'matches' in the rule file)
2. Event 2: If File was created under "/root/" then get all the files
created within a 30 seconds of Event1. (Comment: Confused! Don't know
how to do this!)
The dataset I have is of all the files created on the system + time of
creation.
Thanks in advance!
Rgds,
Kiran
13 years, 11 months
Rule project referencing
by GPatel@tsys.com
Hello
I am looking for a comparable feature in drools that works similar to
"rule project inheritance" in ILOG JRules.
In JRules, one can define a rule project A that contains all the
base-level rules. Then, a new rule project B can be defined that
"references" rule project A. This automatically makes all the rules
defined in rule project A available in project B. One can then add to that
set of rules by defining new rules in project B or override specific rules
in project A. This feature is very handy for setting up client-specific
rules. You can start out with a vanilla set of rules specified in project
A. If a particular client wants additional rules (or wants to override the
default functionality), a new rule project B can be created for that
client that references project A and has the additional rules. No need to
copy-paste all the rules from A to B. That way, if a rule is fixed in A,
all referencing child projects instantly benefit from the update.
Is there a similar feature in drools or a way to achieve the same
functionality?
Thanks
gpatel
-----------------------------------------
The information contained in this communication (including any
attachments hereto) is confidential and is intended solely for the
personal and confidential use of the individual or entity to whom
it is addressed. If the reader of this message is not the intended
recipient or an agent responsible for delivering it to the intended
recipient, you are hereby notified that you have received this
communication in error and that any review, dissemination, copying,
or unauthorized use of this information, or the taking of any
action in reliance on the contents of this information is strictly
prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original
message. Thank you
13 years, 11 months
Questions regarding Guvnor
by Harshit Bapna
Hello All,
Few questions:
1. What is the release date of Guvnor 5.2 ? (Couldn't find it from the site
of the documentation)
I am interested in the functionality to add the guvnor editors in
another app for rule editing.
2. I have created sub categories under categories using guvnor. Rules
created are associated to the subCategory.
Can I excess the subCategories rules using HTTP request or
KnowledgeAgent ?
for ex: *
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/MI4/
MI4-Sub/LATEST.drl*
I am not able to successfully get the knowledgeBase using this url in my
changeSet.xml
Thanks.
Harshit
13 years, 11 months
Re: [rules-users] timer and duration - and please not the PS!
by Wolfgang Laun
Ooh, it seems Eclipse outwitted me once again. But I think I made it on the
2nd try...
Sorry
W
PS:
(1) A decision on the matter of DSL variables would be appreciated. I'm
currently
developing a non-trivial DSL, and learning a lot about what's needed for a
*real world *application. Most importantly, some means of structuring the
DSL definition, so that they can be applied distinctively to specific groups
of
rules. This reduces the risk of "ricochets" if you know what I mean.
I've thought about proposing an entirely new approach, based on DRL
syntactic
entities, i.e., the expansion of a DSL phrase must be a "medium level"
non-terminal
of the DRL language. But this certainly restricts phrase parameters to
terminals.
If it's too sophisticated, you end up with a parser/compiler almost as nasty
as ANTLR3.
(2) I haven't forgotten the spreadsheet fixes. There's another relic I
found: some of
the column keywords have single letter alternatives (e.g. "U" for "no-loop",
"X" for
"activation-group"). Should I retain them - they are NOT documented in
Expert.
Should I add timer(int:)? Duration is deprecated, I'll leave this in but it
ought to
be marked clearly as such in the documentation, at least.
Please advise - I can live with everything - non of this is important for
my company,
but I want to get the fixes and additions out of my thinning hair ;-)
On 11 December 2010 00:00, Mark Proctor <mproctor(a)codehaus.org> wrote:
> On 10/12/2010 08:44, Wolfgang Laun wrote:
> > Done. There are two FIXME-tests at the end, one for timer() + not; the
> other one
> > demonstrating that drools.halt() from a rule with a timer() doesn't
> > terminate the
> > session - it also keeps firing. Notice that even with no timer() on
> > the "halt" rule
> > but with another rule having a periodic timer "overrules" the
> drools.halt().
> Did you commit? as I'm not seeing anything in trunk.
>
> http://fisheye.jboss.org/changelog/JBossRules/trunk/drools-compiler/src/t...
>
> Mark
> > -W
> >
> >
> > 2010/12/10 Mark Proctor<mproctor(a)codehaus.org>:
> >> On 09/12/2010 14:50, Wolfgang Laun wrote:
> >>
> >> I can confirm that the timer rule continues to fire
> >> - if the condition contains a not CE
> >> - even after the not CE should return false
> >>
> >> Repeating timer firing stops for "positive" CEs turning to false.
> >>
> >> sounds like a bug :(
> >>
> >> Wolfgang, could you commit your test to TimerAndCalendarTest. Take a
> look at
> >> the tests there and follow a similar format, generally when there is
> only
> >> one or two small rules we prefer to inline the text rather than
> externalise
> >> it in a file, see testIntervalTimer
> >>
> >> So that it doesn't break hudson add FIXME to the start of the rule name,
> >> such as
> >> FIXME_testTimerWithNot
> >>
> >> Ideally open a jira and when you commit the code put the jira id in the
> >> commit messgae along with the jira title and a message something like
> >> "adding failing unit test"
> >>
> >> Thanks
> >>
> >> Mark
> >>
> >> -W
> >>
> >>
> >> On 9 December 2010 15:06, OlliSee<o.roess(a)seeburger.de> wrote:
> >>> Thanks,
> >>> unfortunately not working, either.
> >>>
> >>> Maybe it will help, if I describe the scenario more detailed.
> >>>
> >>> I have three A facts inserted at the beginning.
> >>> Then the rule fires the first time after 5 seconds for every A fact and
> >>> inserts the B events.
> >>> Then I retract ONE of the B events, but the rule keeps firing for EVERY
> A
> >>> fact, despite the B events remaining in the WorkingMemory.
> >>> --
> >>> View this message in context:
> >>>
> http://drools-java-rules-engine.46999.n3.nabble.com/timer-and-duration-tp...
> >>> Sent from the Drools - User mailing list archive at Nabble.com.
> >>> _______________________________________________
> >>> rules-users mailing list
> >>> rules-users(a)lists.jboss.org
> >>> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users(a)lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >>
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users(a)lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >>
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
13 years, 11 months