How can I get fact definied by user in GUI and insert it to DRL?
For example: The user has chosen black car in GUI (JavaFX), and now I want to use that fact in DRL code. How to send that info about black car to DRL? Should i use POJO?
答案 0 :(得分:0)
如果要执行已在DRL文件中编写的规则,则必须创建POJO并使用KieSession
执行规则。例如,
val pojo = new POJO('POJO arguments')
val kieServices = KieServices.Factory.get()
val kieContainer = kieServices.newKieClasspathContainer()
val kieSession = kContainer.newKieSession()
kieSession.insert(pojo)
kieSession.fireAllRules()