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

org.drools.examples.troubleticket.TroubleTicket.drl Maven / Gradle / Ivy

The newest version!
package org.drools.examples.troubleticket

import org.drools.examples.troubleticket.Customer;
import org.drools.examples.troubleticket.Ticket;

rule "New Ticket"
	salience 10
	when
		customer : Customer( )
		ticket : Ticket( customer == customer, status == "New" )	
	then
		System.out.println( "New : " + ticket );		
end
 
rule "Silver Priority"
	duration 3000
	when
		customer : Customer( subscription == "Silver" )	
		ticket : Ticket( customer == customer, status == "New" )	
	then
		modify( ticket ) { setStatus( "Escalate" ) };
end

rule "Gold Priority"
	duration 1000
	when
		customer : Customer( subscription == "Gold" )	
		ticket : Ticket( customer == customer, status == "New" )	
	then
		modify( ticket ) { setStatus( "Escalate" ) };		
end

rule "Platinum Priority"
	when
		customer : Customer( subscription == "Platinum" )	
		ticket : Ticket( customer == customer, status == "New" )	
	then;
		modify( ticket ) { setStatus( "Escalate" ) };
end

rule "Escalate"
	when
		customer : Customer( )	
		ticket : Ticket( customer == customer, status == "Escalate" )	
	then
		sendEscalationEmail( customer, ticket );
end

rule "Done"
	when
		customer : Customer( )	
		ticket : Ticket( customer == customer, status == "Done" )	
	then
		System.out.println( "Done : " + ticket );		
end

function void sendEscalationEmail( Customer customer, Ticket ticket ) {
	System.out.println( "Email : " + ticket );
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy