📄 troubleticketwithdsl.drl
字号:
package org.drools.examples
expander ticketing.dsl
rule "New Ticket"
salience 10
when
There is a customer ticket with status of "New"
then
Log "New"
end
rule "Silver Priorty"
#if after a certain time, we still have an issue, then escalate
duration 3000
when
There is a "Silver" customer with a ticket status of "New"
then
Escalate the ticket
end
rule "Gold Priority"
duration 1000
when
There is a "Gold" customer with a ticket status of "New"
then
Escalate the ticket
end
rule "Platinum Priority"
#we don't want to make the high rollers wait !
when
There is a "Platinum" customer with a ticket status of "New"
then
Escalate the ticket
end
rule "Escalate"
when
There is a customer ticket with status of "Escalate"
then
Send escalation email
end
rule "Done"
when
There is a customer ticket with status of "Done"
then
Log "Done"
end
# This is the same as the non DSL version. This could be kept in another file of course.
function void sendEscalationEmail( Customer customer, Ticket ticket ) {
System.out.println( "Email : " + ticket );
}
#hey, the imports can appear anywhere !
import org.drools.examples.TroubleTicketExampleWithDSL.Customer;
import org.drools.examples.TroubleTicketExampleWithDSL.Ticket;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -