one-rule.drl

来自「jboss规则引擎」· DRL 代码 · 共 44 行

DRL
44
字号
# 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 + =
减小字号Ctrl + -
显示快捷键?