Click here to Skip to main content
15,910,877 members
Home / Discussions / Java
   

Java

 
GeneralRe: to Java or not to Java Pin
toxcct26-Aug-08 4:28
toxcct26-Aug-08 4:28 
Questionhelp please Pin
memo26014-Aug-08 2:24
memo26014-Aug-08 2:24 
QuestionHow do I create an array of objects and use the objects methods? Pin
Member 336349812-Aug-08 23:07
Member 336349812-Aug-08 23:07 
AnswerRe: How do I create an array of objects and use the objects methods? Pin
newtypebao13-Aug-08 15:55
newtypebao13-Aug-08 15:55 
AnswerRe: How do I create an array of objects and use the objects methods? Pin
toxcct13-Aug-08 22:26
toxcct13-Aug-08 22:26 
AnswerRe: How do I create an array of objects and use the objects methods? Pin
Asran.Deng28-Aug-08 17:52
Asran.Deng28-Aug-08 17:52 
QuestionHelp Required Pin
kash_jack11-Aug-08 2:09
kash_jack11-Aug-08 2:09 
Questiona problem about drools Pin
newtypebao6-Aug-08 17:11
newtypebao6-Aug-08 17:11 
Hi,

I have encountered an infinite loop in the following example.
I just want to update the mathine's "tag".
when the "tag" is ture ,then put out message "aaaaaaaaaaaaaaaaaaaaaaa".
But infinite loop occurs even though no-loop is used.

is there anyone can help me? thanks!





package com.sample


rule "Test for type1 machine"
no-loop true
salience 100

when
machine1 : Machine($t:type , type == "Type1" , functions == "func1",code == "c001")
machine2 : Machine($f:functions,type == $t,functions=="func2",code=="c002")
machine3 : Machine(type == "Type2" ,functions==$f , code=="c003")
then
System.out.println("match");
machine1.setTag(true);
machine2.setTag(true);
machine3.setTag(true);

System.out.println(machine1.getName()+" "+machine1.getTag());
System.out.println(machine2.getName()+" "+machine2.getTag());
System.out.println(machine3.getName()+" "+machine3.getTag());

update(machine1);
//update(machine2);
// update(machine3);


end

rule "Test modify"
no-loop true
salience 90

when
machine6 : Machine(tag == true)
then
System.out.println(machine6.getName()+"aaaaaaaaaaaaaaaa");
end




public static final void main(String[] args) {
try {

//load up the rulebase
RuleBase ruleBase = readRule();
// RuleBase ruleBase =getRuleBase();
WorkingMemory workingMemory = ruleBase.newStatefulSession();

//go !
Machine machine1=new Machine("Type1","func1","machine1","c001");
Machine machine2=new Machine("Type1","func2","machine2","c002");
Machine machine3=new Machine("Type2","func2","machine3","c003");
Machine machine4=new Machine("Type2","func2","machine4","c003");
Machine machine5=new Machine("Type1","func1","machine5","c001");



workingMemory.insert( machine1 );
workingMemory.insert( machine2 );
workingMemory.insert( machine3 );
workingMemory.insert( machine4 );
workingMemory.insert( machine5 );

workingMemory.fireAllRules();


}
AnswerRe: a problem about drools Pin
Reagan Conservative20-Aug-08 10:03
Reagan Conservative20-Aug-08 10:03 
AnswerRe: a problem about drools Pin
BlackWolvix21-Aug-08 0:41
BlackWolvix21-Aug-08 0:41 
AnswerResizing dynamically JTable rows with setRowHeight(int row, int height) and TableCellRenderer not working [modified] Pin
John XXIII5-Aug-08 13:42
John XXIII5-Aug-08 13:42 
QuestionScrolling Banner with message in opposite direction Pin
hisuman1004-Aug-08 19:11
hisuman1004-Aug-08 19:11 
AnswerRe: Scrolling Banner with message in opposite direction Pin
Reagan Conservative20-Aug-08 10:17
Reagan Conservative20-Aug-08 10:17 
QuestionIP Discovery protocol Pin
Smacky31131-Jul-08 6:55
Smacky31131-Jul-08 6:55 
QuestionNeed someone to test a Java application on Mac OS X Pin
MicealG29-Jul-08 8:55
MicealG29-Jul-08 8:55 
QuestionNetbeans data entry Pin
aecordoba23-Jul-08 10:44
aecordoba23-Jul-08 10:44 
AnswerRe: Netbeans data entry Pin
BlackWolvix24-Jul-08 23:29
BlackWolvix24-Jul-08 23:29 
GeneralRe: Netbeans data entry Pin
aecordoba29-Jul-08 6:36
aecordoba29-Jul-08 6:36 
GeneralRe: Netbeans data entry Pin
BlackWolvix1-Aug-08 0:13
BlackWolvix1-Aug-08 0:13 
QuestionJava GUI help [modified] Pin
BlackWolvix22-Jul-08 9:17
BlackWolvix22-Jul-08 9:17 
AnswerRe: Java GUI help Pin
toxcct28-Jul-08 0:30
toxcct28-Jul-08 0:30 
GeneralRe: Java GUI help Pin
BlackWolvix28-Jul-08 4:07
BlackWolvix28-Jul-08 4:07 
QuestionPlease guide me about remote server code... Pin
ED STEVENS21-Jul-08 19:28
ED STEVENS21-Jul-08 19:28 
QuestionHow to implement ECDH in Java? Pin
Nayeem_Ctg16-Jul-08 0:20
Nayeem_Ctg16-Jul-08 0:20 
AnswerRe: How to implement ECDH in Java? Pin
toxcct28-Jul-08 0:28
toxcct28-Jul-08 0:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.