All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.drools.examples.StateExampleUsingSalience.drl Maven / Gradle / Ivy

The newest version!
package org.drools.examples
 
import org.drools.examples.State;
 
rule Bootstrap
	when
		a : State(name == "A", state == State.NOTRUN )
	then
		System.out.println(a.getName() + " finished" );
		a.setState( State.FINISHED );
end

 
rule "A to B"
	when
		State(name == "A", state == State.FINISHED )
		b : State(name == "B", state == State.NOTRUN )		
	then
		System.out.println(b.getName() + " finished" );
		b.setState( State.FINISHED );
end

rule "B to C"
	salience 10
	when
		State(name == "B", state == State.FINISHED )			
		c : State(name == "C", state == State.NOTRUN )
	then
		System.out.println(c.getName() + " finished" );
		c.setState( State.FINISHED );
end

rule "B to D"
	when
		State(name == "B", state == State.FINISHED )			
		d : State(name == "D", state == State.NOTRUN )
	then
		System.out.println(d.getName() + " finished" );
		d.setState( State.FINISHED );
end




© 2015 - 2025 Weber Informatics LLC | Privacy Policy