📄 one-rule.drl
字号:
# Example DRL with only a package decl#// yes, you can use silly java commentspackage org.drools.lang; # semi colons are optional, we're line-centricimport java.util.Listimport java.util.ArrayList;# use expanders for domain specific and pseudo natural language extensions# use expander foo;rule find seating salience 30 no-loop true when context => Context( state == Context.ASSIGN_SEATS ) Seating( seatingId:id, seatingPid:pid, pathDone == true, seatingRightSeat:rightSeat, seatingRightGuestName:rightGuestName ) Guest( name == seatingRightGuestName, rightGuestSex:sex, rightGuestHobby:hobby ) Guest( leftGuestName:name , sex != rightGuestSex, hobby == rightGuestHobby ) count => Count() #not ( Path( id == seatingId, guestName == leftGuestName) ) #not ( Chosen( id == seatingId, guestName == leftGuestName, hobby == rightGuestHobby) ) then make a ruckus, damnit Really, you should #following should be expanded using the consequence expander... modify ( anObject );end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -