WIP drools 7.57.0.Final and Kotlin

This commit is contained in:
nheron 2025-06-05 10:50:34 +02:00
commit 58bea5166d
15 changed files with 121 additions and 107 deletions

View file

@ -5,7 +5,7 @@
<parent>
<artifactId>drools-framework-base-tools-parent</artifactId>
<groupId>com.pymmasoftware.jbpm</groupId>
<version>1.3.0-SNAPSHOT</version>
<version>7.57.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View file

@ -1,46 +0,0 @@
/*
* Copyright 2014 Pymma Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.chtijbug.drools.common.reflection;
import java.lang.reflect.Method;
/**
* Created with IntelliJ IDEA.
* User: samuel
* Date: 26/09/12
* Time: 15:45
*/
public class ReflectionUtils {
/**
* Returns <code>true</code> if the method is a getter meaning :
* <ul>
* <li>method name start with 'get' </li>
* <li>no parameters expected from the method</li>
* <li>the return type of the method is not void</li>
* </ul>
* Otherwise, it will return <code>false</code>
*
* @param method Method
* @return true if the method is a getter. false otherwise.
*/
public static boolean IsGetter(Method method) {
if (!method.getName().startsWith("get")) return false;
if (method.getParameterTypes().length != 0) return false;
if (void.class.equals(method.getReturnType())) return false;
return true;
}
}

View file

@ -0,0 +1,14 @@
package org.chtijbug.drools.common.reflection
import java.lang.reflect.Method
class ReflectionUtils {
companion object {
fun IsGetter(method: Method): Boolean {
if (!method.getName().startsWith("get")) return false
if (method.getParameterTypes().size != 0) return false
if (Void.TYPE == method.getReturnType()) return false
return true
}
}
}

View file

@ -35,10 +35,10 @@ public class ReflectionUtilsTestCase {
try {
Method methodToEval = TestClass.class.getMethod("getProperty");
assertTrue(ReflectionUtils.IsGetter(methodToEval));
assertTrue(ReflectionUtils.Companion.IsGetter(methodToEval));
methodToEval = TestClass.class.getMethod("execute");
assertFalse(ReflectionUtils.IsGetter(methodToEval));
assertFalse(ReflectionUtils.Companion.IsGetter(methodToEval));
} catch (NoSuchMethodException e) {

View file

@ -4,7 +4,7 @@
<parent>
<groupId>com.pymmasoftware.jbpm</groupId>
<artifactId>drools-framework-examples</artifactId>
<version>1.3.0-SNAPSHOT</version>
<version>7.57.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View file

@ -4,7 +4,7 @@
<parent>
<groupId>com.pymmasoftware.jbpm</groupId>
<artifactId>drools-framework-examples</artifactId>
<version>1.3.0-SNAPSHOT</version>
<version>7.57.0-SNAPSHOT</version>
</parent>
<artifactId>drools-framework-swimmingpool-web-ui</artifactId>

View file

@ -4,7 +4,7 @@
<parent>
<artifactId>drools-framework-base-tools-parent</artifactId>
<groupId>com.pymmasoftware.jbpm</groupId>
<version>1.3.0-SNAPSHOT</version>
<version>7.57.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View file

@ -5,7 +5,7 @@
<parent>
<artifactId>drools-framework-base-tools-parent</artifactId>
<groupId>com.pymmasoftware.jbpm</groupId>
<version>1.3.0-SNAPSHOT</version>
<version>7.57.0-SNAPSHOT</version>
</parent>
@ -48,11 +48,9 @@
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>${jbpm.version}</version>
<groupId>org.kie</groupId>
<artifactId>kie-api</artifactId>
<exclusions>
<exclusion>
<groupId>com.thoughtworks.xstream</groupId>
@ -61,21 +59,30 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<exclusions>
<exclusion>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.21</version>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-bpmn2</artifactId>
<version>${jbpm.version}</version>
<exclusions>
<exclusion>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.kie.server</groupId>
<artifactId>kie-server-client</artifactId>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-wiring-dynamic</artifactId>
<version>${jbpm.version}</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
@ -89,7 +96,16 @@
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.kie.server</groupId>
<artifactId>kie-server-api</artifactId>
<exclusions>
<exclusion>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
@ -110,7 +126,11 @@
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.10</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
@ -120,17 +140,31 @@
<artifactId>drools-core</artifactId>
<exclusions>
<exclusion>
<groupId>org.drools</groupId>
<artifactId>drools-wiring-static</artifactId>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-flow</artifactId>
<version>${jbpm.version}</version>
<exclusions>
<exclusion>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-internal</artifactId>
<exclusions>
<exclusion>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
@ -141,7 +175,10 @@
<artifactId>powermock-api-mockito</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-workbench-models-guided-dtable</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>

View file

@ -22,11 +22,12 @@ import org.chtijbug.drools.entity.history.fact.FactHistoryEvent;
import org.chtijbug.drools.entity.history.fact.InsertedFactHistoryEvent;
import org.chtijbug.drools.entity.history.fact.UpdatedFactHistoryEvent;
import org.chtijbug.drools.runtime.DroolsFactObjectFactory;
import org.drools.base.definitions.rule.impl.RuleImpl;
import org.drools.core.common.PropagationContext;
import org.drools.core.definitions.rule.impl.RuleImpl;
import org.drools.core.event.rule.impl.ObjectDeletedEventImpl;
import org.drools.core.event.rule.impl.ObjectInsertedEventImpl;
import org.drools.core.event.rule.impl.ObjectUpdatedEventImpl;
import org.drools.core.spi.PropagationContext;
import org.kie.api.event.rule.ObjectDeletedEvent;
import org.kie.api.event.rule.ObjectInsertedEvent;
import org.kie.api.event.rule.ObjectUpdatedEvent;

View file

@ -29,11 +29,11 @@ import org.chtijbug.drools.runtime.DroolsChtijbugException;
import org.chtijbug.drools.runtime.DroolsFactObjectFactory;
import org.chtijbug.drools.runtime.RuleBaseSession;
import org.chtijbug.drools.runtime.listener.HistoryListener;
import org.drools.base.definitions.rule.impl.RuleImpl;
import org.drools.core.definitions.rule.impl.RuleImpl;
import org.jbpm.workflow.core.node.RuleSetNode;
import org.jbpm.workflow.instance.node.*;
import org.kie.api.definition.rule.Rule;
import org.kie.api.event.rule.DefaultAgendaEventListener;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.ObjectFilter;
import org.kie.api.runtime.process.NodeInstance;
@ -150,9 +150,7 @@ public class RuleBaseStatefulSession implements RuleBaseSession {
nodeType = DroolsNodeType.RuleNode;
RuleSetNode ruleSetNode = this.getRuleSetNode(nodeInstance);
if (ruleSetNode != null) {
if (ruleSetNode.getRuleType().isRuleFlowGroup()) {
ruleFlowGroupName = ruleSetNode.getRuleType().getName();
}
ruleFlowGroupName = ruleSetNode.getRuleFlowGroup();
}
} else if (nodeInstance instanceof SplitInstance) {
nodeType = DroolsNodeType.SplitNode;
@ -320,7 +318,7 @@ public class RuleBaseStatefulSession implements RuleBaseSession {
//____ Then foreach getters insert item by reflection
for (Method method : newObject.getClass().getMethods()) {
//____ only manage getters
if (!ReflectionUtils.IsGetter(method)) {
if (!ReflectionUtils.Companion.IsGetter(method)) {
continue;
}
Object getterValue;

View file

@ -24,10 +24,11 @@ import org.chtijbug.drools.entity.history.rule.AfterRuleFlowActivatedHistoryEven
import org.chtijbug.drools.entity.history.rule.AfterRuleFlowDeactivatedHistoryEvent;
import org.chtijbug.drools.entity.history.rule.BeforeRuleFiredHistoryEvent;
import org.chtijbug.drools.entity.history.session.SessionFireAllRulesMaxNumberReachedEvent;
import org.drools.base.reteoo.InitialFactImpl;
import org.drools.core.common.DefaultFactHandle;
import org.drools.core.common.InternalFactHandle;
import org.drools.core.event.rule.impl.BeforeActivationFiredEventImpl;
import org.drools.core.reteoo.InitialFactImpl;
import org.kie.api.event.rule.*;
import org.kie.api.runtime.KieRuntime;
import org.kie.api.runtime.rule.FactHandle;

View file

@ -3,7 +3,7 @@
<parent>
<artifactId>drools-framework-base-tools-parent</artifactId>
<groupId>com.pymmasoftware.jbpm</groupId>
<version>1.3.0-SNAPSHOT</version>
<version>7.57.0-SNAPSHOT</version>
</parent>
<artifactId>drools-framework-runtime-entity</artifactId>
@ -97,7 +97,11 @@
<dependency>
<groupId>io.github.kostaskougios</groupId>
<artifactId>cloning</artifactId>
<version>1.12.0</version>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@ -109,6 +113,10 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-internal</artifactId>

View file

@ -5,7 +5,7 @@
<parent>
<artifactId>pymma-jbpm-platform-parent</artifactId>
<groupId>com.pymmasoftware.jbpm</groupId>
<version>1.3.0-SNAPSHOT</version>
<version>7.57.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
@ -21,22 +21,18 @@
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-bom</artifactId>
<version>${jbpm.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-bom</artifactId>
<groupId>org.drools</groupId>
<artifactId>drools-bom</artifactId>
<version>${jbpm.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-bom</artifactId>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-bom</artifactId>
<version>${jbpm.version}</version>
<scope>import</scope>
<type>pom</type>
@ -97,6 +93,11 @@
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>

View file

@ -7,7 +7,7 @@
<groupId>com.pymmasoftware.jbpm</groupId>
<artifactId>pymma-jbpm-platform-parent</artifactId>
<version>1.3.0-SNAPSHOT</version>
<version>7.57.0-SNAPSHOT</version>
<modules>
<!--module>kie-wb-webapp</module-->
<!--module>drools-framework-business-proxy-parent</module-->
@ -17,7 +17,7 @@
<properties>
<fabri8.plugin.version>0.34.1</fabri8.plugin.version>
<jbpm.version>10.0.0</jbpm.version>
<jbpm.version>7.57.0.Final</jbpm.version>
<node.version>v10.16.3</node.version>
<npm.version>6.11.3</npm.version>
<frontend-maven-plugin.version>1.11.3</frontend-maven-plugin.version>
@ -35,7 +35,7 @@
<javax.activation.version>1.2.0</javax.activation.version>
<jaxb.api.version>2.3.0</jaxb.api.version>
<maven.plugin.version>3.11.0</maven.plugin.version>
<pymma.java.version>11</pymma.java.version>
<pymma.java.version>8</pymma.java.version>
<jackson.version>2.13.4</jackson.version>
<jackson.bind.version>2.13.4.2</jackson.bind.version>
<postgres.version>42.2.8</postgres.version>