drools

How to share data between Drools rules in a map?

自古美人都是妖i 提交于 2019-12-11 16:17:30
问题 I have a rule which accepts Map() as a fact and then sets lots of elements to this map. I want to be able to use this map somewhere else when executing other rules. I read about globals in Drools but seems like they should not be used for this purpose. Right now I keep this map as private property in Java class, so that it can keep all data in web application context, but this increases my memory footprint. I know it might sound bizarre but is there any analogy in Drools rules to Java static

Stop Rules on update facts drools

我怕爱的太早我们不能终老 提交于 2019-12-11 16:16:48
问题 I have a scenario in Drools. I have some set of rules. For Example : In Rule 1: I am setting ProductName in the fact pojo that comes from session after some condition. In Rule 2: I am calculating grade value i.e. X1,X2,X3,X4. So for each grade I have single rule to calculate. The Fact pojo that is coming from User may ask to calculate any grade value. However, say user asked for X4, then all the grade value from X1 to X3 should also be calculated. What I did is that whenever any rule is

Drools rules compilation performance

萝らか妹 提交于 2019-12-11 15:37:30
问题 I'm using Drools 6.4.0.Final programmatically (no workbench) in an web app (a web service). I have 28 drl files containing 177 rules. Compilation time of these rules, on a given machine, varies considerably dependending on the execution context. I have these contexts: JUnit test cases of the rules: 1 minute JUnit test cases of the whole application (end-to-end tests): 3 minutes Deploy of the whole application with Spring Boot: 4 minutes Deploy of the whole application on JBoss EAP 6.3: 1

Create container command hangs, no error logged

混江龙づ霸主 提交于 2019-12-11 15:14:56
问题 I'm running Drools 7.7.0.final KIE server on tomcat. I am seeing this behavior when launching a container via RESTful call to the KIE server.... The container is never created, and the RESTful call hangs indefinitely. When I query the server I see that the container is stuck in 'status="Creating"'. This doesn't always happen. It seems to be dependent on the rules. For the most part, my LHS (when clause) are of the form.. myObject( (field1 != null) && field2 ) ... etc. ....where field2 is a

OutOfMemory error when executing rules for decision table using statelessKieSession

*爱你&永不变心* 提交于 2019-12-11 14:40:03
问题 I am executing rules for a decision table using statelessKieSession. I have 1000 objects and 10 rules for each object so total I have 10000 rules for one row. Rules will process for each row in the decision table. Currently before finishing the execution of one row I am getting OutOfMemory error. Any idea about this issue? From the below link you can refer the memory usage details and find the classes which creates more instances while executing the rules. 来源: https://stackoverflow.com

Drools Kie Scanner 7.5.0 not working

心不动则不痛 提交于 2019-12-11 14:33:46
问题 I am using Kie-CI api to scan the latest ruleset in local maven repository. Kie-CI is not working after upgrading to version 7.5.0. Below is the code I am using. Exception says artifact does not exists but actually artifact exists in repository. KJAR artifact is created using Kie-CI api. Any insights on this would be helpful. Code: @Async @Transactional public void scanLatestRuleset(String version){ log.info("Request received to activate new ruleset version: [ " + version + " ]"); KieServices

What would possibly be wrong with the following decision table?

你。 提交于 2019-12-11 13:27:05
问题 public class TestDecisionTable { public static void main(String[] args) { try{ KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession kSession = kContainer.newKieSession("ksession-dtables"); Screens s1 = new Screens(); s1.setDeliveryChannel("Y"); s1.setUsePointsAppl("Y"); s1.setContactDetails("Y"); s1.setRiskScore("Y"); s1.setReasonCode(100); s1.setCurrentScreen(303); kSession.insert(s1); Screens s2 = new Screens(); s2

Created drools Kie session and I get this “class not found exception”

匆匆过客 提交于 2019-12-11 13:04:33
问题 I am new to drools, testing it out to create kie session and while I tried to do that, I get this error. Followed this tutorial to do it http://javainuse.com/drools_hello_kie my pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.javainuse</groupId> <artifactId>drools-hello-world<

helloworld on Kie Workbench and Kie Server version 6.3.0

耗尽温柔 提交于 2019-12-11 12:48:28
问题 I could setup KIE Execution Server (6.3.0.Final) and Workbench (6.3.0.Final) on Wildfly 8.1.0.Final using information available in blog: http://mswiderski.blogspot.in/2015/10/installing-kie-server-and-workbench-on.html Both server and Workbench are working fine and Server is visible in Workbench under "Server Management Browser" tab. My next step is to deploy a simple container on server and test REST GET and POST calls, hence I followed steps mentioned in Question: HelloWorld using Drools

Drools 6.3 error when using java 8

别说谁变了你拦得住时间么 提交于 2019-12-11 11:53:11
问题 I am new to Drools and I am using Drools 6.3 final along with java 1.8 on eclipse. I am not using ant/Maven for building my project. The same project used to work fine with java 1.6 and Drools 5.1. Now when i try to run the project, I get an error : java.lang.Exception: java.lang.ClassCastException: org.drools.core.base.accumulators.BigDecimalAverageAccumulateFunction cannot be cast to org.drools.runtime.rule.AccumulateFunction com.ibm.msg.client.jms.DetailedJMSException: JMSCC0037: A runtime