doubt in the rules
by hare ram
Hello everyone,
The rules I wrote are
rule "Test 1 Rule"
salience 1000
when
Line ( $admin : line)
eval ( $admin.matches("^.*@\\S*[#>]\\s*show\\s+interface[s]*\\s*$"))
Line ( $lineSecond : line)
eval (
$lineSecond.matches("^\\s*(\\S+)\\s+is\\s+(up|down|administratively
down),\\s*line\\s+protocol\\s+is\\s+(up|down)\\s*$"))
device : Device()
then
System.out.println("********************************************");
device.setVendorType("Foundry");
end
rule "Juniper Show Interface CanIParse() Rule"
salience 5000
when
Line ( $regex : line)
eval ( $regex.matches("^.*@\\S*[#>]\\s*show\\s+interface[s]*\\s*$"))
Line ( $lineStr : line)
eval (
$lineStr.matches("^.*\\s*Physical\\s+interface:\\s*([^,\\s]+),\\s+([^,]+),.*$"))
device : Device()
then
System.out.println
("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
device.setVendorType("Juniper");
end
Basically the rules are searching for two regular expressions, of which one
is same for the both of the rules.But when i write the rules like the above
I do not get the correct o/p, but however if i change my rules to (bold) as
below, I get the correct output.So is it necessary the the declaration has
to be same if the both the rules have same regex
rule "Test 1 Rule"
salience 1000
when
Line ( $regex : line)
eval ( $regex.matches("^.*@\\S*[#>]\\s*show\\s+interface[s]*\\s*$"))
Line ( $lineSecond : line)
eval (
$lineSecond.matches("^\\s*(\\S+)\\s+is\\s+(up|down|administratively
down),\\s*line\\s+protocol\\s+is\\s+(up|down)\\s*$"))
device : Device()
then
System.out.println("********************************************");
device.setVendorType("Foundry");
end
rule "Juniper Show Interface CanIParse() Rule"
salience 5000
when
Line ( $regex : line)
eval ( $regex.matches("^.*@\\S*[#>]\\s*show\\s+interface[s]*\\s*$"))
Line ( $lineStr : line)
eval (
$lineStr.matches("^.*\\s*Physical\\s+interface:\\s*([^,\\s]+),\\s+([^,]+),.*$"))
device : Device()
then
System.out.println
("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
device.setVendorType("Juniper");
end
Thanks
Shiva
17 years, 5 months
Mike Kisker is out of the office.
by mkisker@simon.com
I will be out of the office starting 07/07/2007 and will not return until
07/14/2007.
I will respond to your message when I return.
17 years, 5 months
JBRMS question - originally posted to FMeyer
by Barfield Steve
Fernando,
Thanks for finding time to reply, I know your all busting a gut at the
mo.
Firstly, just to confirm you don't think I've missed a more obvious way
of getting a set of values (say countries) into JBRMS for use in rule
conditions.
Secondly, I'm not sure I know enough yet to suggest enhancements to
JBRMS.
Even if tables of user-defined values could be held INSIDE JBRMS for
rule conditions, it would make sense for the same tables to be visible
OUTSIDE
JBRMS to set the data that was being submitted to the rules. If a rule
is written for country "SPA" ie Spain, this rule would not be fired if
data
was submitted for country "SPN".
Regards, Steve Barfield, Developer
17 years, 5 months
JBRMS question - originally posted to FMeyer
by Barfield Steve
Fernando, I'd be grateful if you could comment on this.
Our intended JBRMS users are asking for drop down lists for conditions
on the LHS when building Business rule assets
eg.
when
Countries(c:IRAQ)
This can be done by importing a java bean into the package with
get/setters for every country
Looks ok actually
But it's a bit inflexible as the bean has to be uploaded to JBRMS each
time a new country gains independence
Can you think of a more flexible method ?
Regards, Steve Barfield, Developer
Application Services
FUJITSU SERVICES
Cavendish Road, Stevenage, Herts, SG1 2DY
* +44 (0) 870 234 8197 (Int: 7444 8197)
* +44 (0) 7867 828474
* <mailto:steve.barfield@uk.fujitsu.com
<mailto:steve.barfield@uk.fujitsu.com> >
Web: http://uk.fujitsu.com <http://uk.fujitsu.com/>
Fujitsu Services Limited, Registered in England no 96056, Registered
Office 22 Baker Street, London, W1U 3BW
This e-mail is only for the use of its intended recipient. Its contents
are subject to a duty of confidence and may be privileged. Fujitsu
Services does not guarantee that this e-mail has not been intercepted
and amended or that it is virus-free.
17 years, 5 months
Re: [rules-users] Problem with update(fact)
by Felipe Piccolini
Edson,
Thanks for the reply... it is nasty...
Jira created...
http://jira.jboss.com/jira/browse/JBRULES-966
Thanks
PD: duplicated email because I forgot to cut the huge-company-
signature... :)
On 03-07-2007, at 14:18, Edson Tirelli wrote:
>
> Felipe,
>
> Ok, this is a nasty damn bug. :(
>
> I'm working on a solution for it right now. May I ask you please
> to open a JIRA for it and attach your code bellow?
>
> Thank you,
> Edson
>
> 2007/7/3, Felipe Piccolini <felipe.piccolini(a)bluesoft.cl>:
> I know I already asked this in a previous email, but no answer and
> diferent subject... so I'll ask again
>
> I have an issue using update in 2 rules that update the same
> object... a loop is created even when I try to
> avoid the loop adding an extra condition to each rule... Im
> inserting an ArrayList as a fact too, so I can check
> the extra condition...
>
> Can anyone tell me how to fix this?
>
> Consider this:
> //-------RULES-----------------------------
> package cl.bluesoft.test
>
> #list any import classes here.
> import java.util.List
> import java.util.ArrayList
>
> import cl.bluesoft.test.rules.Fact
>
> #declare any global variables here
>
> rule "test update A"
> salience 699
> no-loop
> when
> $f : Fact($n: number > 0)
> $list: ArrayList( this excludes "key1")
> then
> System.out.println("A-fact number1:"+$f.getNumber()+ " list 1:"+
> $list);
> $list.add( "key1");
> $f.setNumber($n + 1);
> update ($f);
> update ($list);
> System.out.println("A-fact number2:" +$f.getNumber()+" list 2:" +
> $list);
> end
>
>
> rule "test update B"
> salience 699
> no-loop
> when
> $f : Fact($n: number > 1)
> $list: ArrayList( this excludes "key2" )
> then
> System.out.println( "B-fact number1:"+$f.getNumber()+" list 1:" +
> $list);
> $list.add("key2" );
> $f.setNumber($n + 1);
> update ($f);
> update ($list);
> System.out.println("B-fact number2:" +$f.getNumber()+" list 2:"+
> $list);
> end
>
> //-------FACT-----------------------------
> public class Fact implements Serializable {
> private static final long serialVersionUID = 331627137981862975L;
>
> private int number;
>
> public Fact(int number){
> this.number = number;
> }
>
> public Fact(){
> this(0);
> }
>
> /**
> * @return the number
> */
> public int getNumber() {
> return number;
> }
>
> /**
> * @param number the number to set
> */
> public void setNumber(int number) {
> this.number = number;
> }
>
> }
>
> //------TEST---------
> public class TestUpdateFact implements Serializable {
>
> private static final long serialVersionUID = -574789596641083743L;
>
> /**
> * @param args
> */
> public static void main(String[] args) {
> RuleBase ruleBase = RuleBaseFactory.newRuleBase();
> Package pkg = builder.getPackage();
> ....
> WorkingMemory session = ruleBase.getStatefulSession();
> ...etc etc...
>
> List list = new ArrayList();
>
> Fact fact1 = new Fact(1);
>
> session.fireAllRules();
>
> ....etc, etc...
>
> }
>
> }
>
> //--------OUTPUT------------
> A-fact number1:1 list 1:[]
> A-fact number2:2 list 2:[key1]
> B-fact number1:2 list 1:[key1]
> B-fact number2:3 list 2:[key1, key2]
> A-fact number1:3 list 1:[key1, key2]
> A-fact number2:4 list 2:[key1, key2, key1]
> B-fact number1:4 list 1:[key1, key2, key1]
> B-fact number2:5 list 2:[key1, key2, key1, key2]
> A-fact number1:5 list 1:[key1, key2, key1, key2]
> A-fact number2:6 list 2:[key1, key2, key1, key2, key1]
> B-fact number1:6 list 1:[key1, key2, key1, key2, key1]
> B-fact number2:7 list 2:[key1, key2, key1, key2, key1, key2]
> A-fact number1:7 list 1:[key1, key2, key1, key2, key1, key2]
> A-fact number2:8 list 2:[key1, key2, key1, key2, key1, key2, key1]
> B-fact number1:8 list 1:[key1, key2, key1, key2, key1, key2, key1]
>
> .... for ever.....
>
> So I have a loop... only when I use update and both rules...
> condition about the
> list not containing "key1" and "key2" seems not properly chequed...
> I dont know...
>
> Can somebody help me? Am I missing something here?
>
> Thanks.
>
>
> Felipe Piccolini M.
> felipe.piccolini(a)bluesoft.cl
>
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> --
> Edson Tirelli
> Software Engineer - JBoss Rules Core Developer
> Office: +55 11 3529-6000
> Mobile: +55 11 9287-5646
> JBoss, a division of Red Hat @ www.jboss.com
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
Felipe Piccolini M.
felipe.piccolini(a)bluesoft.cl
17 years, 5 months
2nd CfP RuleML-2007, Springer Confirmed, Submission Deadline Extended to July 20th
by Adrian Paschke
[Apologies if you receive this more than once]
The International RuleML Symposium
on Rule Interchange and Applications (RuleML-2007)
October 25-26, 2007, Orlando, Florida
http://2007.ruleml.org
Dear Colleagues,
Due to numerous requests about conflicting deadlines, and with Springer
as confirmed publisher, online submissions to RuleML-2007 will be
allowed until July 20 (hard deadline):
Abstract submission before July 10, 2007
Paper submission due July 20, 2007
Notification of acceptance August 6, 2007
Final submissions due August 23, 2007
The International RuleML Symposium on Rule Interchange and Applications
(RuleML-2007) will take place, October 25-26, 2007, in Orlando, Florida
http://2007.ruleml.org, co-located with The 10th International Business
Rules Forum <http://www.businessrulesforum.com>. RuleML-2007 is devoted
to practical distributed rule technologies and rule-based applications
which need language standards for rules operating in the context of,
e.g., the Semantic Web, Web 2.0/3.0, Intelligent Multi-Agent Systems,
Event-Driven Architectures, Service-Oriented Computing Applications and
Rule-based Enterprise Application Systems. A RuleML-2007 Challenge with
prizes will be organized to demonstrate tools, use cases, and applications.
Call for Papers: http://2007.ruleml.org/cfp.pdf
Highlights:
- Accepted papers will be published as Springer LNCS proceedings
- 2 Keynote speakers; Confirmed Keynote by Jürgen Angele (Ontoprise):
"Rule-based Development Support in the Automotive Industry"
- In cooperation with ECCAI (confirmend) and IEEE Computer TCAAS
- Selection of revised papers will be resubmitted to a special journal issue
- Best Paper Award
- Prestigious prizes will be awarded to the first two best applications
of the Challenge
- Panel by world-class scientists and practitioners, featuring topics on
event and rule-based computing and industry success stories
Updates:
1) Modified Challenge Requirements:
"Submissions to the RuleML Challenge 2007 consist of a demo paper of 3-5
pages, describing the demo show case, and a link to more information
about the demo/show case, e.g. a project site, an online demonstration,
a presentation about the demonstration, or a download site for the
demonstration.
The show case should demonstrate the use of rules of various kinds in
interesting and practically relevant ways, preferably (but not
necessarily) embedded into a Web-based or distributed environment."
More information regarding submissions can be found in the RuleML-2007
web site:
http://2007.ruleml.org/index-Dateien/Page787.htm
2) Enhanced Topics:
- Rules in Web 2.0 and Web 3.0
- Rules in Semantic Web Technologies
- Rules in Web Intelligence Research
We invite submissions of full, short and demo papers related (but not
limited) to one or more of the topics listed at:
http://2007.ruleml.org/index-Dateien/Page431.htm
3) All papers and demos will be carefully peer-reviewed by 3 PC
members of the Program Committee:
http://2007.ruleml.org/index-Dateien/Page508.htm
Sincerely,
General Chair
Said Tabet, Inferware Corp.
stabet AT ruleml.org
Program Co-Chairs
Adrian Paschke, Technical University Munich, Germany
paschke AT in.tum.de
Yevgen Biletskiy, University of New Brunswick, Canada
biletski AT unb.ca
Challenge Co-Chairs
Alexander Kozlenkov, Betfair Ltd., London, UK
alex.kozlenkov AT betfair.com
Ralph Hodgson, TopQuadrant, Inc., Mountain View, USA
rhodgson AT topquadrant.com
Panel Chair
John Hall, Model Systems, UK
john.hall AT modelsys.com
Publicity Chair
Suzette Stoutenburg, MITRE Corporation, USA
suzette AT mitre.org
17 years, 6 months
RuleAgent now available
by Michael Neale
As part of drools-core, there is a RuleAgent utility for automating runtime
deployment. It has been written up in the manual, in the chapter on the
BRMS.
17 years, 6 months
manual for BRMS
by Michael Neale
Hi All.
There is a chapter on the BRMS (actually a few) - which will be part of the
manual. I was thinking, should this be built into the BRMS (as part of the
documentation build, a bit like with the IDE).
The options to vote for:
1) No, leave it in the manual as now - it will cause confusion if the same
content is in 2 places
2) Put a copy of the whole manual on the BRMS web app, which can "popup"
from the front screen of the app
3) Put JUST THE chapter on BRMS into the BRMS app etc?
Thoughts?
Michael.
17 years, 6 months