diff --git a/.ci/jenkins/tests/pom.xml b/.ci/jenkins/tests/pom.xml
index c135b051144..46e295e7c54 100644
--- a/.ci/jenkins/tests/pom.xml
+++ b/.ci/jenkins/tests/pom.xml
@@ -55,7 +55,7 @@
logback-test.xml
${project.build.directory}/log
ERROR
- 1.2.9
+ 1.2.13
1.7.25
1.9.1
diff --git a/addons/README.md b/addons/README.md
index 5e17127a9f2..c248666aec7 100644
--- a/addons/README.md
+++ b/addons/README.md
@@ -50,8 +50,8 @@ your `pom.xml` file:
- org.kie.kogito
- kogito-addons-quarkus-process-management
+ org.kie
+ kie-addons-quarkus-process-management
${kogito.version}
diff --git a/addons/common/events/mongodb/README.md b/addons/common/events/mongodb/README.md
index 6a20b1d8c15..a4208227d09 100644
--- a/addons/common/events/mongodb/README.md
+++ b/addons/common/events/mongodb/README.md
@@ -21,8 +21,8 @@ To enable this events publisher, make sure dependency for the Kafka events publi
2. Springboot:
```xml
- org.kie.kogito
- kogito-addons-springboot-events-kafka
+ org.kie
+ kie-addons-springboot-events-kafka
```
@@ -31,15 +31,15 @@ Then add the following dependency for MongoDB events publisher:
1. Quarkus:
```xml
- org.kie.kogito
- kogito-addons-quarkus-events-mongodb
+ org.kie
+ kie-addons-quarkus-events-mongodb
```
2. Springboot:
```xml
- org.kie.kogito
- kogito-addons-springboot-events-mongodb
+ org.kie
+ kie-addons-springboot-events-mongodb
```
\ No newline at end of file
diff --git a/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/DatabaseType.java b/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/DatabaseType.java
deleted file mode 100644
index 8b33a481d36..00000000000
--- a/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/DatabaseType.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.kie.kogito.persistence.jdbc;
-
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.SQLException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public enum DatabaseType {
- ANSI("ansi", "process_instances"),
- ORACLE("Oracle", "PROCESS_INSTANCES"),
- POSTGRES("PostgreSQL", "process_instances");
-
- private static final Logger LOGGER = LoggerFactory.getLogger(DatabaseType.class);
- private final String dbIdentifier;
- private final String tableNamePattern;
-
- DatabaseType(final String dbIdentifier, final String tableNamePattern) {
- this.dbIdentifier = dbIdentifier;
- this.tableNamePattern = tableNamePattern;
- }
-
- public String getDbIdentifier() {
- return this.dbIdentifier;
- }
-
- public String getTableNamePattern() {
- return tableNamePattern;
- }
-
- public static DatabaseType create(final String dbIdentifier) {
- if (ORACLE.getDbIdentifier().equals(dbIdentifier)) {
- return ORACLE;
- } else if (POSTGRES.getDbIdentifier().equals(dbIdentifier)) {
- return POSTGRES;
- } else {
- var msg = String.format("Unrecognized DB (%s), defaulting to ansi", dbIdentifier);
- LOGGER.warn(msg);
- return ANSI;
- }
- }
-
- public static DatabaseType getDataBaseType(Connection connection) throws SQLException {
- final DatabaseMetaData metaData = connection.getMetaData();
- final String dbProductName = metaData.getDatabaseProductName();
- return DatabaseType.create(dbProductName);
- }
-}
diff --git a/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/JDBCCorrelationService.java b/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/PostgreSQLCorrelationService.java
similarity index 74%
rename from addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/JDBCCorrelationService.java
rename to addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/PostgreSQLCorrelationService.java
index e43fc81c5db..d4eba667200 100644
--- a/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/JDBCCorrelationService.java
+++ b/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/PostgreSQLCorrelationService.java
@@ -18,8 +18,6 @@
*/
package org.kie.kogito.persistence.jdbc.correlation;
-import java.sql.Connection;
-import java.sql.SQLException;
import java.util.Optional;
import javax.sql.DataSource;
@@ -29,25 +27,13 @@
import org.kie.kogito.correlation.CorrelationInstance;
import org.kie.kogito.correlation.CorrelationService;
import org.kie.kogito.event.correlation.MD5CorrelationEncoder;
-import org.kie.kogito.persistence.jdbc.DatabaseType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-public class JDBCCorrelationService implements CorrelationService {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(JDBCCorrelationService.class);
+public class PostgreSQLCorrelationService implements CorrelationService {
private PostgreSQLCorrelationRepository repository;
private CorrelationEncoder correlationEncoder;
- public JDBCCorrelationService(DataSource dataSource) {
- try (Connection connection = dataSource.getConnection()) {
- if (!DatabaseType.POSTGRES.equals(DatabaseType.getDataBaseType(connection))) {
- throw new IllegalArgumentException("Only PostgreSQL is supported for correlation");
- }
- } catch (SQLException e) {
- LOGGER.error("Error getting connection for {}", dataSource);
- }
+ public PostgreSQLCorrelationService(DataSource dataSource) {
this.repository = new PostgreSQLCorrelationRepository(dataSource);
this.correlationEncoder = new MD5CorrelationEncoder();
}
diff --git a/addons/common/persistence/jdbc/src/main/resources/db/oracle/V1.35.0__create_runtimes_Oracle.sql b/addons/common/persistence/jdbc/src/main/resources/db/oracle/V1.35.0__create_runtimes_Oracle.sql
deleted file mode 100644
index 25267ed6a6c..00000000000
--- a/addons/common/persistence/jdbc/src/main/resources/db/oracle/V1.35.0__create_runtimes_Oracle.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-CREATE TABLE process_instances
-(
- id char(36) NOT NULL,
- payload blob NOT NULL,
- process_id varchar2(3000) NOT NULL,
- version number(19),
- process_version varchar2(3000),
- CONSTRAINT process_instances_pkey PRIMARY KEY (id)
-);
-CREATE INDEX idx_process_instances_proc_id ON process_instances (process_id, id, process_version);
diff --git a/addons/common/persistence/jdbc/src/main/resources/db/postgresql/V1.35.0__create_runtime_PostgreSQL.sql b/addons/common/persistence/jdbc/src/main/resources/db/postgresql/V1.35.0__create_runtime_PostgreSQL.sql
index 892b6734b73..70792ea34af 100644
--- a/addons/common/persistence/jdbc/src/main/resources/db/postgresql/V1.35.0__create_runtime_PostgreSQL.sql
+++ b/addons/common/persistence/jdbc/src/main/resources/db/postgresql/V1.35.0__create_runtime_PostgreSQL.sql
@@ -1,4 +1,4 @@
--- To be used with kogito-addons-quarkus-persistence-jdbc for Quarkus or kogito-addons-springboot-persistence-jdbc for SpringBoot
+-- To be used with kie-addons-quarkus-persistence-jdbc for Quarkus or kie-addons-springboot-persistence-jdbc for SpringBoot
CREATE TABLE process_instances
(
id character(36) NOT NULL,
diff --git a/addons/common/persistence/jdbc/src/test/java/org/kie/persistence/jdbc/OracleProcessInstancesIT.java b/addons/common/persistence/jdbc/src/test/java/org/kie/persistence/jdbc/OracleProcessInstancesIT.java
deleted file mode 100644
index 69490b4a92f..00000000000
--- a/addons/common/persistence/jdbc/src/test/java/org/kie/persistence/jdbc/OracleProcessInstancesIT.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.kie.persistence.jdbc;
-
-import java.sql.SQLException;
-
-import javax.sql.DataSource;
-
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.BeforeAll;
-import org.kie.kogito.testcontainers.KogitoOracleSqlContainer;
-import org.testcontainers.junit.jupiter.Container;
-import org.testcontainers.junit.jupiter.Testcontainers;
-
-import oracle.jdbc.pool.OracleDataSource;
-
-@Testcontainers
-public class OracleProcessInstancesIT extends AbstractProcessInstancesIT {
-
- @Container
- private final static KogitoOracleSqlContainer ORACLE_CONTAINER = new KogitoOracleSqlContainer();
- private static final String ORACLE_TIMEZONE_PROPERTY = "oracle.jdbc.timezoneAsRegion";
- private static OracleDataSource ORACLE_DATA_SOURCE;
-
- @BeforeAll
- public static void start() {
- try {
- ORACLE_DATA_SOURCE = new OracleDataSource();
- ORACLE_DATA_SOURCE.setURL(ORACLE_CONTAINER.getJdbcUrl());
- ORACLE_DATA_SOURCE.setUser(ORACLE_CONTAINER.getUsername());
- ORACLE_DATA_SOURCE.setPassword(ORACLE_CONTAINER.getPassword());
- System.setProperty(ORACLE_TIMEZONE_PROPERTY, "false");
- initMigration(ORACLE_CONTAINER, "oracle");
- } catch (SQLException e) {
- throw new RuntimeException("Failed to create oracle datasource");
- }
- }
-
- @AfterAll
- public static void stop() {
- System.clearProperty(ORACLE_TIMEZONE_PROPERTY);
- }
-
- protected DataSource getDataSource() {
- return ORACLE_DATA_SOURCE;
- }
-}
diff --git a/addons/common/persistence/jdbc/src/test/java/org/kie/persistence/jdbc/correlation/JDBCCorrelationServiceIT.java b/addons/common/persistence/jdbc/src/test/java/org/kie/persistence/jdbc/correlation/JDBCCorrelationServiceIT.java
index 62212ac0eb0..f374bf8dad1 100644
--- a/addons/common/persistence/jdbc/src/test/java/org/kie/persistence/jdbc/correlation/JDBCCorrelationServiceIT.java
+++ b/addons/common/persistence/jdbc/src/test/java/org/kie/persistence/jdbc/correlation/JDBCCorrelationServiceIT.java
@@ -27,7 +27,7 @@
import org.kie.kogito.correlation.CompositeCorrelation;
import org.kie.kogito.correlation.CorrelationInstance;
import org.kie.kogito.correlation.SimpleCorrelation;
-import org.kie.kogito.persistence.jdbc.correlation.JDBCCorrelationService;
+import org.kie.kogito.persistence.jdbc.correlation.PostgreSQLCorrelationService;
import org.kie.kogito.testcontainers.KogitoPostgreSqlContainer;
import org.postgresql.ds.PGSimpleDataSource;
import org.testcontainers.containers.JdbcDatabaseContainer;
@@ -42,7 +42,7 @@ public class JDBCCorrelationServiceIT {
@Container
private static final KogitoPostgreSqlContainer PG_CONTAINER = new KogitoPostgreSqlContainer();
private static PGSimpleDataSource dataSource;
- private static JDBCCorrelationService correlationService;
+ private static PostgreSQLCorrelationService correlationService;
@BeforeAll
public static void setUp() {
@@ -50,7 +50,7 @@ public static void setUp() {
dataSource.setUrl(PG_CONTAINER.getJdbcUrl());
dataSource.setUser(PG_CONTAINER.getUsername());
dataSource.setPassword(PG_CONTAINER.getPassword());
- correlationService = new JDBCCorrelationService(dataSource);
+ correlationService = new PostgreSQLCorrelationService(dataSource);
//create table
// DDLRunner.init(new GenericRepository(dataSource), true);
initMigration(PG_CONTAINER, "postgresql");
diff --git a/addons/deprecated/README.md b/addons/deprecated/README.md
index 29521a9d789..49aed765f7d 100644
--- a/addons/deprecated/README.md
+++ b/addons/deprecated/README.md
@@ -7,58 +7,58 @@ them in your project.
#### Quarkus Add-ons
-| Add-On Description | Deprecated Artifact ID | New Artifact ID | Since |
-|-------------------------|---------------------------------------------|-----------------------------------------------------|--------|
-| Cloud Events | kogito-cloudevents-quarkus-addon | kogito-addons-quarkus-messaging | 1.8.0 |
-| Cloud Events Common | kogito-cloudevents-quarkus-common-addon | kogito-addons-quarkus-messaging-common | 1.8.0 |
-| Cloud Events Multi | kogito-cloudevents-quarkus-multi-addon | kogito-addons-quarkus-messaging | 1.8.0 |
-| Events Decisions | kogito-event-driven-decisions-quarkus-addon | kogito-addons-quarkus-events-decisions | 1.8.0 |
-| Events Smallrye | kogito-events-reactive-messaging-addon | kogito-addons-quarkus-events-process | 1.8.0 |
-| Explainability | explainability-quarkus-addon | kogito-addons-quarkus-explainability | 1.8.0 |
-| Jobs Management | jobs-management-quarkus-addon | kogito-addons-quarkus-jobs-management | 1.8.0 |
-| Knative Eventing | knative-eventing-addon | kogito-addons-quarkus-knative-eventing | 1.6.0 |
-| Mail | mail-quarkus-addon | kogito-addons-quarkus-mail | 1.8.0 |
-| Monitoring Core | monitoring-core-quarkus-addon | kogito-addons-quarkus-monitoring-core | 1.8.0 |
-| Monitoring Elastic | monitoring-elastic-quarkus-addon | kogito-addons-quarkus-monitoring-elastic | 1.8.0 |
-| Monitoring Prometheus | monitoring-prometheus-quarkus-addon | kogito-addons-quarkus-monitoring-prometheus | 1.8.0 |
-| Persistence ISPN Health | infinispan-quarkus-health-addon | kogito-addons-quarkus-persistence-infinispan-health | 1.8.0 |
-| Persistence Infinispan | kogito-addons-persistence-infinispan | kogito-addons-quarkus-persistence-infinispan | 1.12.0 |
-| Persistence Kafka | kafka-persistence-addon | kogito-addons-quarkus-persistence-kafka | 1.8.0 |
-| Persistence FileSystem | kogito-addons-persistence-filesystem | kogito-addons-quarkus-persistence-filesystem | 1.12.0 |
-| Persistence JDBC | kogito-addons-persistence-jdbc | kogito-addons-quarkus-persistence-jdbc | 1.12.0 |
-| Persistence MongoDB | kogito-addons-persistence-mongodb | kogito-addons-quarkus-persistence-mongodb | 1.12.0 |
-| Persistence Postgresql | kogito-addons-persistence-postgresql | kogito-addons-quarkus-persistence-postgresql | 1.12.0 |
-| Process Management | process-management-addon | kogito-addons-quarkus-process-management | 1.8.0 |
-| Process SVG | process-svg-quarkus-addon | kogito-addons-quarkus-process-svg | 1.8.0 |
-| REST Exception Handler | kogito-rest-exception-handler-quarkus | kogito-addons-quarkus-rest-exception-handler | 1.8.0 |
-| Task Management | task-management-quarkus-addon | kogito-addons-quarkus-task-management | 1.8.0 |
-| Task Notification | task-notification-quarkus-addon | kogito-addons-quarkus-task-notification | 1.8.0 |
-| Tracing Decision | tracing-decision-quarkus-addon | kogito-addons-quarkus-tracing-decision | 1.8.0 |
+| Add-On Description | Deprecated Artifact ID | New Artifact ID | Since |
+|-------------------------|---------------------------------------------|--------------------------------------------------|--------|
+| Cloud Events | kogito-cloudevents-quarkus-addon | kie-addons-quarkus-messaging | 1.8.0 |
+| Cloud Events Common | kogito-cloudevents-quarkus-common-addon | kie-addons-quarkus-messaging-common | 1.8.0 |
+| Cloud Events Multi | kogito-cloudevents-quarkus-multi-addon | kie-addons-quarkus-messaging | 1.8.0 |
+| Events Decisions | kogito-event-driven-decisions-quarkus-addon | kie-addons-quarkus-events-decisions | 1.8.0 |
+| Events Smallrye | kogito-events-reactive-messaging-addon | kie-addons-quarkus-events-process | 1.8.0 |
+| Explainability | explainability-quarkus-addon | kie-addons-quarkus-explainability | 1.8.0 |
+| Jobs Management | jobs-management-quarkus-addon | kogito-addons-quarkus-jobs-management | 1.8.0 |
+| Knative Eventing | knative-eventing-addon | kie-addons-quarkus-knative-eventing | 1.6.0 |
+| Mail | mail-quarkus-addon | jbpm-addons-quarkus-mail | 1.8.0 |
+| Monitoring Core | monitoring-core-quarkus-addon | kie-addons-quarkus-monitoring-core | 1.8.0 |
+| Monitoring Elastic | monitoring-elastic-quarkus-addon | kie-addons-quarkus-monitoring-elastic | 1.8.0 |
+| Monitoring Prometheus | monitoring-prometheus-quarkus-addon | kie-addons-quarkus-monitoring-prometheus | 1.8.0 |
+| Persistence ISPN Health | infinispan-quarkus-health-addon | kie-addons-quarkus-persistence-infinispan-health | 1.8.0 |
+| Persistence Infinispan | kogito-addons-persistence-infinispan | kie-addons-quarkus-persistence-infinispan | 1.12.0 |
+| Persistence Kafka | kafka-persistence-addon | kie-addons-quarkus-persistence-kafka | 1.8.0 |
+| Persistence FileSystem | kogito-addons-persistence-filesystem | kie-addons-quarkus-persistence-filesystem | 1.12.0 |
+| Persistence JDBC | kogito-addons-persistence-jdbc | kie-addons-quarkus-persistence-jdbc | 1.12.0 |
+| Persistence MongoDB | kogito-addons-persistence-mongodb | kie-addons-quarkus-persistence-mongodb | 1.12.0 |
+| Persistence Postgresql | kogito-addons-persistence-postgresql | kie-addons-quarkus-persistence-postgresql | 1.12.0 |
+| Process Management | process-management-addon | kie-addons-quarkus-process-management | 1.8.0 |
+| Process SVG | process-svg-quarkus-addon | kie-addons-quarkus-process-svg | 1.8.0 |
+| REST Exception Handler | kogito-rest-exception-handler-quarkus | kie-addons-quarkus-rest-exception-handler | 1.8.0 |
+| Task Management | task-management-quarkus-addon | jbpm-addons-quarkus-task-management | 1.8.0 |
+| Task Notification | task-notification-quarkus-addon | jbpm-addons-quarkus-task-notification | 1.8.0 |
+| Tracing Decision | tracing-decision-quarkus-addon | kie-addons-quarkus-tracing-decision | 1.8.0 |
#### Spring Boot Add-ons
-| Add-On Description | Deprecated Artifact ID | New Artifact ID | Since |
-|-------------------------|------------------------------------------------|-------------------------------------------------|--------|
-| Cloud Events | kogito-cloudevents-spring-boot-addon | kogito-addons-springboot-messaging | 1.8.0 |
-| Events Decisions | kogito-event-driven-decisions-springboot-addon | kogito-addons-springboot-events-decisions | 1.8.0 |
-| Events Kafka | kogito-events-spring-boot-addon | kogito-addons-springboot-events-process-kafka | 1.8.0 |
-| Explainability | explainability-springboot-addon | kogito-addons-springboot-explainability | 1.8.0 |
-| Jobs Management | jobs-management-springboot-addon | kogito-addons-springboot-jobs-management | 1.8.0 |
-| Mail | mail-springboot-addon | kogito-addons-springboot-mail | 1.8.0 |
-| Monitoring Core | monitoring-core-springboot-addon | kogito-addons-springboot-monitoring-core | 1.8.0 |
-| Monitoring Elastic | monitoring-elastic-springboot-addon | kogito-addons-springboot-monitoring-elastic | 1.8.0 |
-| Monitoring Prometheus | monitoring-prometheus-springboot-addon | kogito-addons-springboot-monitoring-prometheus | 1.8.0 |
-| Process Management | process-management-springboot-addon | kogito-addons-springboot-process-management | 1.8.0 |
-| Process SVG | process-svg-springboot-addon | kogito-addons-springboot-process-svg | 1.8.0 |
-| Persistence File System | kogito-addons-persistence-filesystem | kogito-addons-springboot-persistence-filesystem | 1.21.0 |
-| Persistence Infinispan | kogito-addons-persistence-infinispan | kogito-addons-springboot-persistence-infinispan | 1.21.0 |
-| Persistence JDBC | kogito-addons-persistence-jdbc | kogito-addons-springboot-persistence-jdbc | 1.21.0 |
-| Persistence MongoDB | kogito-addons-persistence-mongodb | kogito-addons-springboot-persistence-mongodb | 1.21.0 |
-| Persistence Postgresql | kogito-addons-persistence-postgresql | kogito-addons-springboot-persistence-postgresql | 1.21.0 |
-| REST Exception Handler | kogito-rest-exception-handler-springboot | kogito-addons-springboot-rest-exception-handler | 1.8.0 |
-| Task Management | task-management-springboot-addon | kogito-addons-springboot-task-management | 1.8.0 |
-| Task Notification | task-notification-springboot-addon | kogito-addons-springboot-task-notification | 1.8.0 |
-| Tracing Decision | tracing-decision-springboot-addon | kogito-addons-springboot-tracing-decision | 1.8.0 |
+| Add-On Description | Deprecated Artifact ID | New Artifact ID | Since |
+|-------------------------|------------------------------------------------|------------------------------------------------|--------|
+| Cloud Events | kogito-cloudevents-spring-boot-addon | kie-addons-springboot-messaging | 1.8.0 |
+| Events Decisions | kogito-event-driven-decisions-springboot-addon | kie-addons-springboot-events-decisions | 1.8.0 |
+| Events Kafka | kogito-events-spring-boot-addon | kie-addons-springboot-events-process-kafka | 1.8.0 |
+| Explainability | explainability-springboot-addon | kie-addons-springboot-explainability | 1.8.0 |
+| Jobs Management | jobs-management-springboot-addon | kogito-addons-springboot-jobs-management | 1.8.0 |
+| Mail | mail-springboot-addon | jbpm-addons-springboot-mail | 1.8.0 |
+| Monitoring Core | monitoring-core-springboot-addon | kie-addons-springboot-monitoring-core | 1.8.0 |
+| Monitoring Elastic | monitoring-elastic-springboot-addon | kie-addons-springboot-monitoring-elastic | 1.8.0 |
+| Monitoring Prometheus | monitoring-prometheus-springboot-addon | kie-addons-springboot-monitoring-prometheus | 1.8.0 |
+| Process Management | process-management-springboot-addon | kie-addons-springboot-process-management | 1.8.0 |
+| Process SVG | process-svg-springboot-addon | kie-addons-springboot-process-svg | 1.8.0 |
+| Persistence File System | kogito-addons-persistence-filesystem | kie-addons-springboot-persistence-filesystem | 1.21.0 |
+| Persistence Infinispan | kogito-addons-persistence-infinispan | kie-addons-springboot-persistence-infinispan | 1.21.0 |
+| Persistence JDBC | kogito-addons-persistence-jdbc | kie-addons-springboot-persistence-jdbc | 1.21.0 |
+| Persistence MongoDB | kogito-addons-persistence-mongodb | kie-addons-springboot-persistence-mongodb | 1.21.0 |
+| Persistence Postgresql | kogito-addons-persistence-postgresql | kie-addons-springboot-persistence-postgresql | 1.21.0 |
+| REST Exception Handler | kogito-rest-exception-handler-springboot | kie-addons-springboot-rest-exception-handler | 1.8.0 |
+| Task Management | task-management-springboot-addon | jbpm-addons-springboot-task-management | 1.8.0 |
+| Task Notification | task-notification-springboot-addon | jbpm-addons-springboot-task-notification | 1.8.0 |
+| Tracing Decision | tracing-decision-springboot-addon | kie-addons-springboot-tracing-decision | 1.8.0 |
#### Common Add-ons
diff --git a/api/kogito-api/src/main/java/org/kie/kogito/Model.java b/api/kogito-api/src/main/java/org/kie/kogito/Model.java
index 1d827230d19..fbe9acb8ded 100644
--- a/api/kogito-api/src/main/java/org/kie/kogito/Model.java
+++ b/api/kogito-api/src/main/java/org/kie/kogito/Model.java
@@ -19,6 +19,8 @@
package org.kie.kogito;
import java.util.Map;
+import java.util.Map.Entry;
+import java.util.stream.Collectors;
/**
* Represents data model type of objects that are usually descriptor of data holders.
@@ -29,4 +31,10 @@ public interface Model extends MapInput, MapOutput {
default void update(Map params) {
Models.fromMap(this, params);
}
+
+ default Map updatePartially(Map params) {
+ params = params.entrySet().stream().filter(e -> e.getValue() != null).collect(Collectors.toMap(Entry::getKey, Entry::getValue));
+ update(params);
+ return params;
+ }
}
diff --git a/api/kogito-api/src/main/java/org/kie/kogito/internal/process/event/KogitoProcessEventSupport.java b/api/kogito-api/src/main/java/org/kie/kogito/internal/process/event/KogitoProcessEventSupport.java
index d0a2bc155c2..01fffac0f4b 100644
--- a/api/kogito-api/src/main/java/org/kie/kogito/internal/process/event/KogitoProcessEventSupport.java
+++ b/api/kogito-api/src/main/java/org/kie/kogito/internal/process/event/KogitoProcessEventSupport.java
@@ -158,12 +158,11 @@ void fireOnUserTaskCommentAdded(
KieRuntime kruntime,
Comment addedComment);
- //
-
void reset();
void addEventListener(KogitoProcessEventListener listener);
void removeEventListener(KogitoProcessEventListener listener);
-}
\ No newline at end of file
+ void fireOnError(KogitoProcessInstance instance, KogitoNodeInstance nodeInstance, KieRuntime kruntime, Exception exception);
+}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/assembler/DRFAssemblerService.java b/api/kogito-api/src/main/java/org/kie/kogito/internal/utils/KogitoTags.java
old mode 100755
new mode 100644
similarity index 66%
rename from jbpm/jbpm-flow-builder/src/main/java/org/jbpm/assembler/DRFAssemblerService.java
rename to api/kogito-api/src/main/java/org/kie/kogito/internal/utils/KogitoTags.java
index b7fd89745c9..a514146fb3f
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/assembler/DRFAssemblerService.java
+++ b/api/kogito-api/src/main/java/org/kie/kogito/internal/utils/KogitoTags.java
@@ -16,19 +16,15 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.jbpm.assembler;
+package org.kie.kogito.internal.utils;
-import org.drools.compiler.builder.impl.KnowledgeBuilderImpl;
-import org.kie.api.io.ResourceType;
+public class KogitoTags {
-public class DRFAssemblerService extends AbstractProcessAssembler {
+ public static final String VARIABLE_TAGS = "customTags";
+ public static final String READONLY_TAG = "readonly";
+ public static final String REQUIRED_TAG = "required";
+ public static final String INTERNAL_TAG = "internal";
+ public static final String INPUT_TAG = "input";
+ public static final String OUTPUT_TAG = "output";
- @Override
- public ResourceType getResourceType() {
- return ResourceType.DRF;
- }
-
- @Override
- protected void configurePackageBuilder(KnowledgeBuilderImpl kb) {
- }
}
diff --git a/api/kogito-api/src/main/java/org/kie/kogito/process/ProcessInstances.java b/api/kogito-api/src/main/java/org/kie/kogito/process/ProcessInstances.java
index d6233541d45..6cc0d95649c 100644
--- a/api/kogito-api/src/main/java/org/kie/kogito/process/ProcessInstances.java
+++ b/api/kogito-api/src/main/java/org/kie/kogito/process/ProcessInstances.java
@@ -29,6 +29,10 @@ default Optional> findById(String id) {
Optional> findById(String id, ProcessInstanceReadMode mode);
+ default Optional> findByBusinessKey(String id) {
+ return stream().filter(pi -> id.equals(pi.businessKey())).findAny();
+ }
+
Stream> stream(ProcessInstanceReadMode mode);
default Stream> stream() {
diff --git a/api/kogito-api/src/main/java/org/kie/kogito/uow/events/UnitOfWorkProcessEventListener.java b/api/kogito-api/src/main/java/org/kie/kogito/uow/events/UnitOfWorkProcessEventListener.java
index e2998dfc5ab..3428ebfbb93 100644
--- a/api/kogito-api/src/main/java/org/kie/kogito/uow/events/UnitOfWorkProcessEventListener.java
+++ b/api/kogito-api/src/main/java/org/kie/kogito/uow/events/UnitOfWorkProcessEventListener.java
@@ -18,6 +18,7 @@
*/
package org.kie.kogito.uow.events;
+import org.kie.api.event.process.ErrorEvent;
import org.kie.api.event.process.MessageEvent;
import org.kie.api.event.process.ProcessCompletedEvent;
import org.kie.api.event.process.ProcessEvent;
@@ -59,7 +60,6 @@ private void intercept(UserTaskEvent event) {
@Override
public void beforeProcessStarted(ProcessStartedEvent event) {
-
}
@Override
@@ -193,4 +193,9 @@ public void onUserTaskOutputVariable(UserTaskVariableEvent event) {
intercept(event);
}
+ @Override
+ public void onError(ErrorEvent event) {
+ intercept(event);
+ }
+
}
diff --git a/api/kogito-events-core/src/main/java/org/kie/kogito/event/impl/ProcessEventDispatcher.java b/api/kogito-events-core/src/main/java/org/kie/kogito/event/impl/ProcessEventDispatcher.java
index 48d46a04fd1..704e854865c 100644
--- a/api/kogito-events-core/src/main/java/org/kie/kogito/event/impl/ProcessEventDispatcher.java
+++ b/api/kogito-events-core/src/main/java/org/kie/kogito/event/impl/ProcessEventDispatcher.java
@@ -37,7 +37,6 @@
import org.kie.kogito.correlation.SimpleCorrelation;
import org.kie.kogito.event.DataEvent;
import org.kie.kogito.event.EventDispatcher;
-import org.kie.kogito.internal.utils.ConversionUtils;
import org.kie.kogito.process.Process;
import org.kie.kogito.process.ProcessInstance;
import org.kie.kogito.process.ProcessService;
@@ -74,20 +73,52 @@ public CompletableFuture> dispatch(String trigger, DataEvent<
}
return CompletableFuture.completedFuture(null);
}
+ return resolveCorrelationId(event)
+ .map(kogitoReferenceId -> asCompletable(trigger, event, findById(kogitoReferenceId)))
+ .orElseGet(() -> {
+ // check processInstanceId
+ String processInstanceId = event.getKogitoReferenceId();
+ if (processInstanceId != null) {
+ return asCompletable(trigger, event, findById(processInstanceId));
+ }
+ // check businessKey
+ String businessKey = event.getKogitoBusinessKey();
+ if (businessKey != null) {
+ return asCompletable(trigger, event, findByBusinessKey(businessKey));
+ }
+ // try to start a new instance if possible
+ return CompletableFuture.supplyAsync(() -> startNewInstance(trigger, event), executor);
+ });
+ }
- final String kogitoReferenceId = resolveCorrelationId(event);
- if (!ConversionUtils.isEmpty(kogitoReferenceId)) {
- return CompletableFuture.supplyAsync(() -> handleMessageWithReference(trigger, event, kogitoReferenceId), executor);
- }
+ private CompletableFuture> asCompletable(String trigger, DataEvent event, Optional> processInstance) {
- //if the trigger is for a start event (model converter is set only for start node)
- if (modelConverter.isPresent()) {
- return CompletableFuture.supplyAsync(() -> startNewInstance(trigger, event), executor);
+ return CompletableFuture.supplyAsync(() -> processInstance.map(pi -> {
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("Sending signal {} to process instance id '{}'", trigger, pi.id());
+ }
+ signalProcessInstance(trigger, pi.id(), event);
+ return pi;
+ }).orElseGet(() -> startNewInstance(trigger, event)), executor);
+ }
+
+ private Optional> findById(String id) {
+ LOGGER.debug("Received message with process instance id '{}'", id);
+ Optional> result = process.instances().findById(id);
+ if (LOGGER.isDebugEnabled() && result.isEmpty()) {
+ LOGGER.debug("No instance found for process instance id '{}'", id);
}
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("No matches found for trigger {} in process {}. Skipping consumed message {}", trigger, process.id(), event);
+ return result;
+
+ }
+
+ private Optional> findByBusinessKey(String key) {
+ LOGGER.debug("Received message with business key '{}'", key);
+ Optional> result = process.instances().findByBusinessKey(key);
+ if (LOGGER.isDebugEnabled() && result.isEmpty()) {
+ LOGGER.debug("No instance found for business key '{}'", key);
}
- return CompletableFuture.completedFuture(null);
+ return result;
}
private Optional compositeCorrelation(DataEvent> event) {
@@ -95,10 +126,10 @@ private Optional compositeCorrelation(DataEvent> event)
correlationKeys.stream().map(k -> new SimpleCorrelation<>(k, resolve(event, k))).collect(Collectors.toSet()))) : Optional.empty();
}
- private String resolveCorrelationId(DataEvent> event) {
+ private Optional resolveCorrelationId(DataEvent> event) {
return compositeCorrelation(event).flatMap(process.correlations()::find)
- .map(CorrelationInstance::getCorrelatedId)
- .orElseGet(event::getKogitoReferenceId);
+ .map(CorrelationInstance::getCorrelatedId);
+
}
private Object resolve(DataEvent> event, String key) {
@@ -113,22 +144,6 @@ private Object resolve(DataEvent> event, String key) {
}
}
- private ProcessInstance handleMessageWithReference(String trigger, DataEvent event, String instanceId) {
- LOGGER.debug("Received message with reference id '{}' going to use it to send signal '{}'",
- instanceId,
- trigger);
- return process.instances()
- .findById(instanceId)
- .map(instance -> {
- signalProcessInstance(trigger, instance.id(), event);
- return instance;
- })
- .orElseGet(() -> {
- LOGGER.info("Process instance with id '{}' not found for triggering signal '{}'", instanceId, trigger);
- return startNewInstance(trigger, event);
- });
- }
-
private Optional signalProcessInstance(String trigger, String id, DataEvent event) {
return processService.signalProcessInstance((Process) process, id, dataResolver.apply(event), "Message-" + trigger);
}
@@ -139,7 +154,12 @@ private ProcessInstance startNewInstance(String trigger, DataEvent event)
return processService.createProcessInstance(process, event.getKogitoBusinessKey(), m.apply(dataResolver.apply(event)),
headersFromEvent(event), event.getKogitoStartFromNode(), trigger,
event.getKogitoProcessInstanceId(), compositeCorrelation(event).orElse(null));
- }).orElse(null);
+ }).orElseGet(() -> {
+ if (LOGGER.isInfoEnabled()) {
+ LOGGER.info("No matches found for trigger {} in process {}. Skipping consumed message {}", trigger, process.id(), event);
+ }
+ return null;
+ });
}
protected Map> headersFromEvent(DataEvent event) {
diff --git a/api/kogito-events-core/src/main/java/org/kie/kogito/event/impl/ProcessInstanceEventBatch.java b/api/kogito-events-core/src/main/java/org/kie/kogito/event/impl/ProcessInstanceEventBatch.java
index 4f153ec5fd9..9d55dff1b9a 100644
--- a/api/kogito-events-core/src/main/java/org/kie/kogito/event/impl/ProcessInstanceEventBatch.java
+++ b/api/kogito-events-core/src/main/java/org/kie/kogito/event/impl/ProcessInstanceEventBatch.java
@@ -19,13 +19,15 @@
package org.kie.kogito.event.impl;
import java.time.Instant;
-import java.util.ArrayList;
import java.util.Collection;
+import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
+import java.util.TreeSet;
+import org.kie.api.event.process.ErrorEvent;
import org.kie.api.event.process.ProcessCompletedEvent;
import org.kie.api.event.process.ProcessEvent;
import org.kie.api.event.process.ProcessNodeEvent;
@@ -38,7 +40,6 @@
import org.kie.api.event.usertask.UserTaskAttachmentEvent;
import org.kie.api.event.usertask.UserTaskCommentEvent;
import org.kie.api.event.usertask.UserTaskDeadlineEvent;
-import org.kie.api.event.usertask.UserTaskEvent;
import org.kie.api.event.usertask.UserTaskStateEvent;
import org.kie.api.event.usertask.UserTaskVariableEvent;
import org.kie.kogito.Addons;
@@ -70,10 +71,10 @@
import org.kie.kogito.event.usertask.UserTaskInstanceVariableEventBody;
import org.kie.kogito.internal.process.event.KogitoProcessVariableChangedEvent;
import org.kie.kogito.internal.process.runtime.KogitoNodeInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
import org.kie.kogito.internal.process.runtime.KogitoWorkItem;
import org.kie.kogito.internal.process.runtime.KogitoWorkItemNodeInstance;
import org.kie.kogito.internal.process.runtime.KogitoWorkflowProcessInstance;
+import org.kie.kogito.internal.utils.KogitoTags;
import org.kie.kogito.process.workitem.HumanTaskWorkItem;
public class ProcessInstanceEventBatch implements EventBatch {
@@ -85,25 +86,19 @@ public class ProcessInstanceEventBatch implements EventBatch {
public ProcessInstanceEventBatch(String service, Addons addons) {
this.service = service;
this.addons = addons != null ? addons : Addons.EMTPY;
- this.processedEvents = new ArrayList<>();
- }
-
- @Override
- public void append(Object rawEvent) {
- if (rawEvent instanceof ProcessEvent) {
- addDataEvent((ProcessEvent) rawEvent);
- } else if (rawEvent instanceof UserTaskEvent) {
- addDataEvent((UserTaskEvent) rawEvent);
- }
+ this.processedEvents = new TreeSet<>(new Comparator>() {
+ @Override
+ public int compare(DataEvent> event1, DataEvent> event2) {
+ return event2 instanceof ProcessInstanceStateDataEvent &&
+ ((ProcessInstanceStateDataEvent) event2).getData().getEventType() == ProcessInstanceStateEventBody.EVENT_TYPE_ENDED
+ || event1 instanceof ProcessInstanceStateDataEvent &&
+ ((ProcessInstanceStateDataEvent) event1).getData().getEventType() == ProcessInstanceStateEventBody.EVENT_TYPE_STARTED ? -1 : 1;
+ }
+ });
}
@Override
- public Collection> events() {
- return processedEvents;
- }
-
- private void addDataEvent(ProcessEvent event) {
- // process events
+ public void append(Object event) {
if (event instanceof ProcessStartedEvent) {
handleProcessStateEvent((ProcessStartedEvent) event);
} else if (event instanceof ProcessCompletedEvent) {
@@ -116,11 +111,32 @@ private void addDataEvent(ProcessEvent event) {
handleProcesssNodeEvent((SLAViolatedEvent) event);
} else if (event instanceof ProcessVariableChangedEvent) {
handleProcessVariableEvent((ProcessVariableChangedEvent) event);
+ } else if (event instanceof ErrorEvent) {
+ handleErrorEvent((ErrorEvent) event);
+ } else if (event instanceof UserTaskStateEvent) {
+ handleUserTaskStateEvent((UserTaskStateEvent) event);
+ } else if (event instanceof UserTaskDeadlineEvent) {
+ handleUserTaskDeadlineEvent((UserTaskDeadlineEvent) event);
+ } else if (event instanceof UserTaskAssignmentEvent) {
+ handleUserTaskAssignmentEvent((UserTaskAssignmentEvent) event);
+ } else if (event instanceof UserTaskVariableEvent) {
+ handleUserTaskVariableEvent((UserTaskVariableEvent) event);
+ } else if (event instanceof UserTaskAttachmentEvent) {
+ handleUserTaskAttachmentEvent((UserTaskAttachmentEvent) event);
+ } else if (event instanceof UserTaskCommentEvent) {
+ handleUserTaskCommentEvent((UserTaskCommentEvent) event);
}
}
- private void handleProcessVariableEvent(ProcessVariableChangedEvent event) {
+ @Override
+ public Collection> events() {
+ return processedEvents;
+ }
+ private void handleProcessVariableEvent(ProcessVariableChangedEvent event) {
+ if (event.getTags().contains(KogitoTags.INTERNAL_TAG)) {
+ return;
+ }
Map metadata = buildProcessMetadata((KogitoWorkflowProcessInstance) event.getProcessInstance());
KogitoWorkflowProcessInstance pi = (KogitoWorkflowProcessInstance) event.getProcessInstance();
ProcessInstanceVariableEventBody.Builder builder = ProcessInstanceVariableEventBody.create()
@@ -242,52 +258,31 @@ private ProcessInstanceNodeDataEvent toProcessInstanceNodeEvent(ProcessNodeEvent
return piEvent;
}
- private void handleProcessStateEvent(ProcessCompletedEvent event) {
+ private void handleErrorEvent(ErrorEvent event) {
+ KogitoWorkflowProcessInstance pi = (KogitoWorkflowProcessInstance) event.getProcessInstance();
+ ProcessInstanceErrorEventBody errorBody = ProcessInstanceErrorEventBody.create()
+ .eventDate(new Date())
+ .eventUser(event.getEventIdentity())
+ .processInstanceId(pi.getId())
+ .processId(pi.getProcessId())
+ .processVersion(pi.getProcessVersion())
+ .nodeDefinitionId(pi.getNodeIdInError())
+ .nodeInstanceId(pi.getNodeInstanceIdInError())
+ .errorMessage(pi.getErrorMessage())
+ .build();
+ Map metadata = buildProcessMetadata((KogitoWorkflowProcessInstance) event.getProcessInstance());
+ ProcessInstanceErrorDataEvent piEvent =
+ new ProcessInstanceErrorDataEvent(buildSource(event.getProcessInstance().getProcessId()), addons.toString(), event.getEventIdentity(), metadata, errorBody);
+ piEvent.setKogitoBusinessKey(pi.getBusinessKey());
+ processedEvents.add(piEvent);
+ }
+ private void handleProcessStateEvent(ProcessCompletedEvent event) {
processedEvents.add(toProcessInstanceStateEvent(event, ProcessInstanceStateEventBody.EVENT_TYPE_ENDED));
-
- KogitoWorkflowProcessInstance pi = (KogitoWorkflowProcessInstance) event.getProcessInstance();
- if (pi.getState() == KogitoProcessInstance.STATE_ERROR) {
- ProcessInstanceErrorEventBody errorBody = ProcessInstanceErrorEventBody.create()
- .eventDate(new Date())
- .eventUser(event.getEventIdentity())
- .processInstanceId(pi.getId())
- .processId(pi.getProcessId())
- .processVersion(pi.getProcessVersion())
- .nodeDefinitionId(pi.getNodeIdInError())
- .nodeInstanceId(pi.getNodeInstanceIdInError())
- .errorMessage(pi.getErrorMessage())
- .build();
- Map metadata = buildProcessMetadata((KogitoWorkflowProcessInstance) event.getProcessInstance());
- ProcessInstanceErrorDataEvent piEvent =
- new ProcessInstanceErrorDataEvent(buildSource(event.getProcessInstance().getProcessId()), addons.toString(), event.getEventIdentity(), metadata, errorBody);
- piEvent.setKogitoBusinessKey(pi.getBusinessKey());
- processedEvents.add(piEvent);
- }
}
private void handleProcessStateEvent(ProcessStartedEvent event) {
processedEvents.add(toProcessInstanceStateEvent(event, ProcessInstanceStateEventBody.EVENT_TYPE_STARTED));
-
- KogitoWorkflowProcessInstance pi = (KogitoWorkflowProcessInstance) event.getProcessInstance();
- if (pi.getState() == KogitoProcessInstance.STATE_ERROR) {
- ProcessInstanceErrorEventBody errorBody = ProcessInstanceErrorEventBody.create()
- .eventDate(new Date())
- .eventUser(event.getEventIdentity())
- .processInstanceId(pi.getId())
- .processId(pi.getProcessId())
- .processVersion(pi.getProcessVersion())
- .nodeDefinitionId(pi.getNodeIdInError())
- .nodeInstanceId(pi.getNodeInstanceIdInError())
- .errorMessage(pi.getErrorMessage())
- .build();
- Map metadata = buildProcessMetadata((KogitoWorkflowProcessInstance) event.getProcessInstance());
- ProcessInstanceErrorDataEvent piEvent =
- new ProcessInstanceErrorDataEvent(buildSource(event.getProcessInstance().getProcessId()), addons.toString(), event.getEventIdentity(), metadata, errorBody);
- piEvent.setKogitoBusinessKey(pi.getBusinessKey());
- processedEvents.add(piEvent);
- }
-
}
private ProcessInstanceStateDataEvent toProcessInstanceStateEvent(ProcessEvent event, int eventType) {
@@ -336,23 +331,6 @@ private Map buildProcessMetadata(KogitoWorkflowProcessInstance p
return metadata;
}
- private void addDataEvent(UserTaskEvent event) {
- // this should go in another event types
- if (event instanceof UserTaskStateEvent) {
- handleUserTaskStateEvent((UserTaskStateEvent) event);
- } else if (event instanceof UserTaskDeadlineEvent) {
- handleUserTaskDeadlineEvent((UserTaskDeadlineEvent) event);
- } else if (event instanceof UserTaskAssignmentEvent) {
- handleUserTaskAssignmentEvent((UserTaskAssignmentEvent) event);
- } else if (event instanceof UserTaskVariableEvent) {
- handleUserTaskVariableEvent((UserTaskVariableEvent) event);
- } else if (event instanceof UserTaskAttachmentEvent) {
- handleUserTaskAttachmentEvent((UserTaskAttachmentEvent) event);
- } else if (event instanceof UserTaskCommentEvent) {
- handleUserTaskCommentEvent((UserTaskCommentEvent) event);
- }
- }
-
private void handleUserTaskCommentEvent(UserTaskCommentEvent event) {
Map metadata = buildUserTaskMetadata((HumanTaskWorkItem) event.getWorkItem());
metadata.putAll(buildProcessMetadata((KogitoWorkflowProcessInstance) event.getProcessInstance()));
diff --git a/api/kogito-events-core/src/test/java/org/kie/kogito/event/impl/ProcessInstanceEventBatchTest.java b/api/kogito-events-core/src/test/java/org/kie/kogito/event/impl/ProcessInstanceEventBatchTest.java
index 4b117d04a5e..b4326cc2283 100644
--- a/api/kogito-events-core/src/test/java/org/kie/kogito/event/impl/ProcessInstanceEventBatchTest.java
+++ b/api/kogito-events-core/src/test/java/org/kie/kogito/event/impl/ProcessInstanceEventBatchTest.java
@@ -19,6 +19,25 @@
package org.kie.kogito.event.impl;
import org.junit.jupiter.api.Test;
+import org.kie.api.event.process.ErrorEvent;
+import org.kie.api.event.process.ProcessCompletedEvent;
+import org.kie.api.event.process.ProcessEvent;
+import org.kie.api.event.process.ProcessNodeEvent;
+import org.kie.api.event.process.ProcessNodeLeftEvent;
+import org.kie.api.event.process.ProcessNodeTriggeredEvent;
+import org.kie.api.event.process.ProcessStartedEvent;
+import org.kie.api.event.process.ProcessVariableChangedEvent;
+import org.kie.api.runtime.process.NodeInstance;
+import org.kie.api.runtime.process.ProcessInstance;
+import org.kie.kogito.event.process.ProcessInstanceErrorDataEvent;
+import org.kie.kogito.event.process.ProcessInstanceNodeDataEvent;
+import org.kie.kogito.event.process.ProcessInstanceStateDataEvent;
+import org.kie.kogito.event.process.ProcessInstanceVariableDataEvent;
+import org.kie.kogito.internal.process.runtime.KogitoNode;
+import org.kie.kogito.internal.process.runtime.KogitoNodeInstance;
+import org.kie.kogito.internal.process.runtime.KogitoWorkflowProcess;
+import org.kie.kogito.internal.process.runtime.KogitoWorkflowProcessInstance;
+import org.mockito.Mockito;
import static java.util.Collections.emptyMap;
import static java.util.Collections.singletonMap;
@@ -49,4 +68,41 @@ public void testServiceDefined() {
assertThat(batch.extractRuntimeSource(singletonMap(PROCESS_ID_META_DATA, "demo.orders"))).isEqualTo("http://localhost:8080/orders");
}
+ @Test
+ public void testEventSorting() {
+ ProcessInstanceEventBatch batch = new ProcessInstanceEventBatch("", null);
+ KogitoWorkflowProcess process = Mockito.mock(KogitoWorkflowProcess.class);
+ KogitoWorkflowProcessInstance processInstance = Mockito.mock(KogitoWorkflowProcessInstance.class);
+ KogitoNodeInstance nodeInstance = Mockito.mock(KogitoNodeInstance.class);
+ KogitoNode node = Mockito.mock(KogitoNode.class);
+ Mockito.when(processInstance.getProcess()).thenReturn(process);
+ Mockito.when(nodeInstance.getNode()).thenReturn(node);
+ batch.append(mockEvent(ProcessVariableChangedEvent.class, processInstance));
+ batch.append(mockEvent(ProcessNodeTriggeredEvent.class, processInstance, nodeInstance));
+ batch.append(mockEvent(ProcessNodeLeftEvent.class, processInstance, nodeInstance));
+ batch.append(mockEvent(ProcessStartedEvent.class, processInstance));
+ batch.append(mockEvent(ProcessNodeTriggeredEvent.class, processInstance, nodeInstance));
+ batch.append(mockEvent(ProcessNodeLeftEvent.class, processInstance, nodeInstance));
+ batch.append(mockEvent(ErrorEvent.class, processInstance, nodeInstance));
+ batch.append(mockEvent(ProcessCompletedEvent.class, processInstance));
+ batch.append(mockEvent(ProcessNodeTriggeredEvent.class, processInstance, nodeInstance));
+ batch.append(mockEvent(ProcessNodeLeftEvent.class, processInstance, nodeInstance));
+ assertThat(batch.processedEvents).hasExactlyElementsOfTypes(ProcessInstanceStateDataEvent.class, ProcessInstanceVariableDataEvent.class, ProcessInstanceNodeDataEvent.class,
+ ProcessInstanceNodeDataEvent.class,
+ ProcessInstanceNodeDataEvent.class, ProcessInstanceNodeDataEvent.class, ProcessInstanceErrorDataEvent.class, ProcessInstanceNodeDataEvent.class, ProcessInstanceNodeDataEvent.class,
+ ProcessInstanceStateDataEvent.class);
+ }
+
+ private T mockEvent(Class clazz, ProcessInstance processInstance) {
+ T event = Mockito.mock(clazz);
+ Mockito.when(event.getProcessInstance()).thenReturn(processInstance);
+ return event;
+ }
+
+ private T mockEvent(Class clazz, ProcessInstance processInstance, NodeInstance nodeInstance) {
+ T event = Mockito.mock(clazz);
+ Mockito.when(event.getProcessInstance()).thenReturn(processInstance);
+ Mockito.when(event.getNodeInstance()).thenReturn(nodeInstance);
+ return event;
+ }
}
diff --git a/drools/kogito-scenario-simulation/src/main/java/org/kogito/scenariosimulation/runner/KogitoDMNScenarioRunnerHelper.java b/drools/kogito-scenario-simulation/src/main/java/org/kogito/scenariosimulation/runner/KogitoDMNScenarioRunnerHelper.java
index ad301b25a50..9d6f96ef9eb 100644
--- a/drools/kogito-scenario-simulation/src/main/java/org/kogito/scenariosimulation/runner/KogitoDMNScenarioRunnerHelper.java
+++ b/drools/kogito-scenario-simulation/src/main/java/org/kogito/scenariosimulation/runner/KogitoDMNScenarioRunnerHelper.java
@@ -53,6 +53,9 @@ public class KogitoDMNScenarioRunnerHelper extends DMNScenarioRunnerHelper {
private DMNRuntime dmnRuntime = initDmnRuntime();
+ private static final String targetFolder = File.separator + "target" + File.separator;
+ private static final String generatedResourcesFolder = targetFolder + "generated-resources" + File.separator;
+
@Override
protected Map executeScenario(KieContainer kieContainer,
ScenarioRunnerData scenarioRunnerData,
@@ -102,8 +105,9 @@ private DMNRuntime initDmnRuntime() {
}
private boolean filterResource(Path path, String extension) {
- String targetFolder = File.separator + "target" + File.separator;
- return path.toString().endsWith(extension) && !path.toString().contains(targetFolder) && Files.isRegularFile(path);
+ return path.toString().endsWith(extension) &&
+ (path.toString().contains(generatedResourcesFolder) || !(path.toString().contains(targetFolder)))
+ && Files.isRegularFile(path);
}
}
diff --git a/jbpm/jbpm-bpmn2/src/main/java/org/kie/kogito/process/bpmn2/BpmnVariables.java b/jbpm/jbpm-bpmn2/src/main/java/org/kie/kogito/process/bpmn2/BpmnVariables.java
index 4d2f0629cc8..65e772dc89b 100644
--- a/jbpm/jbpm-bpmn2/src/main/java/org/kie/kogito/process/bpmn2/BpmnVariables.java
+++ b/jbpm/jbpm-bpmn2/src/main/java/org/kie/kogito/process/bpmn2/BpmnVariables.java
@@ -28,12 +28,13 @@
import org.jbpm.process.core.context.variable.Variable;
import org.kie.kogito.Model;
+import org.kie.kogito.internal.utils.KogitoTags;
public class BpmnVariables implements Model {
- public static final Predicate OUTPUTS_ONLY = v -> v.hasTag(Variable.OUTPUT_TAG);
- public static final Predicate INPUTS_ONLY = v -> v.hasTag(Variable.INPUT_TAG);
- public static final Predicate INTERNAL_ONLY = v -> v.hasTag(Variable.INTERNAL_TAG);
+ public static final Predicate OUTPUTS_ONLY = v -> v.hasTag(KogitoTags.OUTPUT_TAG);
+ public static final Predicate INPUTS_ONLY = v -> v.hasTag(KogitoTags.INPUT_TAG);
+ public static final Predicate INTERNAL_ONLY = v -> v.hasTag(KogitoTags.INTERNAL_TAG);
private final Map variables = new HashMap<>();
diff --git a/jbpm/jbpm-bpmn2/src/test/filtered-resources/META-INF/persistence.xml b/jbpm/jbpm-bpmn2/src/test/filtered-resources/META-INF/persistence.xml
deleted file mode 100755
index f81811971d0..00000000000
--- a/jbpm/jbpm-bpmn2/src/test/filtered-resources/META-INF/persistence.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
- org.hibernate.jpa.HibernatePersistenceProvider
- jdbc/testDS1
- META-INF/JBPMorm.xml
-
- org.drools.persistence.info.SessionInfo
- org.jbpm.persistence.processinstance.ProcessInstanceInfo
- org.drools.persistence.info.WorkItemInfo
-
- org.jbpm.process.audit.ProcessInstanceLog
- org.jbpm.process.audit.NodeInstanceLog
- org.jbpm.process.audit.VariableInstanceLog
-
- org.jbpm.persistence.correlation.CorrelationKeyInfo
- org.jbpm.persistence.correlation.CorrelationPropertyInfo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/canonical/ActivityGenerationModelTest.java b/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/canonical/ActivityGenerationModelTest.java
index ef979162bbf..55eda0b45ef 100644
--- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/canonical/ActivityGenerationModelTest.java
+++ b/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/canonical/ActivityGenerationModelTest.java
@@ -151,6 +151,7 @@ public void testUserTaskProcess() throws Exception {
KogitoWorkItem workItem = workItemHandler.getWorkItem();
assertThat(workItem).isNotNull();
assertThat(workItem.getParameter("ActorId")).isEqualTo("john");
+ assertThat(workItem.getParameter("fixedValue")).isEqualTo("pepe");
processInstance.completeWorkItem(workItem.getStringId(), null, SecurityPolicy.of(new StaticIdentityProvider("john")));
assertThat(processInstance.status()).isEqualTo(STATE_COMPLETED);
}
diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/rule/AgendaFilterTest.java b/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/rule/AgendaFilterTest.java
deleted file mode 100755
index 971013fd91e..00000000000
--- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/rule/AgendaFilterTest.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.bpmn2.rule;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.drools.commands.runtime.rule.FireAllRulesCommand;
-import org.drools.core.event.DebugProcessEventListener;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Test;
-import org.kie.api.command.Command;
-import org.kie.api.definition.type.FactType;
-import org.kie.api.event.rule.DebugAgendaEventListener;
-import org.kie.api.io.ResourceType;
-import org.kie.api.runtime.rule.AgendaFilter;
-import org.kie.api.runtime.rule.Match;
-import org.kie.internal.command.CommandFactory;
-import org.kie.internal.io.ResourceFactory;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-
-import static org.junit.jupiter.api.Assertions.fail;
-
-public class AgendaFilterTest extends AbstractBaseTest {
-
- public static class Message {
-
- private String message;
-
- private int status;
-
- public String getMessage() {
- return this.message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public int getStatus() {
- return this.status;
- }
-
- public void setStatus(int status) {
- this.status = status;
- }
- }
-
- @Test
- public void testActivationCancelled() {
- // JBRULES-3376
- String drl = "package org.jboss.qa.brms.agendafilter\n" +
- "declare CancelFact\n" +
- " cancel : boolean = true\n" +
- "end\n" +
- "rule NoCancel\n" +
- " ruleflow-group \"rfg\"\n" +
- " when\n" +
- " $fact : CancelFact ( cancel == false )\n" +
- " then\n" +
- " System.out.println(\"No cancel...\");\n" +
- " modify ($fact) {\n" +
- " setCancel(true);\n" +
- " }\n" +
- "end\n" +
- "rule PresenceOfBothFacts\n" +
- " ruleflow-group \"rfg\"\n" +
- " salience -1\n" +
- " when\n" +
- " $fact1 : CancelFact( cancel == false )\n" +
- " $fact2 : CancelFact( cancel == true )\n" +
- " then\n" +
- " System.out.println(\"Both facts!\");\n" +
- "end\n" +
- "rule PresenceOfFact\n" +
- " ruleflow-group \"rfg\"\n" +
- " when\n" +
- " $fact : CancelFact( )\n" +
- " then\n" +
- " System.out.println(\"We have a \" + ($fact.isCancel() ? \"\" : \"non-\") + \"cancelling fact!\");\n" +
- "end\n" +
- "rule Cancel\n" +
- " ruleflow-group \"rfg\"\n" +
- " when\n" +
- " $fact : CancelFact ( cancel == true )\n" +
- " then\n" +
- " System.out.println(\"Cancel!\");\n" +
- "end";
-
- String rf = " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " System.out.println(\"Finishing process...\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " System.out.println(\"Starting process...\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "";
-
- builder.add(ResourceFactory.newByteArrayResource(drl.getBytes()), ResourceType.DRL);
- builder.add(ResourceFactory.newByteArrayResource(rf.getBytes()), ResourceType.DRF);
-
- if (builder.hasErrors()) {
- fail(builder.getErrors().toString());
- }
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- kruntime.getKieSession().addEventListener(new DebugAgendaEventListener());
- kruntime.getProcessEventManager().addEventListener(new DebugProcessEventListener());
-
- List> commands = new ArrayList>();
- commands.add(CommandFactory.newInsert(newCancelFact(kruntime, false)));
- commands.add(CommandFactory.newInsert(newCancelFact(kruntime, true)));
- commands.add(CommandFactory.newStartProcess("bz761715"));
- commands.add(new FireAllRulesCommand(new CancelAgendaFilter()));
- commands.add(new FireAllRulesCommand(new CancelAgendaFilter()));
- commands.add(new FireAllRulesCommand(new CancelAgendaFilter()));
-
- kruntime.getKieSession().execute(CommandFactory.newBatchExecution(commands));
- }
-
- private Object newCancelFact(KogitoProcessRuntime kruntime, boolean cancel) {
- FactType type = kruntime.getKieSession().getKieBase().getFactType("org.jboss.qa.brms.agendafilter", "CancelFact");
- Object instance = null;
- try {
- instance = type.newInstance();
-
- type.set(instance, "cancel", cancel);
- } catch (IllegalAccessException | InstantiationException ex) {
- ex.printStackTrace();
- }
-
- return instance;
- }
-
- public static class CancelAgendaFilter implements AgendaFilter {
- public boolean accept(Match activation) {
- return !"Cancel".equals(activation.getRule().getName());
- }
- }
-
-}
diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/rule/PackageBuilderTest.java b/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/rule/PackageBuilderTest.java
deleted file mode 100755
index e2b02800c45..00000000000
--- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/rule/PackageBuilderTest.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.bpmn2.rule;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.List;
-import java.util.Map;
-
-import org.drools.base.definitions.InternalKnowledgePackage;
-import org.drools.core.reteoo.CoreComponentFactory;
-import org.drools.core.util.DroolsStreamUtils;
-import org.drools.drl.ast.descr.PackageDescr;
-import org.jbpm.process.core.Context;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.jbpm.workflow.core.impl.WorkflowProcessImpl;
-import org.junit.jupiter.api.Test;
-import org.kie.api.definition.process.Process;
-import org.kie.api.io.Resource;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class PackageBuilderTest extends AbstractBaseTest {
-
- @Test
- public void testRuleFlow() throws Exception {
- InputStream in = this.getClass().getResourceAsStream("/ruleflow//ruleflow.rfm");
- assertThat(in).isNotNull();
-
- builder.addPackage(new PackageDescr("com.sample"));
-
- builder.addRuleFlow(new InputStreamReader(in));
- InternalKnowledgePackage pkg = builder.getPackage("com.sample");
- assertThat(pkg).isNotNull();
-
- Map flows = pkg.getRuleFlows();
- assertThat(flows).isNotNull().hasSize(1).containsKey("0");
-
- Process p = flows.get("0");
- assertThat(p).isInstanceOf(WorkflowProcessImpl.class);
-
- //now serialization
- InternalKnowledgePackage pkg2 = (InternalKnowledgePackage) DroolsStreamUtils.streamIn(DroolsStreamUtils.streamOut(pkg));
- assertThat(pkg2).isNotNull();
-
- flows = pkg2.getRuleFlows();
- assertThat(flows).isNotNull().hasSize(1).containsKey("0");
- p = flows.get("0");
- assertThat(p).isInstanceOf(WorkflowProcessImpl.class);
- }
-
- @Test
- public void testPackageRuleFlows() {
- InternalKnowledgePackage pkg = CoreComponentFactory.get().createKnowledgePackage("boo");
- Process rf = new MockRuleFlow("1");
- pkg.addProcess(rf);
- assertThat(pkg.getRuleFlows()).containsKey("1");
- assertThat(pkg.getRuleFlows().get("1")).isSameAs(rf);
-
- Process rf2 = new MockRuleFlow("2");
- pkg.addProcess(rf2);
- assertThat(pkg.getRuleFlows()).containsKey("1");
- assertThat(pkg.getRuleFlows().get("1")).isSameAs(rf);
- assertThat(pkg.getRuleFlows()).containsKey("1");
- assertThat(pkg.getRuleFlows().get("2")).isSameAs(rf2);
-
- pkg.removeRuleFlow("1");
- assertThat(pkg.getRuleFlows()).containsKey("2");
- assertThat(pkg.getRuleFlows().get("2")).isSameAs(rf2);
- assertThat(pkg.getRuleFlows()).doesNotContainKey("1");
-
- }
-
- class MockRuleFlow implements Process {
-
- private String id;
-
- MockRuleFlow(String id) {
- this.id = id;
- }
-
- public String getId() {
- return id;
- }
-
- public String getName() {
- return null;
- }
-
- public String getType() {
- return null;
- }
-
- public String getVersion() {
- return null;
- }
-
- public String getPackageName() {
- return null;
- }
-
- public void setId(String id) {
- }
-
- public void setName(String name) {
- }
-
- public void setType(String type) {
- }
-
- public void setVersion(String version) {
- }
-
- public void setPackageName(String packageName) {
- }
-
- public void addContext(Context context) {
- }
-
- public List getContexts(String contextId) {
- return null;
- }
-
- public Context getDefaultContext(String contextId) {
- return null;
- }
-
- public void setDefaultContext(Context context) {
- }
-
- public Context getContext(String contextType, long id) {
- return null;
- }
-
- public Map getMetaData() {
- return null;
- }
-
- public Object getMetaData(String name) {
- return null;
- }
-
- public void setMetaData(String name, Object value) {
- }
-
- public Resource getResource() {
- return null;
- }
-
- public void setResource(Resource resource) {
- }
-
- public String[] getGlobalNames() {
- return null;
- }
-
- public Map getGlobals() {
- return null;
- }
-
- public List getImports() {
- return null;
- }
-
- public void setGlobals(Map globals) {
- }
-
- public void setImports(List imports) {
- }
-
- public List getFunctionImports() {
- return null;
- }
-
- public void setFunctionImports(List functionImports) {
- }
-
- public KnowledgeType getKnowledgeType() {
- return KnowledgeType.PROCESS;
- }
-
- public String getNamespace() {
- return null;
- }
-
- }
-
-}
diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/rule/ProcessFlowControlTest.java b/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/rule/ProcessFlowControlTest.java
deleted file mode 100755
index 07a3ed20ce6..00000000000
--- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/rule/ProcessFlowControlTest.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.bpmn2.rule;
-
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.drools.core.common.InternalAgenda;
-import org.drools.core.common.InternalAgendaGroup;
-import org.drools.core.event.DefaultAgendaEventListener;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.kie.api.event.rule.AgendaEventListener;
-import org.kie.api.event.rule.MatchCancelledEvent;
-import org.kie.api.runtime.rule.FactHandle;
-import org.kie.api.runtime.rule.Match;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProcessFlowControlTest extends AbstractBaseTest {
-
- private static final Logger logger = LoggerFactory.getLogger(ProcessFlowControlTest.class);
-
- @Test
- @Disabled("MVEL not supported in ScriptTask")
- public void testRuleFlowConstraintDialects() throws Exception {
- builder.addRuleFlow(new InputStreamReader(getClass().getResourceAsStream("test_ConstraintDialects.rfm")));
-
- logger.error(builder.getErrors().toString());
-
- assertThat(builder.getErrors().getErrors()).isEmpty();
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List inList = new ArrayList<>();
- List outList = new ArrayList<>();
- kruntime.getKieSession().setGlobal("inList",
- inList);
- kruntime.getKieSession().setGlobal("outList",
- outList);
-
- inList.add(1);
- inList.add(3);
- inList.add(6);
- inList.add(25);
-
- FactHandle handle = kruntime.getKieSession().insert(inList);
- kruntime.startProcess("ConstraintDialects");
- assertThat(outList).hasSize(4);
- assertThat(outList.get(0)).isEqualTo("MVELCodeConstraint was here");
- assertThat(outList.get(1)).isEqualTo("JavaCodeConstraint was here");
- assertThat(outList.get(2)).isEqualTo("MVELRuleConstraint was here");
- assertThat(outList.get(3)).isEqualTo("JavaRuleConstraint was here");
-
- outList.clear();
- inList.remove(Integer.valueOf(1));
- kruntime.getKieSession().update(handle,
- inList);
- kruntime.startProcess("ConstraintDialects");
- assertThat(outList).hasSize(3);
- assertThat(outList.get(0)).isEqualTo("JavaCodeConstraint was here");
- assertThat(outList.get(1)).isEqualTo("MVELRuleConstraint was here");
- assertThat(outList.get(2)).isEqualTo("JavaRuleConstraint was here");
-
- outList.clear();
- inList.remove(Integer.valueOf(6));
- kruntime.getKieSession().update(handle,
- inList);
- kruntime.startProcess("ConstraintDialects");
- assertThat(outList).hasSize(2);
- assertThat(outList.get(0)).isEqualTo("JavaCodeConstraint was here");
- assertThat(outList.get(1)).isEqualTo("JavaRuleConstraint was here");
-
- outList.clear();
- inList.remove(Integer.valueOf(3));
- kruntime.getKieSession().update(handle,
- inList);
- kruntime.startProcess("ConstraintDialects");
- assertThat(outList).hasSize(1);
- assertThat(outList.get(0)).isEqualTo("JavaRuleConstraint was here");
-
- outList.clear();
- inList.remove(Integer.valueOf(25));
- kruntime.getKieSession().update(handle,
- inList);
- KogitoProcessInstance processInstance = kruntime.startProcess("ConstraintDialects");
-
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ERROR);
- }
-
- @Test
- public void testRuleFlow() throws Exception {
- builder.addPackageFromDrl(new InputStreamReader(getClass().getResourceAsStream("/ruleflow/ruleflow.drl")));
- builder.addRuleFlow(new InputStreamReader(getClass().getResourceAsStream("/ruleflow/ruleflow.rfm")));
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- final List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list",
- list);
-
- kruntime.getKieSession().fireAllRules();
- assertThat(list).isEmpty();
-
- final KogitoProcessInstance processInstance = kruntime.startProcess("0");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(4);
- assertThat(list.get(0)).isEqualTo("Rule1");
- list.subList(1, 2).contains("Rule2");
- list.subList(1, 2).contains("Rule3");
- assertThat(list.get(3)).isEqualTo("Rule4");
- }
-
- @Test
- public void testRuleFlowClear() throws Exception {
- builder.addPackageFromDrl(new InputStreamReader(getClass().getResourceAsStream("/ruleflow/test_ruleflowClear.drl")));
- builder.addRuleFlow(new InputStreamReader(getClass().getResourceAsStream("/ruleflow/test_ruleflowClear.rfm")));
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- final List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list",
- list);
-
- final List activations = new ArrayList();
- AgendaEventListener listener = new DefaultAgendaEventListener() {
- public void matchCancelled(MatchCancelledEvent event) {
- activations.add(event.getMatch());
- }
- };
-
- kruntime.getKieSession().addEventListener(listener);
- InternalAgenda agenda = (InternalAgenda) kruntime.getKieSession().getAgenda();
- // assertEquals( 0,
- // agenda.getRuleFlowGroup( "flowgroup-1" ).size() );
-
- // We need to call fireAllRules here to get the InitialFact into the system, to the eval(true)'s kick in
- kruntime.getKieSession().fireAllRules();
- agenda.evaluateEagerList();
-
- // Now we have 4 in the RuleFlow, but not yet in the agenda
- assertThat(agenda.sizeOfRuleFlowGroup("flowgroup-1")).isEqualTo(4);
-
- // Check they aren't in the Agenda
- assertThat(((InternalAgendaGroup) agenda.getAgendaGroup("MAIN")).size()).isZero();
-
- // Check we have 0 activation cancellation events
- assertThat(activations).isEmpty();
-
- ((InternalAgenda) kruntime.getKieSession().getAgenda()).clearAndCancelRuleFlowGroup("flowgroup-1");
-
- // Check the AgendaGroup and RuleFlowGroup are now empty
- assertThat(((InternalAgendaGroup) agenda.getAgendaGroup("MAIN")).size()).isZero();
- assertThat(agenda.sizeOfRuleFlowGroup("flowgroup-1")).isZero();
-
- // Check we have four activation cancellation events
- assertThat(activations).hasSize(4);
- }
-
- @Test
- public void testRuleFlowInPackage() throws Exception {
- builder.addPackageFromDrl(new InputStreamReader(getClass().getResourceAsStream("/ruleflow/ruleflow.drl")));
- builder.addRuleFlow(new InputStreamReader(getClass().getResourceAsStream("/ruleflow/ruleflow.rfm")));
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- final List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list",
- list);
-
- kruntime.getKieSession().fireAllRules();
- assertThat(list).isEmpty();
-
- final KogitoProcessInstance processInstance = kruntime.startProcess("0");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(4);
- assertThat(list.get(0)).isEqualTo("Rule1");
- list.subList(1, 2).contains("Rule2");
- list.subList(1, 2).contains("Rule3");
- assertThat(list.get(3)).isEqualTo("Rule4");
-
- }
-
- @Test
- public void testLoadingRuleFlowInPackage1() throws Exception {
- // adding ruleflow before adding package
- builder.addRuleFlow(new InputStreamReader(getClass().getResourceAsStream("/ruleflow/ruleflow.rfm")));
- builder.addPackageFromDrl(new InputStreamReader(getClass().getResourceAsStream("/ruleflow/ruleflow.drl")));
- assertThat(builder.getPackages()).isNotEmpty();
- }
-
- @Test
- public void testLoadingRuleFlowInPackage2() throws Exception {
- // only adding ruleflow
- builder.addRuleFlow(new InputStreamReader(getClass().getResourceAsStream("/ruleflow/ruleflow.rfm")));
- assertThat(builder.getPackages()).isNotEmpty();
- }
-
- @Test
- public void testLoadingRuleFlowInPackage3() throws Exception {
- // only adding ruleflow without any generated rules
- builder.addRuleFlow(new InputStreamReader(getClass().getResourceAsStream("/ruleflow/empty_ruleflow.rfm")));
- assertThat(builder.getPackages()).isNotEmpty();
- }
-
- @Test
- @Disabled("MVEL not supported in ScriptTask")
- public void testRuleFlowActionDialects() throws Exception {
- builder.addRuleFlow(new InputStreamReader(getClass().getResourceAsStream("/ruleflow/test_ActionDialects.rfm")));
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list",
- list);
-
- kruntime.startProcess("ActionDialects");
-
- assertThat(list).hasSize(2);
- assertThat(list.get(0)).isEqualTo("mvel was here");
- assertThat(list.get(1)).isEqualTo("java was here");
- }
-
- @Test
- public void testLoadingRuleFlowNoPackageName() {
- // loading a ruleflow with errors (null package name cause 3 errors)
- builder.addRuleFlow(new InputStreamReader(getClass().getResourceAsStream("/ruleflow/error_ruleflow.rfm")));
- assertThat(builder.getErrors().getErrors()).hasSize(3);
- }
-
-}
diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/rule/ProcessMarshallingTest.java b/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/rule/ProcessMarshallingTest.java
deleted file mode 100755
index 43946029067..00000000000
--- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/rule/ProcessMarshallingTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.bpmn2.rule;
-
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jbpm.integrationtests.test.Person;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.internal.io.ResourceFactory;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProcessMarshallingTest extends AbstractBaseTest {
-
- @Test
- public void testMarshallingProcessInstancesAndGlobals() {
- String rule = "package org.test;\n";
- rule += "import org.jbpm.integrationtests.test.Person\n";
- rule += "global java.util.List list\n";
- rule += "rule \"Rule 1\"\n";
- rule += " ruleflow-group \"hello\"\n";
- rule += "when\n";
- rule += " $p : Person( ) \n";
- rule += "then\n";
- rule += " list.add( $p );\n";
- rule += "end";
-
- String process =
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "";
-
- builder.add(ResourceFactory.newReaderResource(new StringReader(rule)), ResourceType.DRL);
- builder.add(ResourceFactory.newReaderResource(new StringReader(process)), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- kruntime.getKieRuntime().getEnvironment().set("org.jbpm.rule.task.waitstate", true);
-
- List
- */
public static String replaceIllegalChars(final String code) {
final StringBuilder sb = new StringBuilder();
if (code != null) {
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/XmlPackageReader.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/XmlPackageReader.java
deleted file mode 100644
index d2cbdd56308..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/XmlPackageReader.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import javax.xml.parsers.SAXParser;
-
-import org.drools.drl.ast.descr.PackageDescr;
-import org.jbpm.compiler.xml.core.ExtensibleXmlParser;
-import org.jbpm.compiler.xml.core.SemanticModules;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-public class XmlPackageReader {
- private ExtensibleXmlParser parser;
-
- private PackageDescr packageDescr;
-
- public XmlPackageReader(final SemanticModules modules) {
- this(modules, null);
- }
-
- public XmlPackageReader(final SemanticModules modules, final SAXParser parser) {
- if (parser == null) {
- this.parser = new ExtensibleXmlParser();
- } else {
- this.parser = new ExtensibleXmlParser(parser);
- }
- this.parser.setSemanticModules(modules);
- }
-
- public ExtensibleXmlParser getParser() {
- return this.parser;
- }
-
- /**
- * Read a RuleSet
from a Reader
.
- *
- * @param reader
- * The reader containing the rule-set.
- *
- * @return The rule-set.
- */
- public PackageDescr read(final Reader reader) throws SAXException,
- IOException {
- this.packageDescr = (PackageDescr) this.parser.read(reader);
- return this.packageDescr;
- }
-
- /**
- * Read a RuleSet
from an InputStream
.
- *
- * @param inputStream
- * The input-stream containing the rule-set.
- *
- * @return The rule-set.
- */
- public PackageDescr read(final InputStream inputStream) throws SAXException,
- IOException {
- this.packageDescr = (PackageDescr) this.parser.read(inputStream);
- return this.packageDescr;
- }
-
- /**
- * Read a RuleSet
from an InputSource
.
- *
- * @param in
- * The rule-set input-source.
- *
- * @return The rule-set.
- */
- public PackageDescr read(final InputSource in) throws SAXException,
- IOException {
- this.packageDescr = (PackageDescr) this.parser.read(in);
- return this.packageDescr;
- }
-
- void setPackageDescr(final PackageDescr packageDescr) {
- this.packageDescr = packageDescr;
- }
-
- public PackageDescr getPackageDescr() {
- return this.packageDescr;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/AccumulateHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/AccumulateHandler.java
deleted file mode 100644
index 248468b3984..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/AccumulateHandler.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.AccumulateDescr;
-import org.drools.drl.ast.descr.ConditionalElementDescr;
-import org.drools.drl.ast.descr.FromDescr;
-import org.drools.drl.ast.descr.PatternDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class AccumulateHandler extends BaseAbstractHandler
- implements
- Handler {
-
- public AccumulateHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
-
- parser.startElementBuilder(localName, attrs);
- return new AccumulateDescr();
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
-
- parser.endElementBuilder();
- final AccumulateDescr accumulateDescr = (AccumulateDescr) parser.getCurrent();
-
- final Object parent = parser.getParent();
-
- if (parent.getClass().getName().equals(FromDescr.class.getName())) {
- final PatternDescr result = (PatternDescr) parser.getParent(1);
- result.setSource(accumulateDescr);
-
- } else if (parent instanceof ConditionalElementDescr) {
- final ConditionalElementDescr parentDescr = (ConditionalElementDescr) parent;
- parentDescr.addDescr(accumulateDescr);
- }
-
- return accumulateDescr;
- }
-
- public Class generateNodeFor() {
- return AccumulateDescr.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/AccumulateHelperHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/AccumulateHelperHandler.java
deleted file mode 100644
index f404253024f..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/AccumulateHelperHandler.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.AccumulateDescr;
-import org.drools.drl.ast.descr.BaseDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class AccumulateHelperHandler extends BaseAbstractHandler
- implements
- Handler {
-
- public AccumulateHelperHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
-
- parser.startElementBuilder(localName,
- attrs);
-
- return new BaseDescr();
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
-
- final Element element = parser.endElementBuilder();
-
- final String expression = ((org.w3c.dom.Text) element.getChildNodes().item(0)).getWholeText();
-
- final Object parent = parser.getParent();
-
- final AccumulateDescr accumulate = (AccumulateDescr) parent;
-
- if (localName.equals("init")) {
- emptyContentCheck(localName, expression, parser);
- accumulate.setInitCode(expression.trim());
- } else if (localName.equals("action")) {
- emptyContentCheck(localName, expression, parser);
- accumulate.setActionCode(expression.trim());
- } else if (localName.equals("result")) {
- emptyContentCheck(localName, expression, parser);
- accumulate.setResultCode(expression.trim());
- } else if (localName.equals("reverse")) {
- emptyContentCheck(localName, expression, parser);
- accumulate.setReverseCode(expression.trim());
- } else if (localName.equals("external-function")) {
- accumulate.addFunction(element.getAttribute("evaluator"),
- null, // no support to bindings yet?
- false,
- new String[] { element.getAttribute("expression") });
- }
-
- return null;
- }
-
- public Class generateNodeFor() {
- return BaseDescr.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/AndHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/AndHandler.java
deleted file mode 100644
index f13a7f625e4..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/AndHandler.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.AndDescr;
-import org.drools.drl.ast.descr.ConditionalElementDescr;
-import org.drools.drl.ast.descr.MultiPatternDestinationDescr;
-import org.drools.drl.ast.descr.QueryDescr;
-import org.drools.drl.ast.descr.RuleDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-/**
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
- */
-public class AndHandler extends BaseAbstractHandler
- implements
- Handler {
- public AndHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- return new AndDescr();
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
-
- final AndDescr andDescr = (AndDescr) parser.getCurrent();
-
- final Object parent = parser.getParent();
-
- if (!andDescr.getDescrs().isEmpty()) {
- if (parent instanceof RuleDescr || parent instanceof QueryDescr) {
- final RuleDescr ruleDescr = (RuleDescr) parent;
- ruleDescr.setLhs(andDescr);
- } else if (parent instanceof MultiPatternDestinationDescr) {
- final MultiPatternDestinationDescr mpDescr = (MultiPatternDestinationDescr) parent;
- mpDescr.setInput(andDescr);
- } else if (parent instanceof ConditionalElementDescr) {
- final ConditionalElementDescr ceDescr = (ConditionalElementDescr) parent;
- ceDescr.addDescr(andDescr);
- }
- }
-
- return andDescr;
- }
-
- public Class generateNodeFor() {
- return AndDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/CollectHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/CollectHandler.java
deleted file mode 100644
index e82569c58b9..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/CollectHandler.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.CollectDescr;
-import org.drools.drl.ast.descr.ConditionalElementDescr;
-import org.drools.drl.ast.descr.FromDescr;
-import org.drools.drl.ast.descr.PatternDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class CollectHandler extends BaseAbstractHandler
- implements
- Handler {
-
- public CollectHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- return new CollectDescr();
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- final CollectDescr collectDescr = (CollectDescr) parser.getCurrent();
-
- final Object parent = parser.getParent();
-
- if (parent.getClass().getName().equals(FromDescr.class.getName())) {
- final PatternDescr resultPattern = (PatternDescr) parser.getParent(1);
- resultPattern.setSource(collectDescr);
- } else if (parent instanceof ConditionalElementDescr) {
- final ConditionalElementDescr parentDescr = (ConditionalElementDescr) parent;
- parentDescr.addDescr(collectDescr);
- }
-
- return collectDescr;
- }
-
- public Class generateNodeFor() {
- return CollectDescr.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/EvalHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/EvalHandler.java
deleted file mode 100644
index a76906eac93..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/EvalHandler.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.ConditionalElementDescr;
-import org.drools.drl.ast.descr.EvalDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-/**
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
- */
-public class EvalHandler extends BaseAbstractHandler
- implements
- Handler {
- public EvalHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- return new EvalDescr();
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- final Element element = parser.endElementBuilder();
-
- final EvalDescr evalDescr = (EvalDescr) parser.getCurrent();
-
- final String expression = ((org.w3c.dom.Text) element.getChildNodes().item(0)).getWholeText();
-
- emptyContentCheck(localName, expression, parser);
-
- evalDescr.setContent(expression);
-
- final ConditionalElementDescr parentDescr = (ConditionalElementDescr) parser.getParent();
- parentDescr.addDescr(evalDescr);
-
- return evalDescr;
- }
-
- public Class generateNodeFor() {
- return EvalDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ExistsHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ExistsHandler.java
deleted file mode 100644
index 3c3e4e2be7b..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ExistsHandler.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.ConditionalElementDescr;
-import org.drools.drl.ast.descr.ExistsDescr;
-import org.drools.drl.ast.descr.PatternDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
- */
-public class ExistsHandler extends BaseAbstractHandler
- implements
- Handler {
- public ExistsHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- return new ExistsDescr();
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
-
- final ExistsDescr existsDescr = (ExistsDescr) parser.getCurrent();
-
- if ((existsDescr.getDescrs().size() != 1) && (existsDescr.getDescrs().get(0).getClass() != PatternDescr.class)) {
- throw new SAXParseException(" can only have a single as a child element",
- parser.getLocator());
- }
-
- final ConditionalElementDescr parentDescr = (ConditionalElementDescr) parser.getParent();
- parentDescr.addDescr(existsDescr);
-
- return existsDescr;
- }
-
- public Class generateNodeFor() {
- return ExistsDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ExprConstraintHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ExprConstraintHandler.java
deleted file mode 100644
index 8bce145c5cf..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ExprConstraintHandler.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.ExprConstraintDescr;
-import org.drools.drl.ast.descr.PatternDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-/**
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
- */
-public class ExprConstraintHandler extends BaseAbstractHandler
- implements
- Handler {
- public ExprConstraintHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- return "";
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- final Element element = parser.endElementBuilder();
- final String expression = ((org.w3c.dom.Text) element.getChildNodes().item(0)).getWholeText();
- emptyContentCheck(localName, expression, parser);
-
- PatternDescr p = (PatternDescr) parser.getParent();
-
- ExprConstraintDescr descr = new ExprConstraintDescr(expression);
-
- p.getConstraint().addDescr(descr);
-
- return descr;
- }
-
- public Class generateNodeFor() {
- return ExprConstraintDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ExpressionHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ExpressionHandler.java
deleted file mode 100644
index f560bd98901..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ExpressionHandler.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.BaseDescr;
-import org.drools.drl.ast.descr.FromDescr;
-import org.drools.drl.ast.descr.MVELExprDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class ExpressionHandler extends BaseAbstractHandler
- implements
- Handler {
-
- public ExpressionHandler() {
- }
-
- public Class generateNodeFor() {
- return BaseDescr.class;
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- return new BaseDescr();
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- final Element element = parser.endElementBuilder();
-
- final String expression = ((org.w3c.dom.Text) element.getChildNodes().item(0)).getWholeText();
-
- emptyContentCheck(localName, expression, parser);
-
- FromDescr parent = (FromDescr) parser.getParent();
- parent.setDataSource(new MVELExprDescr(expression.trim()));
- return null;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/FieldBindingHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/FieldBindingHandler.java
deleted file mode 100644
index ae3ff70caa7..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/FieldBindingHandler.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.BindingDescr;
-import org.drools.drl.ast.descr.PatternDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class FieldBindingHandler extends BaseAbstractHandler
- implements
- Handler {
- public FieldBindingHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- final String identifier = attrs.getValue("identifier");
- final String fieldName = attrs.getValue("field-name");
-
- emptyAttributeCheck(localName,
- "identifier",
- identifier,
- parser);
- emptyAttributeCheck(localName,
- "fieldName",
- fieldName,
- parser);
-
- return new BindingDescr(identifier,
- fieldName);
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
-
- final BindingDescr fieldBindingDescr = (BindingDescr) parser.getCurrent();
-
- final PatternDescr patternDescr = (PatternDescr) parser.getParent();
-
- patternDescr.addConstraint(fieldBindingDescr);
-
- return fieldBindingDescr;
- }
-
- public Class generateNodeFor() {
- return BindingDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/FieldConstraintHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/FieldConstraintHandler.java
deleted file mode 100644
index 64633ded6f8..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/FieldConstraintHandler.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.ConnectiveDescr;
-import org.drools.drl.ast.descr.ConnectiveDescr.RestrictionConnectiveType;
-import org.drools.drl.ast.descr.ExprConstraintDescr;
-import org.drools.drl.ast.descr.PatternDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-/**
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
- */
-public class FieldConstraintHandler extends BaseAbstractHandler
- implements
- Handler {
- public FieldConstraintHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- final String fieldName = attrs.getValue("field-name");
- emptyAttributeCheck(localName,
- "field-name",
- fieldName,
- parser);
- final ConnectiveDescr connective = new ConnectiveDescr(RestrictionConnectiveType.AND);
- connective.setParen(false);
-
- connective.setPrefix(fieldName);
-
- return connective;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
-
- final ConnectiveDescr c = (ConnectiveDescr) parser.getCurrent();
-
- Object p = parser.getParent();
- if (p instanceof PatternDescr) {
- StringBuilder sb = new StringBuilder();
- c.buildExpression(sb);
-
- ExprConstraintDescr expr = new ExprConstraintDescr();
- expr.setExpression(sb.toString());
-
- final PatternDescr patternDescr = (PatternDescr) parser.getParent();
- patternDescr.addConstraint(expr);
-
- } else if (p instanceof ConnectiveDescr) {
- ((ConnectiveDescr) p).add(c);
- }
-
- return c;
- }
-
- public Class generateNodeFor() {
- return ExprConstraintHandler.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ForallHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ForallHandler.java
deleted file mode 100644
index 6c864f3afea..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ForallHandler.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.ConditionalElementDescr;
-import org.drools.drl.ast.descr.ForallDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class ForallHandler extends BaseAbstractHandler
- implements
- Handler {
-
- public ForallHandler() {
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.kie.xml.Handler#start(java.lang.String, java.lang.String, org.xml.sax.Attributes)
- */
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- return new ForallDescr();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.kie.xml.Handler#end(java.lang.String, java.lang.String)
- */
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
-
- final ForallDescr forallDescr = (ForallDescr) parser.getCurrent();
-
- final Object parent = parser.getParent();
-
- final ConditionalElementDescr parentDescr = (ConditionalElementDescr) parent;
- parentDescr.addDescr(forallDescr);
-
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.kie.xml.Handler#generateNodeFor()
- */
- public Class generateNodeFor() {
- return ForallDescr.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/FromHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/FromHandler.java
deleted file mode 100644
index d971f98a2ab..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/FromHandler.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.FromDescr;
-import org.drools.drl.ast.descr.PatternDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class FromHandler extends BaseAbstractHandler
- implements
- Handler {
-
- public FromHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- return new FromDescr();
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- final Element element = parser.endElementBuilder();
-
- final FromDescr fromDescr = (FromDescr) parser.getCurrent();
-
- Object parent = parser.getParent();
-
- final PatternDescr patternDescr = (PatternDescr) parent;
-
- if (element.getElementsByTagName("expression").getLength() > 0) {
- patternDescr.setSource(fromDescr);
- }
-
- return fromDescr;
- }
-
- public Class generateNodeFor() {
- return FromDescr.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/FunctionHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/FunctionHandler.java
deleted file mode 100644
index 7d06e881371..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/FunctionHandler.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.FunctionDescr;
-import org.drools.drl.ast.descr.PackageDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
- */
-public class FunctionHandler extends BaseAbstractHandler
- implements
- Handler {
- public FunctionHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- final String name = attrs.getValue("name");
- final String returnType = attrs.getValue("return-type");
-
- emptyAttributeCheck(localName, "name", name, parser);
- emptyAttributeCheck(localName, "return-type", returnType, parser);
-
- return new FunctionDescr(name, returnType);
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- final Element element = parser.endElementBuilder();
-
- FunctionDescr functionDescr = (FunctionDescr) parser.getCurrent();
-
- final NodeList parameters = element.getElementsByTagName("parameter");
-
- for (int i = 0, length = parameters.getLength(); i < length; i++) {
- final String identifier = ((Element) parameters.item(i)).getAttribute("identifier");
- final String type = ((Element) parameters.item(i)).getAttribute("type");
-
- emptyAttributeCheck("parameter", "identifier", identifier, parser);
- emptyAttributeCheck("parameter", "type", type, parser);
-
- functionDescr.addParameter(type,
- identifier);
- }
-
- // we allow empty, "", bodies - but make sure that we atleast have a body element
-
- NodeList list = element.getElementsByTagName("body");
- if (list.getLength() == 0) {
- throw new SAXParseException("function must have a ",
- parser.getLocator());
-
- }
-
- functionDescr.setText(((org.w3c.dom.Text) list.item(0).getChildNodes().item(0)).getWholeText());
-
- final PackageDescr packageDescr = (PackageDescr) parser.getData();
-
- packageDescr.addFunction(functionDescr);
-
- return functionDescr;
- }
-
- public Class generateNodeFor() {
- return FunctionDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/LiteralRestrictionHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/LiteralRestrictionHandler.java
deleted file mode 100644
index c52cc991411..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/LiteralRestrictionHandler.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import java.math.BigDecimal;
-
-import org.drools.drl.ast.descr.ConnectiveDescr;
-import org.drools.drl.ast.descr.LiteralRestrictionDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class LiteralRestrictionHandler extends BaseAbstractHandler
- implements
- Handler {
- public LiteralRestrictionHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- String evaluator = attrs.getValue("evaluator");
- emptyAttributeCheck(localName, "evaluator", evaluator, parser);
-
- String text = attrs.getValue("value");
-
- if (!text.trim().equals("null")) {
- // find out if it's a valid integer or decimal, if not wrap in quotes
- try {
- new BigDecimal(text);
- } catch (NumberFormatException e) {
- text = "\"" + text.trim() + "\"";
- }
- }
-
- return evaluator.trim() + " " + text.trim();
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
-
- ConnectiveDescr c = (ConnectiveDescr) parser.getParent();
- String s = (String) parser.getCurrent();
-
- c.add(s);
- return null;
- }
-
- public Class generateNodeFor() {
- return LiteralRestrictionDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/NotHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/NotHandler.java
deleted file mode 100644
index 017b4595c7b..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/NotHandler.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.ConditionalElementDescr;
-import org.drools.drl.ast.descr.NotDescr;
-import org.drools.drl.ast.descr.PatternDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
- */
-public class NotHandler extends BaseAbstractHandler
- implements
- Handler {
- public NotHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- return new NotDescr();
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
-
- final NotDescr notDescr = (NotDescr) parser.getCurrent();
-
- if ((notDescr.getDescrs().size() != 1) && (notDescr.getDescrs().get(0).getClass() != PatternDescr.class)) {
- throw new SAXParseException(" can only have a single as a child element",
- parser.getLocator());
- }
-
- final ConditionalElementDescr parentDescr = (ConditionalElementDescr) parser.getParent();
- parentDescr.addDescr(notDescr);
-
- return null;
- }
-
- public Class generateNodeFor() {
- return NotDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/OrHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/OrHandler.java
deleted file mode 100644
index d7a3ff501b3..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/OrHandler.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.ConditionalElementDescr;
-import org.drools.drl.ast.descr.MultiPatternDestinationDescr;
-import org.drools.drl.ast.descr.OrDescr;
-import org.drools.drl.ast.descr.QueryDescr;
-import org.drools.drl.ast.descr.RuleDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class OrHandler extends BaseAbstractHandler
- implements
- Handler {
- public OrHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- return new OrDescr();
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
-
- final OrDescr orDescr = (OrDescr) parser.getCurrent();
-
- final Object parent = parser.getParent();
-
- if (!orDescr.getDescrs().isEmpty()) {
- if (parent instanceof RuleDescr || parent instanceof QueryDescr) {
- final RuleDescr ruleDescr = (RuleDescr) parent;
- ruleDescr.getLhs().addDescr(orDescr);
- } else if (parent instanceof MultiPatternDestinationDescr) {
- final MultiPatternDestinationDescr mpDescr = (MultiPatternDestinationDescr) parent;
- mpDescr.setInput(orDescr);
- } else if (parent instanceof ConditionalElementDescr) {
- final ConditionalElementDescr ceDescr = (ConditionalElementDescr) parent;
- ceDescr.addDescr(orDescr);
- }
- }
-
- return orDescr;
- }
-
- public Class generateNodeFor() {
- return OrDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/PackageHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/PackageHandler.java
deleted file mode 100644
index 56e8f19f0ab..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/PackageHandler.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.FunctionImportDescr;
-import org.drools.drl.ast.descr.GlobalDescr;
-import org.drools.drl.ast.descr.ImportDescr;
-import org.drools.drl.ast.descr.PackageDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
- */
-public class PackageHandler extends BaseAbstractHandler
- implements
- Handler {
- public PackageHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- final String ruleSetName = attrs.getValue("name");
-
- if (ruleSetName == null || ruleSetName.trim().equals("")) {
- throw new SAXParseException(" requires a 'name' attribute",
- parser.getLocator());
- }
-
- final PackageDescr packageDescr = new PackageDescr(ruleSetName.trim());
-
- parser.setData(packageDescr);
- return packageDescr;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- final PackageDescr packageDescr = (PackageDescr) parser.getData();
- final Element element = parser.endElementBuilder();
-
- NodeList imports = element.getElementsByTagName("import");
-
- for (int i = 0, length = imports.getLength(); i < length; i++) {
- final String importEntry = ((Element) imports.item(i)).getAttribute("name");
-
- if (importEntry == null || importEntry.trim().equals("")) {
- throw new SAXParseException(" cannot be blank",
- parser.getLocator());
- }
- packageDescr.addImport(new ImportDescr(importEntry));
- }
-
- NodeList importfunctions = element.getElementsByTagName("importfunction");
-
- for (int i = 0, length = importfunctions.getLength(); i < length; i++) {
- final String importfunctionEntry = ((Element) importfunctions.item(i)).getAttribute("name");
-
- if (importfunctionEntry == null || importfunctionEntry.trim().equals("")) {
- throw new SAXParseException(" cannot be blank",
- parser.getLocator());
- }
-
- FunctionImportDescr funcdescr = new FunctionImportDescr();
- funcdescr.setTarget(importfunctionEntry);
-
- packageDescr.addFunctionImport(funcdescr);
- }
-
- NodeList globals = element.getElementsByTagName("global");
-
- for (int i = 0, length = globals.getLength(); i < length; i++) {
- final String identifier = ((Element) globals.item(i)).getAttribute("identifier");
-
- if (identifier == null || identifier.trim().equals("")) {
- throw new SAXParseException(" must have an identifier",
- parser.getLocator());
- }
-
- final String type = ((Element) globals.item(i)).getAttribute("type");
- if (type == null || type.trim().equals("")) {
- throw new SAXParseException(" must have specify a type",
- parser.getLocator());
- }
- final GlobalDescr global = new GlobalDescr(identifier,
- type);
- packageDescr.addGlobal(global);
- }
-
- return packageDescr;
- }
-
- public Class generateNodeFor() {
- return PackageDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/PatternHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/PatternHandler.java
deleted file mode 100644
index 0848fdf1708..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/PatternHandler.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.ConditionalElementDescr;
-import org.drools.drl.ast.descr.PatternDescr;
-import org.drools.drl.ast.descr.PatternDestinationDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
- */
-public class PatternHandler extends BaseAbstractHandler
- implements
- Handler {
- public PatternHandler() {
-
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- final String objectType = attrs.getValue("object-type");
-
- if (objectType == null || objectType.trim().equals("")) {
- throw new SAXParseException(" requires an 'object-type' attribute",
- parser.getLocator());
- }
-
- PatternDescr patternDescr = null;
-
- final String identifier = attrs.getValue("identifier");
- if (identifier == null || identifier.trim().equals("")) {
- patternDescr = new PatternDescr(objectType);
- } else {
- patternDescr = new PatternDescr(objectType,
- identifier);
- }
-
- return patternDescr;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- final PatternDescr patternDescr = (PatternDescr) parser.getCurrent();
-
- final Object parent = parser.getParent();
-
- if (parent instanceof PatternDestinationDescr) {
- final PatternDestinationDescr parentDescr = (PatternDestinationDescr) parent;
- parentDescr.setInputPattern(patternDescr);
- } else {
- final ConditionalElementDescr parentDescr = (ConditionalElementDescr) parent;
- parentDescr.addDescr(patternDescr);
- }
- return patternDescr;
- }
-
- public Class generateNodeFor() {
- return PatternDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/PredicateHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/PredicateHandler.java
deleted file mode 100644
index 38294cb26af..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/PredicateHandler.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.ExprConstraintDescr;
-import org.drools.drl.ast.descr.PatternDescr;
-import org.drools.drl.ast.descr.PredicateDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
- */
-public class PredicateHandler extends BaseAbstractHandler
- implements
- Handler {
- public PredicateHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- return ""; // need to return something, otherwise it'll pop the parent
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- final Element element = parser.endElementBuilder();
-
- final String expression = ((org.w3c.dom.Text) element.getChildNodes().item(0)).getWholeText();
-
- if (expression == null || expression.trim().equals("")) {
- throw new SAXParseException(" must have some content",
- parser.getLocator());
- }
-
- final PatternDescr patternDescr = (PatternDescr) parser.getParent();
-
- ExprConstraintDescr expr = new ExprConstraintDescr("eval(" + expression + ")");
-
- patternDescr.addConstraint(expr);
-
- return expr;
- }
-
- public Class generateNodeFor() {
- return PredicateDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/QualifiedIdentifierRestrictionHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/QualifiedIdentifierRestrictionHandler.java
deleted file mode 100644
index 0c0c7a13653..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/QualifiedIdentifierRestrictionHandler.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.ConnectiveDescr;
-import org.drools.drl.ast.descr.QualifiedIdentifierRestrictionDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class QualifiedIdentifierRestrictionHandler extends BaseAbstractHandler
- implements
- Handler {
- public QualifiedIdentifierRestrictionHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- String evaluator = attrs.getValue("evaluator");
- emptyAttributeCheck(localName, "evaluator", evaluator, parser);
-
- return evaluator.trim() + " ";
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- final Element element = parser.endElementBuilder();
- final String expression = ((org.w3c.dom.Text) element.getChildNodes().item(0)).getWholeText();
-
- emptyContentCheck(localName, expression, parser);
-
- ConnectiveDescr c = (ConnectiveDescr) parser.getParent();
- String s = ((String) parser.getCurrent()) + expression;
-
- c.add(s);
- return null;
- }
-
- public Class generateNodeFor() {
- return QualifiedIdentifierRestrictionDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/QueryHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/QueryHandler.java
deleted file mode 100644
index 14b959399d8..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/QueryHandler.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.AndDescr;
-import org.drools.drl.ast.descr.PackageDescr;
-import org.drools.drl.ast.descr.QueryDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
- */
-public class QueryHandler extends BaseAbstractHandler
- implements
- Handler {
- public QueryHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- final String queryName = attrs.getValue("name");
- emptyAttributeCheck(localName, "name", queryName, parser);
-
- return new QueryDescr(queryName.trim());
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
-
- final QueryDescr queryDescr = (QueryDescr) parser.getCurrent();
-
- final AndDescr lhs = queryDescr.getLhs();
-
- if (lhs == null || lhs.getDescrs().isEmpty()) {
- throw new SAXParseException(" requires a LHS",
- parser.getLocator());
- }
-
- ((PackageDescr) parser.getData()).addRule(queryDescr);
-
- return queryDescr;
- }
-
- public Class generateNodeFor() {
- return QueryDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/RestrictionConnectiveHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/RestrictionConnectiveHandler.java
deleted file mode 100755
index 8d0c382dedf..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/RestrictionConnectiveHandler.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.ConnectiveDescr;
-import org.drools.drl.ast.descr.ConnectiveDescr.RestrictionConnectiveType;
-import org.drools.drl.ast.descr.ExprConstraintDescr;
-import org.drools.drl.ast.descr.PatternDescr;
-import org.drools.drl.ast.descr.RestrictionConnectiveDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
- */
-public class RestrictionConnectiveHandler extends BaseAbstractHandler
- implements
- Handler {
-
- public static final String AND = "and-";
- public static final String OR = "or-";
-
- public RestrictionConnectiveHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- if (localName.startsWith(RestrictionConnectiveHandler.OR)) {
- return new ConnectiveDescr(RestrictionConnectiveType.OR);
- } else if (localName.startsWith(RestrictionConnectiveHandler.AND)) {
- return new ConnectiveDescr(RestrictionConnectiveType.AND);
- } else {
- throw new SAXParseException("<" + localName + "> should have'",
- parser.getLocator());
- }
-
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- Object op = parser.getParent();
- ConnectiveDescr c = (ConnectiveDescr) parser.getCurrent();
-
- if (op instanceof PatternDescr) {
- StringBuilder sb = new StringBuilder();
- c.buildExpression(sb);
-
- ExprConstraintDescr expr = new ExprConstraintDescr();
- expr.setExpression(sb.toString());
-
- final PatternDescr patternDescr = (PatternDescr) op;
- patternDescr.addConstraint(expr);
- } else {
- ConnectiveDescr p = (ConnectiveDescr) op;
- p.add(c);
- }
- return c;
- }
-
- public Class generateNodeFor() {
- return RestrictionConnectiveDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ReturnValueRestrictionHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ReturnValueRestrictionHandler.java
deleted file mode 100644
index d095be3d3f8..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/ReturnValueRestrictionHandler.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.ConnectiveDescr;
-import org.drools.drl.ast.descr.ReturnValueRestrictionDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class ReturnValueRestrictionHandler extends BaseAbstractHandler
- implements
- Handler {
- public ReturnValueRestrictionHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- String evaluator = attrs.getValue("evaluator");
- emptyAttributeCheck(localName, "evaluator", evaluator, parser);
-
- return evaluator.trim() + " ";
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- final Element element = parser.endElementBuilder();
- final String expression = ((org.w3c.dom.Text) element.getChildNodes().item(0)).getWholeText();
- emptyContentCheck(localName, expression, parser);
-
- ConnectiveDescr c = (ConnectiveDescr) parser.getParent();
- String s = parser.getCurrent() + "(" + expression + ")";
-
- c.add(s);
- return null;
- }
-
- public Class generateNodeFor() {
- return ReturnValueRestrictionDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/RuleHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/RuleHandler.java
deleted file mode 100644
index 8202394acf0..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/RuleHandler.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.AndDescr;
-import org.drools.drl.ast.descr.AttributeDescr;
-import org.drools.drl.ast.descr.PackageDescr;
-import org.drools.drl.ast.descr.RuleDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-public class RuleHandler extends BaseAbstractHandler
- implements
- Handler {
- public RuleHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- final String ruleName = attrs.getValue("name");
- emptyAttributeCheck(localName,
- "name",
- ruleName,
- parser);
-
- return new RuleDescr(ruleName.trim());
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- final Element element = parser.endElementBuilder();
-
- final RuleDescr ruleDescr = (RuleDescr) parser.getCurrent();
-
- final AndDescr lhs = ruleDescr.getLhs();
-
- if (lhs == null) {
- throw new SAXParseException(" requires a LHS",
- parser.getLocator());
- }
-
- NodeList list = element.getElementsByTagName("rhs");
- if (list.getLength() == 0) {
- throw new SAXParseException(" requires a child element",
- parser.getLocator());
- }
-
- ruleDescr.setConsequence(((org.w3c.dom.Text) list.item(0).getChildNodes().item(0)).getWholeText());
-
- NodeList attributes = element.getElementsByTagName("rule-attribute");
- for (int i = 0, length = attributes.getLength(); i < length; i++) {
- final String name = ((Element) attributes.item(i)).getAttribute("name");
- emptyAttributeCheck("rule-attribute",
- "name",
- name,
- parser);
-
- final String value = ((Element) attributes.item(i)).getAttribute("value");
-
- ruleDescr.addAttribute(new AttributeDescr(name,
- value));
- }
-
- ((PackageDescr) parser.getData()).addRule(ruleDescr);
-
- return ruleDescr;
- }
-
- public Class generateNodeFor() {
- return RuleDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/VariableRestrictionsHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/VariableRestrictionsHandler.java
deleted file mode 100644
index adda5ecf8e3..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/compiler/rules/VariableRestrictionsHandler.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.compiler.rules;
-
-import org.drools.drl.ast.descr.ConnectiveDescr;
-import org.drools.drl.ast.descr.VariableRestrictionDescr;
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class VariableRestrictionsHandler extends BaseAbstractHandler
- implements
- Handler {
- public VariableRestrictionsHandler() {
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- String evaluator = attrs.getValue("evaluator");
- String identifier = attrs.getValue("identifier");
-
- emptyAttributeCheck(localName, "evaluator", evaluator, parser);
- emptyAttributeCheck(localName, identifier, "identifier", parser);
-
- return evaluator.trim() + " " + identifier.trim();
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- ConnectiveDescr c = (ConnectiveDescr) parser.getParent();
- String s = (String) parser.getCurrent();
-
- c.add(s);
- return null;
- }
-
- public Class generateNodeFor() {
- return VariableRestrictionDescr.class;
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/core/WrapperSemanticModule.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/core/WrapperSemanticModule.java
deleted file mode 100644
index 2d2ce7d84c6..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/core/WrapperSemanticModule.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.core;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.SemanticModule;
-
-public class WrapperSemanticModule
- implements
- SemanticModule {
- private String uri;
- private SemanticModule module;
-
- public WrapperSemanticModule(String uri,
- SemanticModule module) {
- this.uri = uri;
- this.module = module;
- }
-
- public String getUri() {
- return this.uri;
- }
-
- public void addHandler(String name,
- Handler handler) {
- module.addHandler(name,
- handler);
- }
-
- public Handler getHandler(String name) {
- return module.getHandler(name);
- }
-
- public Handler getHandlerByClass(Class> clazz) {
- return module.getHandlerByClass(clazz);
- }
-
- public SemanticModule getModule() {
- return module;
- }
-
- public void setModule(SemanticModule module) {
- this.module = module;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/AbstractNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/AbstractNodeHandler.java
deleted file mode 100755
index 9590b422523..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/AbstractNodeHandler.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.compiler.XmlDumper;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.process.core.timer.Timer;
-import org.jbpm.workflow.core.DroolsAction;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.NodeContainer;
-import org.jbpm.workflow.core.impl.DroolsConsequenceAction;
-import org.jbpm.workflow.core.impl.ExtendedNodeImpl;
-import org.jbpm.workflow.core.impl.NodeImpl;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-public abstract class AbstractNodeHandler extends BaseAbstractHandler implements Handler {
-
- protected static final String EOL = System.getProperty("line.separator");
-
- public AbstractNodeHandler() {
- initValidParents();
- initValidPeers();
- this.allowNesting = false;
- }
-
- protected void initValidParents() {
- this.validParents = new HashSet>();
- this.validParents.add(NodeContainer.class);
- }
-
- protected void initValidPeers() {
- this.validPeers = new HashSet>();
- this.validPeers.add(null);
- this.validPeers.add(Node.class);
- }
-
- public Object start(final String uri, final String localName, final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- NodeContainer nodeContainer = (NodeContainer) parser.getParent();
-
- final Node node = createNode();
-
- final String id = attrs.getValue("id");
- node.setId(Long.valueOf(id));
-
- final String name = attrs.getValue("name");
- node.setName(name);
-
- nodeContainer.addNode(node);
-
- return node;
- }
-
- protected abstract Node createNode();
-
- public Object end(final String uri, final String localName,
- final Parser parser) throws SAXException {
- final Element element = parser.endElementBuilder();
- Node node = (Node) parser.getCurrent();
- handleNode(node, element, uri, localName, parser);
- return node;
- }
-
- protected void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser) throws SAXException {
- final String x = element.getAttribute("x");
- if (x != null && x.length() != 0) {
- try {
- node.setMetaData("x", Integer.valueOf(x));
- } catch (NumberFormatException exc) {
- throw new SAXParseException("<" + localName + "> requires an Integer 'x' attribute", parser.getLocator());
- }
- }
- final String y = element.getAttribute("y");
- if (y != null && y.length() != 0) {
- try {
- node.setMetaData("y", Integer.valueOf(y));
- } catch (NumberFormatException exc) {
- throw new SAXParseException("<" + localName + "> requires an Integer 'y' attribute", parser.getLocator());
- }
- }
- final String width = element.getAttribute("width");
- if (width != null && width.length() != 0) {
- try {
- node.setMetaData("width", Integer.valueOf(width));
- } catch (NumberFormatException exc) {
- throw new SAXParseException("<" + localName + "> requires an Integer 'width' attribute", parser.getLocator());
- }
- }
- final String height = element.getAttribute("height");
- if (height != null && height.length() != 0) {
- try {
- node.setMetaData("height", Integer.valueOf(height));
- } catch (NumberFormatException exc) {
- throw new SAXParseException("<" + localName + "> requires an Integer 'height' attribute", parser.getLocator());
- }
- }
- final String color = element.getAttribute("color");
- if (color != null && color.length() != 0) {
- try {
- node.setMetaData("color", Integer.valueOf(color));
- } catch (NumberFormatException exc) {
- throw new SAXParseException("<" + localName + "> requires an Integer 'color' attribute", parser.getLocator());
- }
- }
- }
-
- protected void handleAction(final ExtendedNodeImpl node, final Element element, String type) {
- NodeList nodeList = element.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++) {
- org.w3c.dom.Node xmlNode = nodeList.item(i);
- String nodeName = xmlNode.getNodeName();
- if (nodeName.equals(type)) {
- List actions = new ArrayList<>();
- NodeList subNodeList = xmlNode.getChildNodes();
- for (int j = 0; j < subNodeList.getLength(); j++) {
- Element subXmlNode = (Element) subNodeList.item(j);
- DroolsAction action = extractAction(subXmlNode);
- actions.add(action);
- }
- node.setActions(type, actions);
- return;
- }
- }
- }
-
- public static DroolsAction extractAction(Element xmlNode) {
- String actionType = xmlNode.getAttribute("type");
- if ("expression".equals(actionType)) {
- String consequence = xmlNode.getTextContent();
- return new DroolsConsequenceAction(xmlNode.getAttribute("dialect"), consequence);
- } else {
- throw new IllegalArgumentException(
- "Unknown action type " + actionType);
- }
- }
-
- public abstract void writeNode(final Node node, final StringBuilder xmlDump, final boolean includeMeta);
-
- protected void writeNode(final String name, final Node node, final StringBuilder xmlDump, final boolean includeMeta) {
- xmlDump.append(" <" + name + " id=\"" + node.getId() + "\" ");
- if (node.getName() != null) {
- xmlDump.append("name=\"" + XmlDumper.replaceIllegalChars(node.getName()) + "\" ");
- }
- if (includeMeta) {
- Integer x = (Integer) node.getMetaData().get("x");
- Integer y = (Integer) node.getMetaData().get("y");
- Integer width = (Integer) node.getMetaData().get("width");
- Integer height = (Integer) node.getMetaData().get("height");
- Integer color = (Integer) node.getMetaData().get("color");
- if (x != null && x != 0) {
- xmlDump.append("x=\"" + x + "\" ");
- }
- if (y != null && y != 0) {
- xmlDump.append("y=\"" + y + "\" ");
- }
- if (width != null && width != -1) {
- xmlDump.append("width=\"" + width + "\" ");
- }
- if (height != null && height != -1) {
- xmlDump.append("height=\"" + height + "\" ");
- }
- if (color != null && color != 0) {
- xmlDump.append("color=\"" + color + "\" ");
- }
- }
- }
-
- protected boolean containsMetaData(final Node node) {
- for (Map.Entry entry : ((NodeImpl) node).getMetaData().entrySet()) {
- String name = entry.getKey();
- if (!"x".equals(name)
- && !"y".equals(name)
- && !"width".equals(name)
- && !"height".equals(name)
- && !"color".equals(name)
- && !"UniqueId".equals(name)
- && entry.getValue() instanceof String) {
- return true;
- }
- }
- return false;
- }
-
- protected void writeMetaData(final Node node, final StringBuilder xmlDump) {
- for (Map.Entry entry : ((NodeImpl) node).getMetaData().entrySet()) {
- String name = entry.getKey();
- if (!"x".equals(name)
- && !"y".equals(name)
- && !"width".equals(name)
- && !"height".equals(name)
- && !"color".equals(name)
- && entry.getValue() instanceof String) {
- xmlDump.append(" " + EOL);
- xmlDump.append(" " + entry.getValue() + "" + EOL);
- xmlDump.append(" " + EOL);
- }
- }
- }
-
- protected void writeActions(final String type, List actions, final StringBuilder xmlDump) {
- if (actions != null && !actions.isEmpty()) {
- xmlDump.append(" <" + type + ">" + EOL);
- for (DroolsAction action : actions) {
- writeAction(action, xmlDump);
- }
- xmlDump.append(" " + type + ">" + EOL);
- }
- }
-
- public static void writeAction(final DroolsAction action, final StringBuilder xmlDump) {
- if (action instanceof DroolsConsequenceAction) {
- DroolsConsequenceAction consequenceAction = (DroolsConsequenceAction) action;
- xmlDump.append(" " + EOL);
- } else {
- xmlDump.append(">" + XmlDumper.replaceIllegalChars(consequence.trim()) + "" + EOL);
- }
- } else {
- throw new IllegalArgumentException(
- "Unknown action " + action);
- }
- }
-
- public void writeTimers(final Map timers, final StringBuilder xmlDump) {
- if (timers != null && !timers.isEmpty()) {
- xmlDump.append(" " + EOL);
- List timerList = new ArrayList<>(timers.keySet());
- Collections.sort(timerList, Comparator.comparing(Timer::getId));
- for (Timer timer : timerList) {
- xmlDump.append(" " + EOL);
- writeAction(timers.get(timer), xmlDump);
- xmlDump.append(" " + EOL);
- }
- xmlDump.append(" " + EOL);
- }
- }
-
- protected void endNode(final StringBuilder xmlDump) {
- xmlDump.append("/>" + EOL);
- }
-
- protected void endNode(final String name, final StringBuilder xmlDump) {
- xmlDump.append(" " + name + ">" + EOL);
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ActionNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ActionNodeHandler.java
deleted file mode 100755
index 9831442f8c5..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ActionNodeHandler.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.workflow.core.DroolsAction;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.impl.DroolsConsequenceAction;
-import org.jbpm.workflow.core.node.ActionNode;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-public class ActionNodeHandler extends AbstractNodeHandler {
-
- protected Node createNode() {
- return new ActionNode();
- }
-
- @Override
- public void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser)
- throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- ActionNode actionNode = (ActionNode) node;
- org.w3c.dom.Node xmlNode = element.getFirstChild();
- if (xmlNode instanceof Element) {
- Element actionXml = (Element) xmlNode;
- DroolsAction action = extractAction(actionXml);
- actionNode.setAction(action);
- }
- }
-
- @SuppressWarnings("unchecked")
- public Class generateNodeFor() {
- return ActionNode.class;
- }
-
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- ActionNode actionNode = (ActionNode) node;
- writeNode("actionNode", actionNode, xmlDump, includeMeta);
- DroolsConsequenceAction action = (DroolsConsequenceAction) actionNode.getAction();
- if (action != null || (includeMeta && containsMetaData(actionNode))) {
- xmlDump.append(">" + EOL);
- if (action != null) {
- writeAction(action, xmlDump);
- }
- if (includeMeta) {
- writeMetaData(actionNode, xmlDump);
- }
- endNode("actionNode", xmlDump);
- } else {
- endNode(xmlDump);
- }
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/CompositeNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/CompositeNodeHandler.java
deleted file mode 100755
index adc9eb0912b..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/CompositeNodeHandler.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.jbpm.compiler.xml.XmlRuleFlowProcessDumper;
-import org.jbpm.compiler.xml.XmlWorkflowProcessDumper;
-import org.jbpm.process.core.context.exception.ExceptionScope;
-import org.jbpm.process.core.context.variable.Variable;
-import org.jbpm.process.core.context.variable.VariableScope;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.node.CompositeContextNode;
-import org.jbpm.workflow.core.node.CompositeNode;
-import org.kie.api.definition.process.Connection;
-
-public class CompositeNodeHandler extends AbstractNodeHandler {
-
- protected Node createNode() {
- CompositeContextNode result = new CompositeContextNode();
- VariableScope variableScope = new VariableScope();
- result.addContext(variableScope);
- result.setDefaultContext(variableScope);
- return result;
- }
-
- public Class> generateNodeFor() {
- return CompositeNode.class;
- }
-
- @Override
- public boolean allowNesting() {
- return true;
- }
-
- protected String getNodeName() {
- return "composite";
- }
-
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- super.writeNode(getNodeName(), node, xmlDump, includeMeta);
- CompositeNode compositeNode = (CompositeNode) node;
- writeAttributes(compositeNode, xmlDump, includeMeta);
- xmlDump.append(">" + EOL);
- if (includeMeta) {
- writeMetaData(compositeNode, xmlDump);
- }
- for (String eventType : compositeNode.getActionTypes()) {
- writeActions(eventType, compositeNode.getActions(eventType), xmlDump);
- }
- writeTimers(compositeNode.getTimers(), xmlDump);
- if (compositeNode instanceof CompositeContextNode) {
- VariableScope variableScope = (VariableScope) ((CompositeContextNode) compositeNode).getDefaultContext(VariableScope.VARIABLE_SCOPE);
- if (variableScope != null) {
- List variables = variableScope.getVariables();
- XmlWorkflowProcessDumper.visitVariables(variables, xmlDump);
- }
- ExceptionScope exceptionScope = (ExceptionScope) ((CompositeContextNode) compositeNode).getDefaultContext(ExceptionScope.EXCEPTION_SCOPE);
- if (exceptionScope != null) {
- XmlWorkflowProcessDumper.visitExceptionHandlers(
- exceptionScope.getExceptionHandlers(), xmlDump);
- }
- }
- List subNodes = getSubNodes(compositeNode);
- xmlDump.append(" " + EOL);
- for (Node subNode : subNodes) {
- XmlRuleFlowProcessDumper.INSTANCE.visitNode(subNode, xmlDump, includeMeta);
- }
- xmlDump.append(" " + EOL);
- List connections = getSubConnections(compositeNode);
- xmlDump.append(" " + EOL);
- for (Connection connection : connections) {
- XmlRuleFlowProcessDumper.INSTANCE.visitConnection(connection, xmlDump, includeMeta);
- }
- xmlDump.append(" " + EOL);
- Map inPorts = getInPorts(compositeNode);
- xmlDump.append(" " + EOL);
- for (Map.Entry entry : inPorts.entrySet()) {
- xmlDump.append(" " + EOL);
- }
- xmlDump.append(" " + EOL);
- Map outPorts = getOutPorts(compositeNode);
- xmlDump.append(" " + EOL);
- for (Map.Entry entry : outPorts.entrySet()) {
- xmlDump.append(" " + EOL);
- }
- xmlDump.append(" " + EOL);
- endNode(getNodeName(), xmlDump);
- }
-
- protected void writeAttributes(CompositeNode compositeNode, StringBuilder xmlDump, boolean includeMeta) {
- }
-
- protected List getSubNodes(CompositeNode compositeNode) {
- List subNodes =
- new ArrayList<>();
- for (org.kie.api.definition.process.Node subNode : compositeNode.getNodes()) {
- // filter out composite start and end nodes as they can be regenerated
- if ((!(subNode instanceof CompositeNode.CompositeNodeStart)) &&
- (!(subNode instanceof CompositeNode.CompositeNodeEnd))) {
- subNodes.add((Node) subNode);
- }
- }
- return subNodes;
- }
-
- protected List getSubConnections(CompositeNode compositeNode) {
- List connections = new ArrayList<>();
- for (org.kie.api.definition.process.Node subNode : compositeNode.getNodes()) {
- // filter out composite start and end nodes as they can be regenerated
- if (!(subNode instanceof CompositeNode.CompositeNodeEnd)) {
- for (Connection connection : subNode.getIncomingConnections(Node.CONNECTION_DEFAULT_TYPE)) {
- if (!(connection.getFrom() instanceof CompositeNode.CompositeNodeStart)) {
- connections.add(connection);
- }
- }
- }
- }
- return connections;
- }
-
- protected Map getInPorts(CompositeNode compositeNode) {
- return compositeNode.getLinkedIncomingNodes();
- }
-
- protected Map getOutPorts(CompositeNode compositeNode) {
- return compositeNode.getLinkedOutgoingNodes();
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ConnectionHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ConnectionHandler.java
deleted file mode 100755
index 12837c8b2fd..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ConnectionHandler.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.workflow.core.Connection;
-import org.jbpm.workflow.core.NodeContainer;
-import org.jbpm.workflow.core.impl.ConnectionImpl;
-import org.kie.api.definition.process.Node;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-public class ConnectionHandler extends BaseAbstractHandler implements Handler {
- public ConnectionHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet();
- this.validParents.add(NodeContainer.class);
-
- this.validPeers = new HashSet();
- this.validPeers.add(null);
- this.validPeers.add(Connection.class);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName, attrs);
- String fromId = attrs.getValue("from");
- emptyAttributeCheck(localName, "from", fromId, parser);
- String toId = attrs.getValue("to");
- emptyAttributeCheck(localName, "to", toId, parser);
- String bendpoints = attrs.getValue("bendpoints");
-
- String fromType = attrs.getValue("fromType");
- if (fromType == null || fromType.trim().length() == 0) {
- fromType = org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE;
- }
- String toType = attrs.getValue("toType");
- if (toType == null || toType.trim().length() == 0) {
- toType = org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE;
- }
-
- NodeContainer nodeContainer = (NodeContainer) parser.getParent();
- Node fromNode = nodeContainer.getNode(new Long(fromId));
- Node toNode = nodeContainer.getNode(new Long(toId));
-
- if (fromNode == null) {
- throw new SAXParseException("Node '" + fromId + "'cannot be found",
- parser.getLocator());
- }
- if (toNode == null) {
- throw new SAXParseException("Node '" + toId + "' cannot be found",
- parser.getLocator());
- }
-
- ConnectionImpl connection = new ConnectionImpl(fromNode, fromType, toNode, toType);
- connection.setMetaData("bendpoints", bendpoints);
-
- return connection;
- }
-
- public Object end(final String uri, final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- return parser.getCurrent();
- }
-
- public Class generateNodeFor() {
- return Connection.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ConstraintHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ConstraintHandler.java
deleted file mode 100755
index e537e92d881..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ConstraintHandler.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.workflow.core.Constraint;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.impl.ConnectionRef;
-import org.jbpm.workflow.core.impl.ConstraintImpl;
-import org.jbpm.workflow.core.node.Constrainable;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class ConstraintHandler extends BaseAbstractHandler implements Handler {
-
- public ConstraintHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet>();
- this.validParents.add(Constrainable.class);
-
- this.validPeers = new HashSet>();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- return null;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- final Element element = parser.endElementBuilder();
-
- Constrainable parent = (Constrainable) parser.getParent();
- Constraint constraint = new ConstraintImpl();
-
- final String toNodeIdString = element.getAttribute("toNodeId");
- String toType = element.getAttribute("toType");
- ConnectionRef connectionRef = null;
- if (toNodeIdString != null && toNodeIdString.trim().length() > 0) {
- int toNodeId = new Integer(toNodeIdString);
- if (toType == null || toType.trim().length() == 0) {
- toType = Node.CONNECTION_DEFAULT_TYPE;
- }
- connectionRef = new ConnectionRef(toNodeId, toType);
- }
-
- final String name = element.getAttribute("name");
- constraint.setName(name);
- final String priority = element.getAttribute("priority");
- if (priority != null && priority.length() != 0) {
- constraint.setPriority(new Integer(priority));
- }
-
- final String type = element.getAttribute("type");
- constraint.setType(type);
- final String dialect = element.getAttribute("dialect");
- constraint.setDialect(dialect);
-
- String text = ((Text) element.getChildNodes().item(0)).getWholeText();
- if (text != null) {
- text = text.trim();
- if ("".equals(text)) {
- text = null;
- }
- }
- constraint.setConstraint(text);
- parent.addConstraint(connectionRef, constraint);
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public Class generateNodeFor() {
- return Constraint.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/DynamicNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/DynamicNodeHandler.java
index 7c53f84a0c0..22a31663b12 100755
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/DynamicNodeHandler.java
+++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/DynamicNodeHandler.java
@@ -18,46 +18,8 @@
*/
package org.jbpm.compiler.xml.processes;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.node.DynamicNode;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-import static org.jbpm.ruleflow.core.Metadata.COMPLETION_CONDITION;
-
-public class DynamicNodeHandler extends CompositeNodeHandler {
+public class DynamicNodeHandler {
public static final String AUTOCOMPLETE_COMPLETION_CONDITION = "autocomplete";
- @Override
- protected Node createNode() {
- return new DynamicNode();
- }
-
- @Override
- public Class> generateNodeFor() {
- return DynamicNode.class;
- }
-
- @Override
- protected String getNodeName() {
- return "dynamic";
- }
-
- @Override
- protected void handleNode(Node node, Element element, String uri, String localName, Parser parser) throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- DynamicNode dynamicNode = (DynamicNode) node;
- for (int i = 0; i < element.getChildNodes().getLength(); i++) {
- org.w3c.dom.Node n = element.getChildNodes().item(i);
- if (COMPLETION_CONDITION.equals(n.getNodeName())) {
- if (AUTOCOMPLETE_COMPLETION_CONDITION.equals(n.getTextContent())) {
- dynamicNode.setAutoComplete(true);
- } else {
- dynamicNode.setCompletionCondition(n.getTextContent());
- }
- }
- }
- }
}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/EndNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/EndNodeHandler.java
deleted file mode 100755
index 307d36fa15b..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/EndNodeHandler.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.node.EndNode;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-public class EndNodeHandler extends AbstractNodeHandler {
-
- protected Node createNode() {
- return new EndNode();
- }
-
- @Override
- public void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser)
- throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- EndNode endNode = (EndNode) node;
- String terminate = element.getAttribute("terminate");
- if (terminate != null && "false".equals(terminate)) {
- endNode.setTerminate(false);
- }
- }
-
- public Class generateNodeFor() {
- return EndNode.class;
- }
-
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- EndNode endNode = (EndNode) node;
- writeNode("end", endNode, xmlDump, includeMeta);
- boolean terminate = endNode.isTerminate();
- if (!terminate) {
- xmlDump.append("terminate=\"false\" ");
- }
- if (includeMeta && containsMetaData(endNode)) {
- xmlDump.append(">" + EOL);
- writeMetaData(endNode, xmlDump);
- endNode("end", xmlDump);
- } else {
- endNode(xmlDump);
- }
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/EventFilterHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/EventFilterHandler.java
deleted file mode 100755
index 9d190a5346f..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/EventFilterHandler.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.process.core.event.EventFilter;
-import org.jbpm.process.core.event.EventTypeFilter;
-import org.jbpm.workflow.core.node.EventNode;
-import org.jbpm.workflow.core.node.EventTrigger;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class EventFilterHandler extends BaseAbstractHandler implements Handler {
-
- public EventFilterHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet>();
- this.validParents.add(EventNode.class);
- this.validParents.add(EventTrigger.class);
-
- this.validPeers = new HashSet>();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- return null;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- final Element element = parser.endElementBuilder();
- Object parent = parser.getParent();
- final String type = element.getAttribute("type");
- emptyAttributeCheck(localName, "type", type, parser);
- if ("eventType".equals(type)) {
- final String eventType = element.getAttribute("eventType");
- emptyAttributeCheck(localName, "eventType", eventType, parser);
- EventTypeFilter eventTypeFilter = new EventTypeFilter();
- eventTypeFilter.setType(eventType);
- if (parent instanceof EventNode) {
- ((EventNode) parent).addEventFilter(eventTypeFilter);
- } else if (parent instanceof EventTrigger) {
- ((EventTrigger) parent).addEventFilter(eventTypeFilter);
- }
- } else {
- throw new IllegalArgumentException(
- "Unknown event filter type: " + type);
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public Class generateNodeFor() {
- return EventFilter.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/EventNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/EventNodeHandler.java
deleted file mode 100755
index d903c1b6802..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/EventNodeHandler.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.process.core.event.EventFilter;
-import org.jbpm.process.core.event.EventTypeFilter;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.node.EventNode;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-public class EventNodeHandler extends AbstractNodeHandler {
-
- protected Node createNode() {
- return new EventNode();
- }
-
- @SuppressWarnings("unchecked")
- public Class generateNodeFor() {
- return EventNode.class;
- }
-
- @Override
- public void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser)
- throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- EventNode eventNode = (EventNode) node;
- String variableName = element.getAttribute("variableName");
- if (variableName != null && variableName.length() != 0) {
- eventNode.setVariableName(variableName);
- eventNode.setInputVariableName(variableName);
- }
- String scope = element.getAttribute("scope");
- if (scope != null && scope.length() != 0) {
- eventNode.setScope(scope);
- }
-
- eventNode.getIoSpecification().addOutputMapping(variableName, variableName);
-
- }
-
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- EventNode eventNode = (EventNode) node;
- writeNode("eventNode", eventNode, xmlDump, includeMeta);
- String variableName = eventNode.getVariableName();
- if (variableName != null && variableName.length() != 0) {
- xmlDump.append("variableName=\"" + variableName + "\" ");
- }
- String scope = eventNode.getScope();
- if (scope != null && scope.length() != 0) {
- xmlDump.append("scope=\"" + scope + "\" ");
- }
- xmlDump.append(">" + EOL);
- if (includeMeta) {
- writeMetaData(eventNode, xmlDump);
- }
- xmlDump.append(" " + EOL);
- for (EventFilter filter : eventNode.getEventFilters()) {
- if (filter instanceof EventTypeFilter) {
- xmlDump.append(" " + EOL);
- } else {
- throw new IllegalArgumentException(
- "Unknown filter type: " + filter);
- }
- }
- xmlDump.append(" " + EOL);
- endNode("eventNode", xmlDump);
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ExceptionHandlerHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ExceptionHandlerHandler.java
deleted file mode 100755
index 81eab316d13..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ExceptionHandlerHandler.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.process.core.ContextContainer;
-import org.jbpm.process.core.context.exception.ActionExceptionHandler;
-import org.jbpm.process.core.context.exception.ExceptionScope;
-import org.jbpm.workflow.core.DroolsAction;
-import org.kie.api.definition.process.Process;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-public class ExceptionHandlerHandler extends BaseAbstractHandler implements Handler {
-
- public ExceptionHandlerHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet>();
- this.validParents.add(Process.class);
-
- this.validPeers = new HashSet>();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri, final String localName,
- final Attributes attrs, final Parser parser)
- throws SAXException {
- parser.startElementBuilder(localName, attrs);
- return null;
- }
-
- public Object end(final String uri, final String localName,
- final Parser parser) throws SAXException {
- final Element element = parser.endElementBuilder();
- ContextContainer contextContainer = (ContextContainer) parser.getParent();
-
- final String type = element.getAttribute("type");
- emptyAttributeCheck(localName, "type", type, parser);
-
- final String faultName = element.getAttribute("faultName");
- emptyAttributeCheck(localName, "faultName", type, parser);
-
- final String faultVariable = element.getAttribute("faultVariable");
-
- ActionExceptionHandler exceptionHandler = null;
- if ("action".equals(type)) {
- exceptionHandler = new ActionExceptionHandler();
- org.w3c.dom.Node xmlNode = element.getFirstChild();
- if (xmlNode instanceof Element) {
- Element actionXml = (Element) xmlNode;
-
- DroolsAction action = ActionNodeHandler.extractAction(actionXml);
- (exceptionHandler).setAction(action);
-
- }
- } else {
- throw new SAXParseException("Unknown exception handler type " + type, parser.getLocator());
- }
-
- if (faultVariable != null && faultVariable.length() > 0) {
- exceptionHandler.setFaultVariable(faultVariable);
- }
-
- ExceptionScope exceptionScope = (ExceptionScope) contextContainer.getDefaultContext(ExceptionScope.EXCEPTION_SCOPE);
- if (exceptionScope == null) {
- exceptionScope = new ExceptionScope();
- contextContainer.addContext(exceptionScope);
- contextContainer.setDefaultContext(exceptionScope);
- }
-
- exceptionScope.setExceptionHandler(faultName, exceptionHandler);
-
- return null;
- }
-
- public Class> generateNodeFor() {
- return null;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/FaultNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/FaultNodeHandler.java
deleted file mode 100755
index 1c3dd7c16e7..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/FaultNodeHandler.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.node.FaultNode;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-public class FaultNodeHandler extends AbstractNodeHandler {
-
- protected Node createNode() {
- return new FaultNode();
- }
-
- @Override
- public void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser)
- throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- FaultNode faultNode = (FaultNode) node;
- String faultName = element.getAttribute("faultName");
- if (faultName != null && faultName.length() != 0) {
- faultNode.setFaultName(faultName);
- }
- String faultVariable = element.getAttribute("faultVariable");
- if (faultVariable != null && !"".equals(faultVariable)) {
- faultNode.setFaultVariable(faultVariable);
- }
- }
-
- public Class generateNodeFor() {
- return FaultNode.class;
- }
-
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- FaultNode faultNode = (FaultNode) node;
- writeNode("fault", faultNode, xmlDump, includeMeta);
- String faultName = faultNode.getFaultName();
- if (faultName != null && faultName.length() != 0) {
- xmlDump.append("faultName=\"" + faultName + "\" ");
- }
- String faultVariable = faultNode.getFaultVariable();
- if (faultVariable != null && faultVariable.length() != 0) {
- xmlDump.append("faultVariable=\"" + faultVariable + "\" ");
- }
- if (includeMeta && containsMetaData(faultNode)) {
- xmlDump.append(">" + EOL);
- writeMetaData(faultNode, xmlDump);
- endNode("fault", xmlDump);
- } else {
- endNode(xmlDump);
- }
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ForEachNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ForEachNodeHandler.java
deleted file mode 100755
index 70df5c903da..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ForEachNodeHandler.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.List;
-import java.util.Map;
-
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.compiler.XmlDumper;
-import org.jbpm.process.core.datatype.DataTypeResolver;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.impl.DataDefinition;
-import org.jbpm.workflow.core.node.CompositeNode;
-import org.jbpm.workflow.core.node.ForEachNode;
-import org.kie.api.definition.process.Connection;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-import static java.lang.Thread.currentThread;
-
-public class ForEachNodeHandler extends CompositeNodeHandler {
-
- @Override
- protected Node createNode() {
- return new ForEachNode();
- }
-
- @Override
- public Class generateNodeFor() {
- return ForEachNode.class;
- }
-
- @Override
- protected String getNodeName() {
- return "forEach";
- }
-
- @Override
- protected void writeAttributes(CompositeNode compositeNode, StringBuilder xmlDump, boolean includeMeta) {
- ForEachNode forEachNode = (ForEachNode) compositeNode;
- String variableName = forEachNode.getVariableName();
- if (variableName != null) {
- xmlDump.append("variableName=\"" + variableName + "\" ");
- }
- String collectionExpression = forEachNode.getCollectionExpression();
- if (collectionExpression != null) {
- xmlDump.append("collectionExpression=\"" + XmlDumper.replaceIllegalChars(collectionExpression) + "\" ");
- }
- boolean waitForCompletion = forEachNode.isWaitForCompletion();
- if (!waitForCompletion) {
- xmlDump.append("waitForCompletion=\"false\" ");
- }
- }
-
- @Override
- protected List getSubNodes(CompositeNode compositeNode) {
- return super.getSubNodes(((ForEachNode) compositeNode).getCompositeNode());
- }
-
- @Override
- protected List getSubConnections(CompositeNode compositeNode) {
- return super.getSubConnections(((ForEachNode) compositeNode).getCompositeNode());
- }
-
- @Override
- protected Map getInPorts(CompositeNode compositeNode) {
- return ((ForEachNode) compositeNode).getCompositeNode().getLinkedIncomingNodes();
- }
-
- @Override
- protected Map getOutPorts(CompositeNode compositeNode) {
- return ((ForEachNode) compositeNode).getCompositeNode().getLinkedOutgoingNodes();
- }
-
- @Override
- protected void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser) throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- ForEachNode forEachNode = (ForEachNode) node;
- final String variableName = element.getAttribute("variableName");
- if (variableName != null && variableName.length() != 0) {
- forEachNode.setInputRef(variableName);
- forEachNode.addContextVariable(variableName, variableName, DataTypeResolver.fromType("java.lang.Object", currentThread().getContextClassLoader()));
- }
- final String collectionExpression = element.getAttribute("collectionExpression");
- if (collectionExpression != null && collectionExpression.length() != 0) {
- forEachNode.setCollectionExpression(collectionExpression);
- forEachNode.getMultiInstanceSpecification().setLoopDataInputRef(DataDefinition.toExpression(collectionExpression));
- }
- final String waitForCompletion = element.getAttribute("waitForCompletion");
- if ("false".equals(waitForCompletion)) {
- forEachNode.setWaitForCompletion(false);
- }
- final String isSequential = element.getAttribute("isSequential");
- if ("false".equals(isSequential)) {
- forEachNode.setSequential(false);
- } else {
- forEachNode.setSequential(true);
- }
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/FunctionImportHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/FunctionImportHandler.java
deleted file mode 100755
index 0107e188d51..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/FunctionImportHandler.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.process.core.Process;
-import org.jbpm.workflow.core.impl.WorkflowProcessImpl;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class FunctionImportHandler extends BaseAbstractHandler
- implements
- Handler {
- public FunctionImportHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet();
- this.validParents.add(Process.class);
-
- this.validPeers = new HashSet();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- WorkflowProcessImpl process = (WorkflowProcessImpl) parser.getParent();
-
- final String name = attrs.getValue("name");
- emptyAttributeCheck(localName, "name", name, parser);
-
- java.util.List list = process.getFunctionImports();
- if (list == null) {
- list = new ArrayList<>();
- process.setFunctionImports(list);
- }
- list.add(name);
-
- return null;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- return null;
- }
-
- public Class generateNodeFor() {
- return null;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/GlobalHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/GlobalHandler.java
deleted file mode 100755
index 866b0935003..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/GlobalHandler.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.workflow.core.impl.WorkflowProcessImpl;
-import org.kie.api.definition.process.Process;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class GlobalHandler extends BaseAbstractHandler
- implements
- Handler {
- public GlobalHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet();
- this.validParents.add(Process.class);
- this.validPeers = new HashSet();
- this.validPeers.add(null);
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- WorkflowProcessImpl process = (WorkflowProcessImpl) parser.getParent();
-
- final String identifier = attrs.getValue("identifier");
- final String type = attrs.getValue("type");
-
- emptyAttributeCheck(localName, "identifier", identifier, parser);
- emptyAttributeCheck(localName, "type", type, parser);
-
- Map map = process.getGlobals();
- if (map == null) {
- map = new HashMap<>();
- process.setGlobals(map);
- }
- map.put(identifier, type);
-
- return null;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- return null;
- }
-
- public Class generateNodeFor() {
- return null;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/HumanTaskNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/HumanTaskNodeHandler.java
deleted file mode 100755
index 5659820c2ca..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/HumanTaskNodeHandler.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.process.core.Work;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.node.HumanTaskNode;
-import org.jbpm.workflow.core.node.WorkItemNode;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-public class HumanTaskNodeHandler extends WorkItemNodeHandler {
-
- @Override
- public void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser)
- throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- HumanTaskNode humanTaskNode = (HumanTaskNode) node;
- final String swimlane = element.getAttribute("swimlane");
- if (swimlane != null && !"".equals(swimlane)) {
- humanTaskNode.setSwimlane(swimlane);
- }
- }
-
- @Override
- protected Node createNode() {
- return new HumanTaskNode();
- }
-
- @Override
- public Class> generateNodeFor() {
- return HumanTaskNode.class;
- }
-
- @Override
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- WorkItemNode workItemNode = (WorkItemNode) node;
- writeNode("humanTask", workItemNode, xmlDump, includeMeta);
- visitParameters(workItemNode, xmlDump);
- xmlDump.append(">" + EOL);
- if (includeMeta) {
- writeMetaData(workItemNode, xmlDump);
- }
- Work work = workItemNode.getWork();
- visitWork(work, xmlDump, includeMeta);
- visitInMappings(workItemNode.getInMappings(), xmlDump);
- visitOutMappings(workItemNode.getOutMappings(), xmlDump);
- for (String eventType : workItemNode.getActionTypes()) {
- writeActions(eventType, workItemNode.getActions(eventType), xmlDump);
- }
- writeTimers(workItemNode.getTimers(), xmlDump);
- endNode("humanTask", xmlDump);
- }
-
- @Override
- protected void visitParameters(WorkItemNode workItemNode, StringBuilder xmlDump) {
- super.visitParameters(workItemNode, xmlDump);
- HumanTaskNode humanTaskNode = (HumanTaskNode) workItemNode;
- String swimlane = humanTaskNode.getSwimlane();
- if (swimlane != null) {
- xmlDump.append("swimlane=\"" + swimlane + "\" ");
- }
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ImportHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ImportHandler.java
deleted file mode 100755
index 89e4dd93260..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ImportHandler.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.workflow.core.impl.WorkflowProcessImpl;
-import org.kie.api.definition.process.Process;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class ImportHandler extends BaseAbstractHandler
- implements
- Handler {
- public ImportHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet();
- this.validParents.add(Process.class);
-
- this.validPeers = new HashSet();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- WorkflowProcessImpl process = (WorkflowProcessImpl) parser.getParent();
-
- final String name = attrs.getValue("name");
- emptyAttributeCheck(localName, "name", name, parser);
-
- java.util.Set list = process.getImports();
- if (list == null) {
- list = new HashSet<>();
- process.setImports(list);
- }
- list.add(name);
-
- return null;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- return null;
- }
-
- public Class generateNodeFor() {
- return null;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/InPortHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/InPortHandler.java
deleted file mode 100755
index 16e6d0a30dd..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/InPortHandler.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.workflow.core.node.CompositeNode;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class InPortHandler extends BaseAbstractHandler
- implements
- Handler {
- public InPortHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet();
- this.validParents.add(CompositeNode.class);
-
- this.validPeers = new HashSet();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- CompositeNode compositeNode = (CompositeNode) parser.getParent();
- final String type = attrs.getValue("type");
- emptyAttributeCheck(localName, "type", type, parser);
- final String nodeId = attrs.getValue("nodeId");
- emptyAttributeCheck(localName, "nodeId", nodeId, parser);
- final String nodeInType = attrs.getValue("nodeInType");
- emptyAttributeCheck(localName, "nodeInType", nodeInType, parser);
- compositeNode.linkIncomingConnections(type, new Long(nodeId), nodeInType);
- return null;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- return null;
- }
-
- public Class generateNodeFor() {
- return null;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/JoinNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/JoinNodeHandler.java
deleted file mode 100755
index 43d62673a72..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/JoinNodeHandler.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.node.Join;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-public class JoinNodeHandler extends AbstractNodeHandler {
-
- protected Node createNode() {
- return new Join();
- }
-
- @Override
- public void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser)
- throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- Join joinNode = (Join) node;
- String type = element.getAttribute("type");
- if (type != null && type.length() != 0) {
- joinNode.setType(new Integer(type));
- }
- String n = element.getAttribute("n");
- if (n != null && n.length() != 0) {
- joinNode.setN(n);
- }
- }
-
- public Class generateNodeFor() {
- return Join.class;
- }
-
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- Join joinNode = (Join) node;
- writeNode("join", joinNode, xmlDump, includeMeta);
- int type = joinNode.getType();
- if (type != 0) {
- xmlDump.append("type=\"" + type + "\" ");
- }
- if (type == Join.TYPE_N_OF_M) {
- String n = joinNode.getN();
- if (n != null && n.length() != 0) {
- xmlDump.append("n=\"" + n + "\" ");
- }
- }
- if (includeMeta && containsMetaData(joinNode)) {
- xmlDump.append(">" + EOL);
- writeMetaData(joinNode, xmlDump);
- endNode("join", xmlDump);
- } else {
- endNode(xmlDump);
- }
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/MappingHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/MappingHandler.java
deleted file mode 100755
index 8d04bc02cef..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/MappingHandler.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.process.core.context.variable.Mappable;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-public class MappingHandler extends BaseAbstractHandler
- implements
- Handler {
- public MappingHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet();
- this.validParents.add(Mappable.class);
-
- this.validPeers = new HashSet();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- Mappable mappable = (Mappable) parser.getParent();
- final String type = attrs.getValue("type");
- emptyAttributeCheck(localName, "type", type, parser);
- final String fromName = attrs.getValue("from");
- emptyAttributeCheck(localName, "from", fromName, parser);
- final String toName = attrs.getValue("to");
- emptyAttributeCheck(localName, "to", toName, parser);
- if ("in".equals(type)) {
- mappable.addInMapping(fromName, toName);
- } else if ("out".equals(type)) {
- mappable.addOutMapping(fromName, toName);
- } else {
- throw new SAXParseException(
- "Unknown mapping type " + type, parser.getLocator());
- }
- return null;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- return null;
- }
-
- public Class generateNodeFor() {
- return null;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/MetaDataHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/MetaDataHandler.java
deleted file mode 100755
index 60d735e053a..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/MetaDataHandler.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.process.core.ValueObject;
-import org.jbpm.process.core.datatype.DataType;
-import org.jbpm.process.core.datatype.impl.type.StringDataType;
-import org.jbpm.workflow.core.Node;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class MetaDataHandler extends BaseAbstractHandler
- implements
- Handler {
- public MetaDataHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet();
- this.validParents.add(Node.class);
-
- this.validPeers = new HashSet();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- Node node = (Node) parser.getParent();
- final String name = attrs.getValue("name");
- emptyAttributeCheck(localName, "name", name, parser);
- return new MetaDataWrapper(node, name);
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- return null;
- }
-
- public Class generateNodeFor() {
- return MetaDataWrapper.class;
- }
-
- public class MetaDataWrapper implements ValueObject {
- private Node node;
- private String name;
-
- public MetaDataWrapper(Node node, String name) {
- this.node = node;
- this.name = name;
- }
-
- public Object getValue() {
- return node.getMetaData().get(name);
- }
-
- public void setValue(Object value) {
- node.setMetaData(name, value);
- }
-
- public DataType getType() {
- return new StringDataType();
- }
-
- public void setType(DataType type) {
- }
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/MilestoneNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/MilestoneNodeHandler.java
deleted file mode 100755
index 15d699b573e..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/MilestoneNodeHandler.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.compiler.XmlDumper;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.node.MilestoneNode;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-public class MilestoneNodeHandler extends AbstractNodeHandler {
-
- protected Node createNode() {
- return new MilestoneNode();
- }
-
- @SuppressWarnings("unchecked")
- public Class generateNodeFor() {
- return MilestoneNode.class;
- }
-
- @Override
- public void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser)
- throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- MilestoneNode milestoneNode = (MilestoneNode) node;
- for (String eventType : milestoneNode.getActionTypes()) {
- handleAction(milestoneNode, element, eventType);
- }
- }
-
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- MilestoneNode milestoneNode = (MilestoneNode) node;
- writeNode("milestone", milestoneNode, xmlDump, includeMeta);
- String constraint = milestoneNode.getCondition();
- if (constraint != null || milestoneNode.getTimers() != null || milestoneNode.containsActions()) {
- xmlDump.append(">\n");
- if (includeMeta) {
- writeMetaData(milestoneNode, xmlDump);
- }
- if (constraint != null) {
- xmlDump.append(" "
- + XmlDumper.replaceIllegalChars(constraint.trim()) + "" + EOL);
- }
- for (String eventType : milestoneNode.getActionTypes()) {
- writeActions(eventType, milestoneNode.getActions(eventType), xmlDump);
- }
- writeTimers(milestoneNode.getTimers(), xmlDump);
- endNode("milestone", xmlDump);
- } else {
- endNode(xmlDump);
- }
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/OutPortHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/OutPortHandler.java
deleted file mode 100755
index 8403af6bf01..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/OutPortHandler.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.workflow.core.node.CompositeNode;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class OutPortHandler extends BaseAbstractHandler
- implements
- Handler {
- public OutPortHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet();
- this.validParents.add(CompositeNode.class);
-
- this.validPeers = new HashSet();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- CompositeNode compositeNode = (CompositeNode) parser.getParent();
- final String type = attrs.getValue("type");
- emptyAttributeCheck(localName, "type", type, parser);
- final String nodeId = attrs.getValue("nodeId");
- emptyAttributeCheck(localName, "nodeId", nodeId, parser);
- final String nodeOutType = attrs.getValue("nodeOutType");
- emptyAttributeCheck(localName, "nodeOutType", nodeOutType, parser);
- compositeNode.linkOutgoingConnections(new Long(nodeId), nodeOutType, type);
- return null;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- return null;
- }
-
- public Class generateNodeFor() {
- return null;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ParameterHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ParameterHandler.java
deleted file mode 100755
index 24e411e8580..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ParameterHandler.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.process.core.ParameterDefinition;
-import org.jbpm.process.core.TypeObject;
-import org.jbpm.process.core.ValueObject;
-import org.jbpm.process.core.Work;
-import org.jbpm.process.core.datatype.DataType;
-import org.jbpm.process.core.impl.ParameterDefinitionImpl;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class ParameterHandler extends BaseAbstractHandler implements Handler {
-
- public ParameterHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet>();
- this.validParents.add(Work.class);
- this.validPeers = new HashSet>();
- this.validPeers.add(null);
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName, attrs);
- final String name = attrs.getValue("name");
- emptyAttributeCheck(localName, "name", name, parser);
- Work work = (Work) parser.getParent();
- ParameterDefinition parameterDefinition = new ParameterDefinitionImpl();
- parameterDefinition.setName(name);
- work.addParameterDefinition(parameterDefinition);
- return new ParameterWrapper(parameterDefinition, work);
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- return null;
- }
-
- public Class> generateNodeFor() {
- return ParameterWrapper.class;
- }
-
- public class ParameterWrapper implements TypeObject, ValueObject {
- private Work work;
- private ParameterDefinition parameterDefinition;
-
- public ParameterWrapper(ParameterDefinition parameterDefinition, Work work) {
- this.work = work;
- this.parameterDefinition = parameterDefinition;
- }
-
- public DataType getType() {
- return parameterDefinition.getType();
- }
-
- public void setType(DataType type) {
- parameterDefinition.setType(type);
- }
-
- public Object getValue() {
- return work.getParameter(parameterDefinition.getName());
- }
-
- public void setValue(Object value) {
- work.setParameter(parameterDefinition.getName(), value);
- }
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ProcessHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ProcessHandler.java
deleted file mode 100755
index 1c6e4780649..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ProcessHandler.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.ProcessBuildData;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.ruleflow.core.RuleFlowProcess;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class ProcessHandler extends BaseAbstractHandler implements Handler {
-
- public ProcessHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet();
- this.validParents.add(null);
-
- this.validPeers = new HashSet();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
-
- final String id = attrs.getValue("id");
- final String name = attrs.getValue("name");
- final String version = attrs.getValue("version");
- final String type = attrs.getValue("type");
- final String packageName = attrs.getValue("package-name");
- final String routerLayout = attrs.getValue("routerLayout");
-
- RuleFlowProcess process = new RuleFlowProcess();
- process.setId(id);
- process.setName(name);
- process.setVersion(version);
- process.setType(type);
- process.setPackageName(packageName);
- if (routerLayout != null) {
- process.setMetaData("routerLayout", new Integer(routerLayout));
- }
-
- ((ProcessBuildData) parser.getData()).addProcess(process);
-
- return process;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
-
- return parser.getCurrent();
- }
-
- public Class generateNodeFor() {
- return org.kie.api.definition.process.Process.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/RuleSetNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/RuleSetNodeHandler.java
deleted file mode 100755
index 64940d7abf0..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/RuleSetNodeHandler.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.node.RuleSetNode;
-import org.jbpm.workflow.instance.rule.RuleType;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-import static org.jbpm.workflow.instance.rule.RuleType.DRL_LANG;
-
-public class RuleSetNodeHandler extends AbstractNodeHandler {
-
- protected Node createNode() {
- return new RuleSetNode();
- }
-
- @Override
- public void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser)
- throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- RuleSetNode ruleSetNode = (RuleSetNode) node;
- String ruleFlowGroup = element.getAttribute("ruleFlowGroup");
- String language = element.getAttribute("implementation");
- if (language == null || language.equalsIgnoreCase("##unspecified") || language.isEmpty()) {
- language = DRL_LANG;
- }
- if (ruleFlowGroup != null && ruleFlowGroup.length() > 0) {
- ruleSetNode.setRuleType(RuleType.of(ruleFlowGroup, language));
- }
- }
-
- @SuppressWarnings("unchecked")
- public Class generateNodeFor() {
- return RuleSetNode.class;
- }
-
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- RuleSetNode ruleSetNode = (RuleSetNode) node;
- writeNode("ruleSet", ruleSetNode, xmlDump, includeMeta);
- RuleType ruleType = ruleSetNode.getRuleType();
- if (ruleType != null) {
- if (!ruleType.isDecision()) {
- xmlDump.append("ruleFlowGroup=\"" + ruleType.getName() + "\" ");
- }
- }
- xmlDump.append(" implementation=\"" + ruleSetNode.getLanguage() + "\" ");
- if (ruleSetNode.getTimers() != null || (includeMeta && containsMetaData(ruleSetNode))) {
- xmlDump.append(">\n");
- if (ruleSetNode.getTimers() != null) {
- writeTimers(ruleSetNode.getTimers(), xmlDump);
- }
- if (includeMeta) {
- writeMetaData(ruleSetNode, xmlDump);
- }
- endNode("ruleSet", xmlDump);
- } else {
- endNode(xmlDump);
- }
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/SplitNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/SplitNodeHandler.java
deleted file mode 100755
index 67a34c193db..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/SplitNodeHandler.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.Map;
-
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.compiler.XmlDumper;
-import org.jbpm.workflow.core.Constraint;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.impl.ConnectionRef;
-import org.jbpm.workflow.core.node.Split;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-public class SplitNodeHandler extends AbstractNodeHandler {
-
- protected Node createNode() {
- return new Split();
- }
-
- @Override
- public void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser)
- throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- Split splitNode = (Split) node;
- String type = element.getAttribute("type");
- if (type != null && type.length() != 0) {
- splitNode.setType(new Integer(type));
- }
- }
-
- @SuppressWarnings("unchecked")
- public Class generateNodeFor() {
- return Split.class;
- }
-
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- Split splitNode = (Split) node;
- writeNode("split", splitNode, xmlDump, includeMeta);
- int type = splitNode.getType();
- if (type != 0) {
- xmlDump.append("type=\"" + type + "\" ");
- }
- if (splitNode.getConstraints().isEmpty()) {
- endNode(xmlDump);
- } else {
- xmlDump.append(">" + EOL);
- if (includeMeta) {
- writeMetaData(splitNode, xmlDump);
- }
- xmlDump.append(" " + EOL);
- for (Map.Entry entry : splitNode.getConstraints().entrySet()) {
- ConnectionRef connection = entry.getKey();
- Constraint constraint = entry.getValue();
- xmlDump.append(" " + XmlDumper.replaceIllegalChars(constraintString) + "" + EOL);
- } else {
- xmlDump.append("/>" + EOL);
- }
- }
- xmlDump.append(" " + EOL);
- endNode("split", xmlDump);
- }
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/StartNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/StartNodeHandler.java
deleted file mode 100755
index 10b8432a6e1..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/StartNodeHandler.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.List;
-import java.util.Map;
-
-import org.jbpm.compiler.xml.compiler.XmlDumper;
-import org.jbpm.process.core.event.EventFilter;
-import org.jbpm.process.core.event.EventTypeFilter;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.node.ConstraintTrigger;
-import org.jbpm.workflow.core.node.EventTrigger;
-import org.jbpm.workflow.core.node.StartNode;
-import org.jbpm.workflow.core.node.Trigger;
-
-public class StartNodeHandler extends AbstractNodeHandler {
-
- protected Node createNode() {
- return new StartNode();
- }
-
- @SuppressWarnings("unchecked")
- public Class generateNodeFor() {
- return StartNode.class;
- }
-
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- StartNode startNode = (StartNode) node;
- writeNode("start", startNode, xmlDump, includeMeta);
- List triggers = startNode.getTriggers();
- if ((triggers == null || triggers.isEmpty()) && (!includeMeta || !containsMetaData(startNode))) {
- endNode(xmlDump);
- } else {
- xmlDump.append(">" + EOL);
- if (includeMeta) {
- writeMetaData(startNode, xmlDump);
- }
- if (triggers != null) {
- xmlDump.append(" " + EOL);
- for (Trigger trigger : triggers) {
- if (trigger instanceof ConstraintTrigger) {
- xmlDump.append(" " + EOL);
- xmlDump.append(" "
- + ((ConstraintTrigger) trigger).getConstraint() + "" + EOL);
- Map inMappings = trigger.getInMappings();
- if (inMappings != null && !inMappings.isEmpty()) {
- for (Map.Entry entry : inMappings.entrySet()) {
- xmlDump.append(" " + EOL);
- }
- }
- xmlDump.append(" " + EOL);
- } else if (trigger instanceof EventTrigger) {
- xmlDump.append(" " + EOL);
- xmlDump.append(" " + EOL);
- for (EventFilter filter : ((EventTrigger) trigger).getEventFilters()) {
- if (filter instanceof EventTypeFilter) {
- xmlDump.append(" " + EOL);
- } else {
- throw new IllegalArgumentException(
- "Unknown filter type: " + filter);
- }
- }
- xmlDump.append(" " + EOL);
- Map inMappings = trigger.getInMappings();
- if (inMappings != null && !inMappings.isEmpty()) {
- for (Map.Entry entry : inMappings.entrySet()) {
- xmlDump.append(" " + EOL);
- }
- }
- xmlDump.append(" " + EOL);
- } else {
- throw new IllegalArgumentException(
- "Unknown trigger type " + trigger);
- }
- }
- xmlDump.append(" " + EOL);
- }
- endNode("start", xmlDump);
- }
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/StateNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/StateNodeHandler.java
deleted file mode 100755
index 379f394a593..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/StateNodeHandler.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.Map;
-
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.compiler.XmlDumper;
-import org.jbpm.workflow.core.Constraint;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.impl.ConnectionRef;
-import org.jbpm.workflow.core.node.StateNode;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-public class StateNodeHandler extends AbstractNodeHandler {
-
- protected Node createNode() {
- return new StateNode();
- }
-
- @SuppressWarnings("unchecked")
- public Class generateNodeFor() {
- return StateNode.class;
- }
-
- @Override
- public void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser)
- throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- StateNode stateNode = (StateNode) node;
- for (String eventType : stateNode.getActionTypes()) {
- handleAction(stateNode, element, eventType);
- }
- }
-
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- StateNode stateNode = (StateNode) node;
- writeNode("state", stateNode, xmlDump, includeMeta);
- xmlDump.append(">\n");
- if (includeMeta) {
- writeMetaData(stateNode, xmlDump);
- }
- for (String eventType : stateNode.getActionTypes()) {
- writeActions(eventType, stateNode.getActions(eventType), xmlDump);
- }
- writeTimers(stateNode.getTimers(), xmlDump);
- if (!stateNode.getConstraints().isEmpty()) {
- xmlDump.append(" " + EOL);
- for (Map.Entry entry : stateNode.getConstraints().entrySet()) {
- ConnectionRef connection = entry.getKey();
- Constraint constraint = entry.getValue();
- xmlDump.append(" " + XmlDumper.replaceIllegalChars(constraintString) + "" + EOL);
- } else {
- xmlDump.append("/>" + EOL);
- }
- }
- xmlDump.append(" " + EOL);
- }
- endNode("state", xmlDump);
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/SubProcessNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/SubProcessNodeHandler.java
deleted file mode 100755
index 65dc21d0ec2..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/SubProcessNodeHandler.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.Map;
-
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.node.SubProcessNode;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-public class SubProcessNodeHandler extends AbstractNodeHandler {
-
- protected Node createNode() {
- return new SubProcessNode();
- }
-
- @Override
- public void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser)
- throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- SubProcessNode subProcessNode = (SubProcessNode) node;
- String processId = element.getAttribute("processId");
- if (processId != null && processId.length() > 0) {
- subProcessNode.setProcessId(processId);
- }
- String waitForCompletion = element.getAttribute("waitForCompletion");
- subProcessNode.setWaitForCompletion(!"false".equals(waitForCompletion));
- String independent = element.getAttribute("independent");
- subProcessNode.setIndependent(!"false".equals(independent));
- for (String eventType : subProcessNode.getActionTypes()) {
- handleAction(subProcessNode, element, eventType);
- }
- }
-
- @SuppressWarnings("unchecked")
- public Class generateNodeFor() {
- return SubProcessNode.class;
- }
-
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- SubProcessNode subProcessNode = (SubProcessNode) node;
- writeNode("subProcess", subProcessNode, xmlDump, includeMeta);
- String processId = subProcessNode.getProcessId();
- if (processId != null) {
- xmlDump.append("processId=\"" + processId + "\" ");
- }
- if (!subProcessNode.isWaitForCompletion()) {
- xmlDump.append("waitForCompletion=\"false\" ");
- }
- if (!subProcessNode.isIndependent()) {
- xmlDump.append("independent=\"false\" ");
- }
- xmlDump.append(">" + EOL);
- if (includeMeta) {
- writeMetaData(subProcessNode, xmlDump);
- }
- Map inMappings = subProcessNode.getInMappings();
- for (Map.Entry inMapping : inMappings.entrySet()) {
- xmlDump.append(
- " " + EOL);
- }
- Map outMappings = subProcessNode.getOutMappings();
- for (Map.Entry outMapping : outMappings.entrySet()) {
- xmlDump.append(
- " " + EOL);
- }
- for (String eventType : subProcessNode.getActionTypes()) {
- writeActions(eventType, subProcessNode.getActions(eventType), xmlDump);
- }
- writeTimers(subProcessNode.getTimers(), xmlDump);
- endNode("subProcess", xmlDump);
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/SwimlaneHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/SwimlaneHandler.java
deleted file mode 100755
index c7d18d5c269..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/SwimlaneHandler.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.process.core.context.swimlane.Swimlane;
-import org.jbpm.process.core.context.swimlane.SwimlaneContext;
-import org.jbpm.workflow.core.impl.WorkflowProcessImpl;
-import org.kie.api.definition.process.Process;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-public class SwimlaneHandler extends BaseAbstractHandler
- implements
- Handler {
- public SwimlaneHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet();
- this.validParents.add(Process.class);
-
- this.validPeers = new HashSet();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- WorkflowProcessImpl process = (WorkflowProcessImpl) parser.getParent();
- final String name = attrs.getValue("name");
- emptyAttributeCheck(localName, "name", name, parser);
-
- SwimlaneContext swimlaneContext = (SwimlaneContext) process.getDefaultContext(SwimlaneContext.SWIMLANE_SCOPE);
- if (swimlaneContext != null) {
- Swimlane swimlane = new Swimlane();
- swimlane.setName(name);
- swimlaneContext.addSwimlane(swimlane);
- } else {
- throw new SAXParseException(
- "Could not find default swimlane context.", parser.getLocator());
- }
-
- return null;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- return null;
- }
-
- public Class generateNodeFor() {
- return Swimlane.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/TimerHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/TimerHandler.java
deleted file mode 100755
index b5cdf38af0f..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/TimerHandler.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.process.core.timer.Timer;
-import org.jbpm.workflow.core.DroolsAction;
-import org.jbpm.workflow.core.node.StateBasedNode;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class TimerHandler extends BaseAbstractHandler implements Handler {
-
- public TimerHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet>();
- this.validParents.add(StateBasedNode.class);
-
- this.validPeers = new HashSet>();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName, attrs);
- return null;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- Element element = parser.endElementBuilder();
- StateBasedNode parent = (StateBasedNode) parser.getParent();
- String id = element.getAttribute("id");
- emptyAttributeCheck(localName, "id", id, parser);
- String delay = element.getAttribute("delay");
- String period = element.getAttribute("period");
- Timer timer = new Timer();
- timer.setId(Long.parseLong((id)));
- if (delay != null && delay.length() != 0) {
- timer.setDelay(delay);
- }
- if (period != null && period.length() != 0) {
- timer.setPeriod(period);
- }
- org.w3c.dom.Node xmlNode = element.getFirstChild();
- DroolsAction action = null;
- if (xmlNode instanceof Element) {
- Element actionXml = (Element) xmlNode;
- action = AbstractNodeHandler.extractAction(actionXml);
- }
- parent.addTimer(timer, action);
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public Class generateNodeFor() {
- return null;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/TimerNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/TimerNodeHandler.java
deleted file mode 100755
index cdf59f37d8e..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/TimerNodeHandler.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.process.core.timer.Timer;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.node.TimerNode;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-public class TimerNodeHandler extends AbstractNodeHandler {
-
- protected Node createNode() {
- return new TimerNode();
- }
-
- @Override
- public void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser)
- throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- TimerNode timerNode = (TimerNode) node;
- String delay = element.getAttribute("delay");
- String period = element.getAttribute("period");
- if ((delay != null && delay.length() > 0) || (period != null && period.length() > 0)) {
- Timer timer = timerNode.getTimer();
- if (timer == null) {
- timer = new Timer();
- timerNode.setTimer(timer);
- }
- if (delay != null && delay.length() != 0) {
- timer.setDelay(delay);
- }
- if (period != null && period.length() != 0) {
- timer.setPeriod(period);
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- public Class generateNodeFor() {
- return TimerNode.class;
- }
-
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- TimerNode timerNode = (TimerNode) node;
- writeNode("timerNode", timerNode, xmlDump, includeMeta);
- Timer timer = timerNode.getTimer();
- if (timer != null) {
- xmlDump.append("delay=\"" + timer.getDelay() + "\" ");
- if (timer.getPeriod() != null) {
- xmlDump.append(" period=\"" + timer.getPeriod() + "\" ");
- }
- }
- if (includeMeta && containsMetaData(timerNode)) {
- xmlDump.append(">" + EOL);
- writeMetaData(timerNode, xmlDump);
- endNode("timerNode", xmlDump);
- } else {
- endNode(xmlDump);
- }
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/TriggerHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/TriggerHandler.java
deleted file mode 100755
index 6b72c03589d..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/TriggerHandler.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.workflow.core.node.ConstraintTrigger;
-import org.jbpm.workflow.core.node.EventTrigger;
-import org.jbpm.workflow.core.node.StartNode;
-import org.jbpm.workflow.core.node.Trigger;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class TriggerHandler extends BaseAbstractHandler implements Handler {
-
- public TriggerHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet>();
- this.validParents.add(StartNode.class);
-
- this.validPeers = new HashSet>();
- this.validPeers.add(null);
- this.validPeers.add(Trigger.class);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName, attrs);
- StartNode startNode = (StartNode) parser.getParent();
- String type = attrs.getValue("type");
- emptyAttributeCheck(localName, "type", type, parser);
-
- Trigger trigger = null;
- if ("constraint".equals(type)) {
- trigger = new ConstraintTrigger();
- } else if ("event".equals(type)) {
- trigger = new EventTrigger();
- } else {
- throw new SAXException("Unknown trigger type " + type);
- }
- startNode.addTrigger(trigger);
- return trigger;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- return parser.getCurrent();
- }
-
- @SuppressWarnings("unchecked")
- public Class generateNodeFor() {
- return Trigger.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/TypeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/TypeHandler.java
deleted file mode 100755
index 8a7945684e1..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/TypeHandler.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.process.core.TypeObject;
-import org.jbpm.process.core.datatype.DataType;
-import org.jbpm.process.core.datatype.impl.type.ObjectDataType;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-public class TypeHandler extends BaseAbstractHandler
- implements
- Handler {
- public TypeHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet>();
- this.validParents.add(TypeObject.class);
-
- this.validPeers = new HashSet>();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- TypeObject typeable = (TypeObject) parser.getParent();
- String name = attrs.getValue("name");
- emptyAttributeCheck(localName, "name", name, parser);
- DataType dataType = null;
-
- name = name.replace("org.drools.core.process.core", "org.jbpm.process.core");
- try {
- dataType = (DataType) Class.forName(name).newInstance();
- // TODO make this pluggable so datatypes can read in other properties as well
- if (dataType instanceof ObjectDataType) {
- String className = attrs.getValue("className");
- if (className == null) {
- className = "java.lang.Object";
- }
- ((ObjectDataType) dataType).setClassName(className);
- }
- } catch (ClassNotFoundException e) {
- throw new SAXParseException(
- "Could not find datatype " + name, parser.getLocator());
- } catch (InstantiationException e) {
- throw new SAXParseException(
- "Could not instantiate datatype " + name, parser.getLocator());
- } catch (IllegalAccessException e) {
- throw new SAXParseException(
- "Could not access datatype " + name, parser.getLocator());
- }
-
- typeable.setType(dataType);
- return dataType;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- return null;
- }
-
- public Class> generateNodeFor() {
- return DataType.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ValueHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ValueHandler.java
deleted file mode 100755
index da5d1ca269e..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/ValueHandler.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.process.core.ValueObject;
-import org.jbpm.process.core.datatype.DataType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-public class ValueHandler extends BaseAbstractHandler implements Handler {
-
- public ValueHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet>();
- this.validParents.add(ValueObject.class);
-
- this.validPeers = new HashSet>();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- return null;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- final Element element = parser.endElementBuilder();
- ValueObject valueObject = (ValueObject) parser.getParent();
- String text = ((Text) element.getChildNodes().item(0)).getWholeText();
- if (text != null) {
- text = text.trim();
- if ("".equals(text)) {
- text = null;
- }
- }
- Object value = restoreValue(text, valueObject.getType(), parser);
- valueObject.setValue(value);
- return null;
- }
-
- private Object restoreValue(String text, DataType dataType, Parser parser) throws SAXException {
- if (text == null || "".equals(text)) {
- return null;
- }
- if (dataType == null) {
- throw new SAXParseException(
- "Null datatype", parser.getLocator());
- }
- return dataType.readValue(text);
- }
-
- public Class> generateNodeFor() {
- return null;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/VariableHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/VariableHandler.java
deleted file mode 100755
index 123134186e6..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/VariableHandler.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.process.core.ContextContainer;
-import org.jbpm.process.core.context.variable.Variable;
-import org.jbpm.process.core.context.variable.VariableScope;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-public class VariableHandler extends BaseAbstractHandler
- implements
- Handler {
- public VariableHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet>();
- this.validParents.add(ContextContainer.class);
-
- this.validPeers = new HashSet>();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- ContextContainer contextContainer = (ContextContainer) parser.getParent();
- final String name = attrs.getValue("name");
- emptyAttributeCheck(localName, "name", name, parser);
-
- VariableScope variableScope = (VariableScope) contextContainer.getDefaultContext(VariableScope.VARIABLE_SCOPE);
- Variable variable = new Variable();
- if (variableScope != null) {
- variable.setName(name);
- List variables = variableScope.getVariables();
- if (variables == null) {
- variables = new ArrayList<>();
- variableScope.setVariables(variables);
- }
- variables.add(variable);
- } else {
- throw new SAXParseException(
- "Could not find default variable scope.", parser.getLocator());
- }
-
- return variable;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- return null;
- }
-
- public Class> generateNodeFor() {
- return Variable.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/WorkHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/WorkHandler.java
deleted file mode 100755
index b4188054dc6..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/WorkHandler.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.Handler;
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.process.core.Work;
-import org.jbpm.process.core.impl.WorkImpl;
-import org.jbpm.workflow.core.node.WorkItemNode;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class WorkHandler extends BaseAbstractHandler implements Handler {
-
- public WorkHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet();
- this.validParents.add(WorkItemNode.class);
-
- this.validPeers = new HashSet();
- this.validPeers.add(null);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser parser) throws SAXException {
- parser.startElementBuilder(localName,
- attrs);
- WorkItemNode workItemNode = (WorkItemNode) parser.getParent();
- final String name = attrs.getValue("name");
- emptyAttributeCheck(localName, "name", name, parser);
- Work work = new WorkImpl();
- work.setName(name);
- workItemNode.setWork(work);
- return work;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser parser) throws SAXException {
- parser.endElementBuilder();
- return null;
- }
-
- public Class generateNodeFor() {
- return Work.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/WorkItemNodeHandler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/WorkItemNodeHandler.java
deleted file mode 100755
index fd433b81bb6..00000000000
--- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/xml/processes/WorkItemNodeHandler.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-
-import org.jbpm.compiler.xml.Parser;
-import org.jbpm.compiler.xml.XmlWorkflowProcessDumper;
-import org.jbpm.process.core.ParameterDefinition;
-import org.jbpm.process.core.Work;
-import org.jbpm.process.core.datatype.DataType;
-import org.jbpm.workflow.core.Node;
-import org.jbpm.workflow.core.node.WorkItemNode;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-public class WorkItemNodeHandler extends AbstractNodeHandler {
-
- @Override
- public void handleNode(final Node node, final Element element, final String uri,
- final String localName, final Parser parser)
- throws SAXException {
- super.handleNode(node, element, uri, localName, parser);
- WorkItemNode workItemNode = (WorkItemNode) node;
- final String waitForCompletion = element.getAttribute("waitForCompletion");
- workItemNode.setWaitForCompletion(!"false".equals(waitForCompletion));
- for (String eventType : workItemNode.getActionTypes()) {
- handleAction(workItemNode, element, eventType);
- }
- }
-
- protected Node createNode() {
- return new WorkItemNode();
- }
-
- public Class> generateNodeFor() {
- return WorkItemNode.class;
- }
-
- public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
- WorkItemNode workItemNode = (WorkItemNode) node;
- writeNode("workItem", workItemNode, xmlDump, includeMeta);
- visitParameters(workItemNode, xmlDump);
- xmlDump.append(">" + EOL);
- if (includeMeta) {
- writeMetaData(workItemNode, xmlDump);
- }
- Work work = workItemNode.getWork();
- visitWork(work, xmlDump, includeMeta);
- visitInMappings(workItemNode.getInMappings(), xmlDump);
- visitOutMappings(workItemNode.getOutMappings(), xmlDump);
- for (String eventType : workItemNode.getActionTypes()) {
- writeActions(eventType, workItemNode.getActions(eventType), xmlDump);
- }
- writeTimers(workItemNode.getTimers(), xmlDump);
- endNode("workItem", xmlDump);
- }
-
- protected void visitParameters(WorkItemNode workItemNode, StringBuilder xmlDump) {
- if (!workItemNode.isWaitForCompletion()) {
- xmlDump.append("waitForCompletion=\"false\" ");
- }
- }
-
- protected void visitInMappings(Map inMappings, StringBuilder xmlDump) {
- for (Map.Entry inMapping : inMappings.entrySet()) {
- xmlDump.append(
- " " + EOL);
- }
- }
-
- protected void visitOutMappings(Map outMappings, StringBuilder xmlDump) {
- for (Map.Entry outMapping : outMappings.entrySet()) {
- xmlDump.append(
- " " + EOL);
- }
- }
-
- protected void visitWork(Work work, StringBuilder xmlDump, boolean includeMeta) {
- if (work != null) {
- xmlDump.append(" " + EOL);
- List parameterDefinitions =
- new ArrayList<>(work.getParameterDefinitions());
- Collections.sort(parameterDefinitions, new Comparator() {
- public int compare(ParameterDefinition o1,
- ParameterDefinition o2) {
- return o1.getName().compareTo(o2.getName());
- }
-
- });
- for (ParameterDefinition paramDefinition : parameterDefinitions) {
- DataType dataType = paramDefinition.getType();
- xmlDump.append(" " + EOL + " ");
- XmlWorkflowProcessDumper.visitDataType(dataType, xmlDump);
- Object value = work.getParameter(paramDefinition.getName());
- if (value != null) {
- xmlDump.append(" ");
- XmlWorkflowProcessDumper.visitValue(value, dataType, xmlDump);
- }
- xmlDump.append(" " + EOL);
- }
- xmlDump.append(" " + EOL);
- }
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/main/resources/META-INF/services/org.kie.api.internal.assembler.KieAssemblerService b/jbpm/jbpm-flow-builder/src/main/resources/META-INF/services/org.kie.api.internal.assembler.KieAssemblerService
index f034e0d348f..be2e07b47c9 100644
--- a/jbpm/jbpm-flow-builder/src/main/resources/META-INF/services/org.kie.api.internal.assembler.KieAssemblerService
+++ b/jbpm/jbpm-flow-builder/src/main/resources/META-INF/services/org.kie.api.internal.assembler.KieAssemblerService
@@ -1,2 +1 @@
-org.jbpm.assembler.BPMN2AssemblerService
-org.jbpm.assembler.DRFAssemblerService
\ No newline at end of file
+org.jbpm.assembler.BPMN2AssemblerService
\ No newline at end of file
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/compiler/xml/StoreHandler.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/compiler/xml/StoreHandler.java
deleted file mode 100755
index 5ec3a334beb..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/compiler/xml/StoreHandler.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml;
-
-import java.util.HashSet;
-
-import org.jbpm.compiler.xml.core.BaseAbstractHandler;
-import org.jbpm.workflow.core.impl.DroolsConsequenceAction;
-import org.jbpm.workflow.core.impl.WorkflowProcessImpl;
-import org.jbpm.workflow.core.node.ActionNode;
-import org.jbpm.workflow.core.node.StartNode;
-import org.kie.api.definition.process.Process;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-public class StoreHandler extends BaseAbstractHandler
- implements
- Handler {
- public StoreHandler() {
- if ((this.validParents == null) && (this.validPeers == null)) {
- this.validParents = new HashSet>();
- this.validParents.add(Process.class);
-
- this.validPeers = new HashSet>();
- this.validPeers.add(StartNode.class);
- this.validPeers.add(ActionNode.class);
-
- this.allowNesting = false;
- }
- }
-
- public Object start(final String uri,
- final String localName,
- final Attributes attrs,
- final Parser xmlPackageReader) throws SAXException {
- xmlPackageReader.startElementBuilder(localName,
- attrs);
-
- WorkflowProcessImpl process = (WorkflowProcessImpl) xmlPackageReader.getParent();
-
- ActionNode actionNode = new ActionNode();
-
- final String name = attrs.getValue("name");
- emptyAttributeCheck(localName, "name", name, xmlPackageReader);
- actionNode.setName(name);
-
- final String id = attrs.getValue("id");
- emptyAttributeCheck(localName, "id", name, xmlPackageReader);
- actionNode.setId(new Long(id));
-
- process.addNode(actionNode);
- ((ProcessBuildData) xmlPackageReader.getData()).addNode(actionNode);
-
- return actionNode;
- }
-
- public Object end(final String uri,
- final String localName,
- final Parser xmlPackageReader) throws SAXException {
- final Element element = xmlPackageReader.endElementBuilder();
-
- ActionNode actionNode = (ActionNode) xmlPackageReader.getCurrent();
-
- String text = ((org.w3c.dom.Text) element.getChildNodes().item(0)).getWholeText();
-
- DroolsConsequenceAction actionText = new DroolsConsequenceAction("mvel", "list.add(\"" + text + "\")");
-
- actionNode.setAction(actionText);
-
- return actionNode;
- }
-
- public Class> generateNodeFor() {
- return ActionNode.class;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/compiler/xml/TestXml.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/compiler/xml/TestXml.java
deleted file mode 100755
index cc2f37f6cb0..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/compiler/xml/TestXml.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml;
-
-import java.io.InputStreamReader;
-import java.io.StringReader;
-import java.util.List;
-
-import org.jbpm.compiler.xml.core.SemanticModules;
-import org.jbpm.ruleflow.core.RuleFlowProcess;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Test;
-import org.kie.api.definition.process.Process;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class TestXml extends AbstractBaseTest {
-
- private static final Logger logger = LoggerFactory.getLogger(TestXml.class);
-
- @Test
- public void testSimpleXml() throws Exception {
- SemanticModules modules = new SemanticModules();
- modules.addSemanticModule(new ProcessSemanticModule());
- XmlProcessReader reader = new XmlProcessReader(modules, getClass().getClassLoader());
- reader.read(new InputStreamReader(TestXml.class.getResourceAsStream("XmlTest.xml")));
- List processes = reader.getProcess();
- assertThat(processes).isNotNull().hasSize(1);
-
- RuleFlowProcess process = (RuleFlowProcess) processes.get(0);
- assertThat(process).isNotNull();
-
- String output = XmlRuleFlowProcessDumper.INSTANCE.dump(process);
- logger.info(output);
- reader = new XmlProcessReader(new SemanticModules(), getClass().getClassLoader());
- reader.read(new StringReader(output));
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/compiler/xml/processes/ActionNodeTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/compiler/xml/processes/ActionNodeTest.java
deleted file mode 100755
index 4e02289f4c5..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/compiler/xml/processes/ActionNodeTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.compiler.xml.processes;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.drools.io.ClassPathResource;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ActionNodeTest extends AbstractBaseTest {
-
- @Test
- public void testSingleActionNode() throws Exception {
- builder.add(new ClassPathResource("ActionNodeTest.xml", ActionNodeTest.class), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
-
- kruntime.startProcess("process name");
-
- assertThat(list).hasSize(1);
- assertThat(list.get(0)).isEqualTo("action node was here");
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessActionTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessActionTest.java
deleted file mode 100755
index f8992dbca73..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessActionTest.java
+++ /dev/null
@@ -1,470 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.integrationtests;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.drools.io.ReaderResource;
-import org.jbpm.integrationtests.handler.TestWorkItemHandler;
-import org.jbpm.integrationtests.test.Message;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.api.runtime.rule.FactHandle;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-import org.kie.kogito.internal.process.runtime.KogitoWorkItem;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.fail;
-
-public class ProcessActionTest extends AbstractBaseTest {
-
- @Test
- @Disabled("On Exit not supported, see https://issues.redhat.com/browse/KOGITO-2067")
- public void testOnEntryExit() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " John Doe\n" +
- " \n" +
- " \n" +
- " \n" +
- " Do something\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"Executing on entry action\");\n" +
- " \n" +
- " \n" +
- " list.add(\"Executing on exit action1\");\n" +
- " list.add(\"Executing on exit action2\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler);
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance kogitoProcessInstance = kruntime.startProcess("org.drools.actions");
- assertThat(kogitoProcessInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- KogitoWorkItem workItem = handler.getWorkItem();
- assertThat(workItem).isNotNull();
- assertThat(list).hasSize(1);
- kruntime.getKogitoWorkItemManager().completeWorkItem(workItem.getStringId(), null);
- assertThat(list).hasSize(3);
- assertThat(kogitoProcessInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
- @Test
- public void testActionContextJava() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeText\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " System.out.println(\"Triggered\");\n" +
- "String myVariable = (String) kcontext.getVariable(\"variable\");\n" +
- "list.add(myVariable);\n" +
- "String nodeName = kcontext.getNodeInstance().getNodeName();\n" +
- "list.add(nodeName);\n" +
- "insert( new Message() );\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance kogitoProcessInstance = kruntime.startProcess("org.drools.actions");
- assertThat(list).hasSize(2);
- assertThat(list.get(0)).isEqualTo("SomeText");
- assertThat(list.get(1)).isEqualTo("MyActionNode");
- Collection factHandles = kruntime.getKieSession().getFactHandles(object -> object instanceof Message);
- assertThat(factHandles).isNotEmpty();
- assertThat(kogitoProcessInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
- @Test
- @Disabled("MVEL not supported in ScriptTask")
- public void testActionContextMVEL() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeText\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " System.out.println(\"Triggered\");\n" +
- "System.out.println(kcontext.getKieRuntime());\n" +
- "String myVariable = (String) kcontext.getVariable(\"variable\");\n" +
- "list.add(myVariable);\n" +
- "String nodeName = kcontext.getNodeInstance().getNodeName();\n" +
- "list.add(nodeName);\n" +
- "insert( new Message() );\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- if (builder.hasErrors()) {
- fail(builder.getErrors().toString());
- }
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance kogitoProcessInstance = kruntime.startProcess("org.drools.actions");
- assertThat(list).hasSize(2);
- assertThat(list.get(0)).isEqualTo("SomeText");
- assertThat(list.get(1)).isEqualTo("MyActionNode");
- Collection factHandles = kruntime.getKieSession().getFactHandles(object -> object instanceof Message);
- assertThat(factHandles).isNotEmpty();
- assertThat(kogitoProcessInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
- @Test
- public void testActionVariableJava() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " System.out.println(\"Triggered\");\n" +
- "list.add(person.getName());\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- TestVariable person = new TestVariable("John Doe");
- Map params = new HashMap();
- params.put("person", person);
- KogitoProcessInstance kogitoProcessInstance =
- kruntime.startProcess("org.drools.actions", params);
- assertThat(list).hasSize(1);
- assertThat(list.get(0)).isEqualTo("John Doe");
- assertThat(kogitoProcessInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
- @Test
- @Disabled("MVEL not supported in ScriptTask")
- public void testActionVariableMVEL() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " System.out.println(\"Triggered\");\n" +
- "list.add(person.name);\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList<>();
- kruntime.getKieSession().setGlobal("list", list);
- TestVariable person = new TestVariable("John Doe");
- Map params = new HashMap();
- params.put("person", person);
- KogitoProcessInstance kogitoProcessInstance =
- kruntime.startProcess("org.drools.actions", params);
- assertThat(list).hasSize(1);
- assertThat(list.get(0)).isEqualTo("John Doe");
- assertThat(kogitoProcessInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
- @Test
- public void testActionNameConflict() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"Action1\");\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"Action2\");\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance kogitoProcessInstance =
- kruntime.startProcess("org.drools.actions1");
- assertThat(list).hasSize(1);
- assertThat(list.get(0)).isEqualTo("Action1");
- list.clear();
- kogitoProcessInstance = kruntime.startProcess("org.drools.actions2");
- assertThat(list).hasSize(1);
- assertThat(list.get(0)).isEqualTo("Action2");
- assertThat(kogitoProcessInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
- @Test
- public void testActionContextJavaBackwardCheck() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeText\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " System.out.println(\"Triggered\");\n" +
- "String myVariable = (String) kcontext.getVariable(\"variable\");\n" +
- "list.add(myVariable);\n" +
- "String nodeName = kcontext.getNodeInstance().getNodeName();\n" +
- "list.add(nodeName);\n" +
- "insert( new Message() );\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance kogitoProcessInstance = kruntime.startProcess("org.drools.actions");
- assertThat(list).hasSize(2);
- assertThat(list.get(0)).isEqualTo("SomeText");
- assertThat(list.get(1)).isEqualTo("MyActionNode");
- Collection factHandles = kruntime.getKieSession().getFactHandles(object -> object instanceof Message);
- assertThat(factHandles).isNotEmpty();
- assertThat(kogitoProcessInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessDynamicNodeTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessDynamicNodeTest.java
deleted file mode 100755
index ae5a93b3e44..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessDynamicNodeTest.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.integrationtests;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.drools.io.ReaderResource;
-import org.jbpm.integrationtests.handler.TestWorkItemHandler;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.jbpm.workflow.instance.node.DynamicNodeInstance;
-import org.jbpm.workflow.instance.node.DynamicUtils;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.api.logger.KieRuntimeLogger;
-import org.kie.internal.builder.KnowledgeBuilderError;
-import org.kie.internal.io.ResourceFactory;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-import org.kie.kogito.internal.process.runtime.KogitoWorkItem;
-import org.kie.kogito.internal.process.runtime.KogitoWorkflowProcessInstance;
-import org.kie.kogito.logger.KogitoRuntimeLoggerFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProcessDynamicNodeTest extends AbstractBaseTest {
-
- private static final Logger logger = LoggerFactory.getLogger(ProcessDynamicNodeTest.class);
-
- @Test
- @Disabled("Not done yet")
- public void TODOtestDynamicActions() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " System.out.println(\"Action1\");\n" +
- "list.add(\"Action1\");\n" +
- " \n" +
- " \n" +
- " System.out.println(\"Action2\");\n" +
- "list.add(\"Action2\");\n" +
- " \n" +
- " \n" +
- " System.out.println(\"Action3\");\n" +
- "list.add(\"Action3\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " System.out.println(\"Action4\");\n" +
- "list.add(\"Action4\");\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- for (KnowledgeBuilderError error : builder.getErrors()) {
- logger.error(error.toString());
- }
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.dynamic");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(4);
- }
-
- @Test
- @Disabled("Not done yet")
- public void TODOtestDynamicAsyncActions() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " System.out.println(\"Action2\");\n" +
- "list.add(\"Action2\");\n" +
- " \n" +
- " \n" +
- " System.out.println(\"Action3\");\n" +
- "list.add(\"Action3\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " System.out.println(\"Action4\");\n" +
- "list.add(\"Action4\");\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- for (KnowledgeBuilderError error : builder.getErrors()) {
- logger.error(error.toString());
- }
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- TestWorkItemHandler testHandler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Work", testHandler);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.dynamic");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- assertThat(list).hasSize(1);
- KogitoWorkItem workItem = testHandler.getWorkItem();
- assertThat(workItem).isNotNull();
- kruntime.getKogitoWorkItemManager().completeWorkItem(workItem.getStringId(), null);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(3);
- }
-
- @Test
- public void testAddDynamicWorkItem() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " autocomplete\n" +
- " \n" +
- " \n" +
- " System.out.println(\"Action\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- KieRuntimeLogger logger = KogitoRuntimeLoggerFactory.newFileLogger(kruntime.getKieSession(), "test");
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler);
- // start a new process instance
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.dynamic");
- DynamicNodeInstance dynamicContext = (DynamicNodeInstance) ((KogitoWorkflowProcessInstance) processInstance).getNodeInstances().iterator().next();
- Map parameters = new HashMap();
- parameters.put("TaskName", "Dynamic Task");
- assertThat(handler.getWorkItem()).isNull();
- assertThat(dynamicContext.getNodeInstances()).isEmpty();
- DynamicUtils.addDynamicWorkItem(dynamicContext, kruntime.getKieRuntime(), "Human Task", parameters);
- assertThat(handler.getWorkItem()).isNotNull();
- assertThat(dynamicContext.getNodeInstances()).hasSize(1);
- logger.close();
- }
-
- @Test
- public void testAddDynamicSubProcess() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " autocomplete\n" +
- " \n" +
- " \n" +
- " System.out.println(\"Action\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "");
- Reader source2 = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeText\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " System.out.println(x);\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
- builder.add(ResourceFactory.newReaderResource(source2), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- KieRuntimeLogger logger = KogitoRuntimeLoggerFactory.newFileLogger(kruntime.getKieSession(), "test");
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler);
- // start a new process instance
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.dynamic");
- DynamicNodeInstance dynamicContext = (DynamicNodeInstance) ((KogitoWorkflowProcessInstance) processInstance).getNodeInstances().iterator().next();
- Map parameters = new HashMap();
- parameters.put("x", "NewValue");
- assertThat(handler.getWorkItem()).isNull();
- assertThat(dynamicContext.getNodeInstances()).isEmpty();
- DynamicUtils.addDynamicSubProcess(dynamicContext, kruntime.getKieRuntime(), "org.drools.subflow", parameters);
- assertThat(handler.getWorkItem()).isNotNull();
- assertThat(dynamicContext.getNodeInstances()).hasSize(1);
- logger.close();
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessEventListenerTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessEventListenerTest.java
deleted file mode 100755
index 494b212fa85..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessEventListenerTest.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-/*
- *
- * 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.
- * under the License.
- */
-
-package org.jbpm.integrationtests;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.drools.io.ReaderResource;
-import org.jbpm.process.core.context.variable.VariableScope;
-import org.jbpm.process.instance.context.variable.VariableScopeInstance;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Test;
-import org.kie.api.event.process.ProcessCompletedEvent;
-import org.kie.api.event.process.ProcessEvent;
-import org.kie.api.event.process.ProcessEventListener;
-import org.kie.api.event.process.ProcessNodeLeftEvent;
-import org.kie.api.event.process.ProcessNodeTriggeredEvent;
-import org.kie.api.event.process.ProcessStartedEvent;
-import org.kie.api.event.process.ProcessVariableChangedEvent;
-import org.kie.api.io.ResourceType;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProcessEventListenerTest extends AbstractBaseTest {
-
- private static final Logger logger = LoggerFactory.getLogger(ProcessEventListenerTest.class);
-
- @Test
- public void testInternalNodeSignalEvent() {
- Reader source = new StringReader(process);
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- final List processEventList = new ArrayList<>();
-
- final ProcessEventListener listener = createProcessEventListener(processEventList);
-
- kruntime.getProcessEventManager().addEventListener(listener);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.core.event");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(((VariableScopeInstance) ((org.jbpm.process.instance.ProcessInstance) processInstance)
- .getContextInstance(VariableScope.VARIABLE_SCOPE)).getVariable("MyVar")).isEqualTo("MyValue");
- assertThat(processEventList).hasSize(26);
- for (ProcessEvent e : processEventList) {
- logger.debug(e.toString());
- }
- assertThat(processEventList.get(2).getProcessInstance().getProcessId()).isEqualTo("org.drools.core.event");
-
- }
-
- private ProcessEventListener createProcessEventListener(final List processEventList) {
- return new ProcessEventListener() {
-
- @Override
- public void afterNodeLeft(ProcessNodeLeftEvent event) {
- processEventList.add(event);
- }
-
- @Override
- public void afterNodeTriggered(ProcessNodeTriggeredEvent event) {
- processEventList.add(event);
- }
-
- @Override
- public void afterProcessCompleted(ProcessCompletedEvent event) {
- processEventList.add(event);
- }
-
- @Override
- public void afterProcessStarted(ProcessStartedEvent event) {
- processEventList.add(event);
- }
-
- @Override
- public void beforeNodeLeft(ProcessNodeLeftEvent event) {
- processEventList.add(event);
- }
-
- @Override
- public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) {
- processEventList.add(event);
- }
-
- @Override
- public void beforeProcessCompleted(ProcessCompletedEvent event) {
- processEventList.add(event);
- }
-
- @Override
- public void beforeProcessStarted(ProcessStartedEvent event) {
- processEventList.add(event);
- }
-
- @Override
- public void beforeVariableChanged(ProcessVariableChangedEvent event) {
- processEventList.add(event);
- }
-
- @Override
- public void afterVariableChanged(ProcessVariableChangedEvent event) {
- processEventList.add(event);
- }
- };
- }
-
- private static final String process =
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeText\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " kcontext.getProcessInstance().signalEvent(\"MyEvent\", \"MyValue\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "";
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessEventTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessEventTest.java
deleted file mode 100755
index 8a1229d142b..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessEventTest.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.integrationtests;
-
-import java.io.Reader;
-import java.io.StringReader;
-
-import org.drools.io.ReaderResource;
-import org.jbpm.process.core.context.variable.VariableScope;
-import org.jbpm.process.instance.context.variable.VariableScopeInstance;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProcessEventTest extends AbstractBaseTest {
-
- @Test
- public void testInternalNodeSignalEvent() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeText\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " kcontext.getProcessInstance().signalEvent(\"MyEvent\", \"MyValue\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.core.event");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(((VariableScopeInstance) ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance(
- VariableScope.VARIABLE_SCOPE)).getVariable("MyVar")).isEqualTo("MyValue");
- }
-
- @Test
- public void testProcessInstanceSignalEvent() throws Exception {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeText\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.core.event");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
-
- processInstance = kruntime.getProcessInstance(processInstance.getStringId());
- processInstance.signalEvent("MyEvent", "MyValue");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(((VariableScopeInstance) ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance(
- VariableScope.VARIABLE_SCOPE)).getVariable("MyVar")).isEqualTo("MyValue");
- }
-
- @Test
- public void testExternalEventCorrelation() throws Exception {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeText\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.core.event");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- assertThat(((VariableScopeInstance) ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance(
- VariableScope.VARIABLE_SCOPE)).getVariable("MyVar")).isEqualTo("SomeText");
- processInstance = kruntime.getProcessInstance(processInstance.getStringId());
- kruntime.signalEvent("MyEvent", "MyValue");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(((VariableScopeInstance) ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance(
- VariableScope.VARIABLE_SCOPE)).getVariable("MyVar")).isEqualTo("MyValue");
- }
-
- @Test
- public void testInternalEventCorrelation() throws Exception {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeText\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.core.event");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- assertThat(((VariableScopeInstance) ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance(
- VariableScope.VARIABLE_SCOPE)).getVariable("MyVar")).isEqualTo("SomeText");
-
- processInstance = kruntime.getProcessInstance(processInstance.getStringId());
- kruntime.signalEvent("MyEvent", "MyValue");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- }
-
- @Test
- public void testInternalNodeSignalCompositeEvent() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeText\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " kcontext.getProcessInstance().signalEvent(\"MyEvent\", \"MyValue\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.core.event");
- assertThat(processInstance.getState()).as("Process did not complete!").isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(((VariableScopeInstance) ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance(
- VariableScope.VARIABLE_SCOPE)).getVariable("MyVar")).isEqualTo("MyValue");
- }
-
- @Test
- public void testProcessInstanceSignalCompositeEvent() throws Exception {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeText\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.core.event");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
-
- processInstance = kruntime.getProcessInstance(processInstance.getStringId());
- processInstance.signalEvent("MyEvent", "MyValue");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(((VariableScopeInstance) ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance(
- VariableScope.VARIABLE_SCOPE)).getVariable("MyVar")).isEqualTo("MyValue");
- }
-
- @Test
- public void testExternalCompositeEventCorrelation() throws Exception {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeText\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.core.event");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
-
- processInstance = kruntime.getProcessInstance(processInstance.getStringId());
- kruntime.signalEvent("MyEvent", "MyValue");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(((VariableScopeInstance) ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance(
- VariableScope.VARIABLE_SCOPE)).getVariable("MyVar")).isEqualTo("MyValue");
- }
-
- @Test
- public void testInternalCompositeEventCorrelation() throws Exception {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeText\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.core.event");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
-
- processInstance = kruntime.getProcessInstance(processInstance.getStringId());
- kruntime.signalEvent("MyEvent", "MyValue");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessExceptionHandlerTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessExceptionHandlerTest.java
deleted file mode 100755
index 37f13bf8c88..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessExceptionHandlerTest.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.integrationtests;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.drools.io.ReaderResource;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.internal.builder.KnowledgeBuilderError;
-import org.kie.internal.builder.KnowledgeBuilderErrors;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.fail;
-
-public class ProcessExceptionHandlerTest extends AbstractBaseTest {
-
- private static final Logger logger = LoggerFactory.getLogger(ProcessExceptionHandlerTest.class);
-
- @Test
- public void testFaultWithoutHandler() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KnowledgeBuilderErrors errors = builder.getErrors();
- if (errors != null && !errors.isEmpty()) {
- for (KnowledgeBuilderError error : errors) {
- logger.error(error.toString());
- }
- fail("Package could not be compiled");
- }
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.exception");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ABORTED);
- }
-
- @Test
- public void testProcessExceptionHandlerAction() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeValue\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " list.add(context.getVariable(\"faultVar\"));\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.exception");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- assertThat(list).hasSize(1);
- assertThat(list.get(0)).isEqualTo("SomeValue");
- }
-
- @Test
- public void testProcessExceptionHandlerTriggerNode() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " ((org.jbpm.process.instance.ProcessInstance) context.getProcessInstance()).setState(org.jbpm.process.instance.ProcessInstance.STATE_COMPLETED);\n"
- + " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.exception");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
- @Test
- public void testCompositeNodeExceptionHandlerTriggerNode() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeValue\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " kcontext.getProcessInstance().signalEvent(\"MyEvent\", null);\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " list.add(kcontext.getVariable(\"FaultVariable\"));\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
-
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.exception");
- assertThat(list).hasSize(1);
- assertThat(list.get(0)).isEqualTo("SomeValue");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
- @Test
- public void testNestedExceptionHandler() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"Triggered global exception scope\");\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " autocomplete\n" +
- " \n" +
- " \n" +
- " \n" +
- " SomeValue\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " ((org.jbpm.workflow.instance.node.CompositeNodeInstance) context.getNodeInstance()).signalEvent(\"MyEvent\", null);\n"
- +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
-
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.exception");
- assertThat(list).hasSize(1);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessForEachTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessForEachTest.java
deleted file mode 100755
index bb71d424c27..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessForEachTest.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.integrationtests;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.drools.io.ReaderResource;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-import org.kie.kogito.internal.process.runtime.KogitoWorkItem;
-import org.kie.kogito.internal.process.runtime.KogitoWorkItemHandler;
-import org.kie.kogito.internal.process.runtime.KogitoWorkItemManager;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProcessForEachTest extends AbstractBaseTest {
-
- @Test
- public void testForEach() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " myList.add(item);\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List myList = new ArrayList();
- kruntime.getKieSession().setGlobal("myList", myList);
- List collection = new ArrayList();
- collection.add("one");
- collection.add("two");
- collection.add("three");
- Map params = new HashMap();
- params.put("collection", collection);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.ForEach", params);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(myList).hasSize(3);
- }
-
- @Test
- public void testForEachLargeList() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- final List myList = new ArrayList();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Log", new KogitoWorkItemHandler() {
- public void executeWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager) {
- String message = (String) workItem.getParameter("Message");
- myList.add(message);
- manager.completeWorkItem(workItem.getStringId(), null);
- }
-
- public void abortWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager) {
- }
- });
- List collection = new ArrayList();
- for (int i = 0; i < 10000; i++) {
- collection.add(i + "");
- }
- Map params = new HashMap();
- params.put("collection", collection);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.ForEach", params);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(myList).hasSize(10000);
- }
-
- @Test
- public void testForEachEmptyList() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " myList.add(item);\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List myList = new ArrayList();
- kruntime.getKieSession().setGlobal("myList", myList);
- List collection = new ArrayList();
- Map params = new HashMap();
- params.put("collection", collection);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.ForEach", params);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
- @Test
- public void testForEachNullList() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " myList.add(item);\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List myList = new ArrayList();
- kruntime.getKieSession().setGlobal("myList", myList);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.ForEach");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
- @Test
- public void testForEachWithEventNode() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " System.out.println(\"action1\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " System.out.println(\"action2\");myList.add(item);\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List myList = new ArrayList();
- kruntime.getKieSession().setGlobal("myList", myList);
- List collection = new ArrayList();
- collection.add("one");
- collection.add("two");
- collection.add("three");
- Map params = new HashMap();
- params.put("collection", collection);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.ForEach", params);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- processInstance.signalEvent("MyEvent", null);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(myList).hasSize(3);
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessHumanTaskTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessHumanTaskTest.java
deleted file mode 100755
index 3df5fb4d8c3..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessHumanTaskTest.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.integrationtests;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.drools.io.ReaderResource;
-import org.jbpm.integrationtests.handler.TestWorkItemHandler;
-import org.jbpm.process.instance.ProcessInstance;
-import org.jbpm.process.instance.impl.humantask.InternalHumanTaskWorkItem;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-import org.kie.kogito.internal.process.runtime.KogitoWorkItem;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProcessHumanTaskTest extends AbstractBaseTest {
-
- @Test
- public void testHumanTask() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " John Doe\n" +
- " \n" +
- " \n" +
- " \n" +
- " Do something\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.humantask");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- KogitoWorkItem workItem = handler.getWorkItem();
- assertThat(workItem).isNotNull();
- kruntime.getKogitoWorkItemManager().completeWorkItem(workItem.getStringId(), null);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
- @Test
- public void testSwimlane() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " John Doe\n" +
- " \n" +
- " \n" +
- " \n" +
- " Do something\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " Do something else\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.humantask");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- KogitoWorkItem workItem = handler.getWorkItem();
- assertThat(workItem).isNotNull();
- assertThat(workItem.getParameter("TaskName")).isEqualTo("Do something");
- assertThat(workItem.getParameter("ActorId")).isEqualTo("John Doe");
- Map results = new HashMap();
- ((InternalHumanTaskWorkItem) workItem).setActualOwner("Jane Doe");
- kruntime.getKogitoWorkItemManager().completeWorkItem(workItem.getStringId(), results);
- workItem = handler.getWorkItem();
- assertThat(workItem).isNotNull();
- assertThat(workItem.getParameter("TaskName")).isEqualTo("Do something else");
- assertThat(workItem.getParameter("SwimlaneActorId")).isEqualTo("Jane Doe");
- kruntime.getKogitoWorkItemManager().completeWorkItem(workItem.getStringId(), null);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
- @Test
- public void testHumanTaskCancel() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " John Doe\n" +
- " \n" +
- " \n" +
- " \n" +
- " Do something\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler);
- ProcessInstance processInstance = (ProcessInstance) kruntime.startProcess("org.drools.humantask");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- KogitoWorkItem workItem = handler.getWorkItem();
- assertThat(workItem).isNotNull();
- processInstance.setState(KogitoProcessInstance.STATE_ABORTED);
- assertThat(handler.isAborted()).isTrue();
- }
-
- @Test
- @Disabled("On Exit not supported, see https://issues.redhat.com/browse/KOGITO-2067")
- public void testHumanTaskCancel2() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " John Doe\n" +
- " \n" +
- " \n" +
- " \n" +
- " Do something\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " ((org.jbpm.workflow.instance.NodeInstance) kcontext.getNodeInstance()).cancel();\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.humantask");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- KogitoWorkItem workItem = handler.getWorkItem();
- assertThat(workItem).isNotNull();
- kruntime.getKogitoWorkItemManager().completeWorkItem(workItem.getStringId(), null);
- assertThat(handler.isAborted()).isFalse();
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessMarshallingTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessMarshallingTest.java
deleted file mode 100755
index ba723af6eae..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessMarshallingTest.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.integrationtests;
-
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.drools.io.ReaderResource;
-import org.jbpm.integrationtests.handler.TestWorkItemHandler;
-import org.jbpm.integrationtests.test.Person;
-import org.jbpm.process.core.context.variable.VariableScope;
-import org.jbpm.process.instance.ProcessInstance;
-import org.jbpm.process.instance.context.variable.VariableScopeInstance;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-import org.kie.kogito.internal.process.runtime.KogitoWorkItem;
-import org.kie.kogito.internal.process.runtime.KogitoWorkItemHandler;
-import org.kie.kogito.internal.process.runtime.KogitoWorkItemManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProcessMarshallingTest extends AbstractBaseTest {
-
- private static final Logger logger = LoggerFactory.getLogger(ProcessMarshallingTest.class);
-
- @Test
- public void testMarshallingProcessInstanceWithWorkItem() {
- String process =
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " OldValue\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " Mail\n" +
- " \n" +
- " \n" +
- " \n" +
- " This is an email\n" +
- " \n" +
- " \n" +
- " \n" +
- " you@mail.com\n" +
- " \n" +
- " \n" +
- " \n" +
- " me@mail.com\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "";
- builder.add(new ReaderResource(new StringReader(process)), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email", handler);
- Map variables = new HashMap();
- variables.put("myVariable", "ThisIsMyValue");
- kruntime.startProcess("org.test.ruleflow", variables);
-
- assertThat(kruntime.getKogitoProcessInstances()).hasSize(1);
- assertThat(handler.getWorkItem()).isNotNull();
-
- assertThat(kruntime.getKogitoProcessInstances()).hasSize(1);
- VariableScopeInstance variableScopeInstance =
- (VariableScopeInstance) ((ProcessInstance) kruntime.getKogitoProcessInstances().iterator().next()).getContextInstance(VariableScope.VARIABLE_SCOPE);
- assertThat(variableScopeInstance.getVariable("myVariable")).isEqualTo("ThisIsMyValue");
-
- kruntime.getKogitoWorkItemManager().completeWorkItem(handler.getWorkItem().getStringId(), null);
- assertThat(kruntime.getKogitoProcessInstances()).isEmpty();
- }
-
- @Test
- public void testMarshallingWithMultipleHumanTasks() {
- String process =
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " Do something: #{item}\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " Do something else: #{item}\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "\n";
- builder.add(new ReaderResource(new StringReader(process)), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- TestListWorkItemHandler handler = new TestListWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler);
- List list = new ArrayList();
- list.add("one");
- list.add("two");
- list.add("three");
- Map parameters = new HashMap();
- parameters.put("list", list);
- KogitoProcessInstance kogitoProcessInstance = kruntime.startProcess("com.sample.ruleflow", parameters);
-
- assertThat(kruntime.getKogitoProcessInstances()).hasSize(1);
- //complete all user tasks instances
- for (int i = 0; i < list.size() * 2; i++) {
- completeWorkItems(kruntime, handler);
- }
- assertThat(kruntime.getKogitoProcessInstances()).isEmpty();
- assertThat(kogitoProcessInstance.getState()).isEqualTo(ProcessInstance.STATE_COMPLETED);
- }
-
- public void completeWorkItems(KogitoProcessRuntime kruntime, TestListWorkItemHandler handler) {
- KogitoWorkItem workItem = handler.getWorkItems().get(0);
- handler.reset();
- kruntime.getKogitoWorkItemManager().completeWorkItem(workItem.getStringId(), null);
- }
-
- private static class TestListWorkItemHandler implements KogitoWorkItemHandler {
- private List workItems = new ArrayList<>();
-
- public void executeWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager) {
- logger.debug("Executing workItem {}", workItem.getParameter("TaskName"));
- workItems.add(workItem);
- }
-
- public void abortWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager) {
- workItems.remove(workItem);
- }
-
- public List getWorkItems() {
- return workItems;
- }
-
- public void reset() {
- workItems.clear();
- }
- }
-
- @Test
- public void testVariablePersistenceMarshallingStrategies() {
- String process =
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " OldValue\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " Mail\n" +
- " \n" +
- " \n" +
- " \n" +
- " Mail\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "";
- builder.add(new ReaderResource(new StringReader(process)), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Report", handler);
- Map variables = new HashMap();
- variables.put("myVariable", "ThisIsMyValue");
- Person myPerson = new Person("Nikola Tesla", 156);
- variables.put("myPerson", myPerson);
- kruntime.startProcess("org.test.ruleflow", variables);
-
- assertThat(kruntime.getKogitoProcessInstances()).hasSize(1);
- assertThat(handler.getWorkItem()).isNotNull();
-
- assertThat(kruntime.getKogitoProcessInstances()).hasSize(1);
- VariableScopeInstance variableScopeInstance =
- (VariableScopeInstance) ((ProcessInstance) kruntime.getKogitoProcessInstances().iterator().next()).getContextInstance(VariableScope.VARIABLE_SCOPE);
- assertThat(variableScopeInstance.getVariable("myVariable")).isEqualTo("ThisIsMyValue");
- assertThat(variableScopeInstance.getVariable("myPerson")).isEqualTo(myPerson);
-
- kruntime.getKogitoWorkItemManager().completeWorkItem(handler.getWorkItem().getStringId(), null);
- assertThat(kruntime.getKogitoProcessInstances()).isEmpty();
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessMultiThreadTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessMultiThreadTest.java
deleted file mode 100755
index 875fae8414e..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessMultiThreadTest.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.integrationtests;
-
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.drools.drl.parser.DroolsError;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Test;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.fail;
-
-public class ProcessMultiThreadTest extends AbstractBaseTest {
-
- private static final Logger logger = LoggerFactory.getLogger(ProcessMultiThreadTest.class);
-
- @Test
- public void testMultiThreadProcessInstanceSignalling() {
- final int THREAD_COUNT = 2;
- try {
- boolean success = true;
- final Thread[] t = new Thread[THREAD_COUNT];
-
- builder.addProcessFromXml(new InputStreamReader(getClass().getResourceAsStream("test_ProcessMultithreadEvent.rf")));
- if (builder.getErrors().getErrors().length > 0) {
- for (DroolsError error : builder.getErrors().getErrors()) {
- logger.error(error.toString());
- }
- fail("Could not parse process");
- }
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.integrationtests.multithread");
- final ProcessInstanceSignalRunner[] r = new ProcessInstanceSignalRunner[THREAD_COUNT];
- for (int i = 0; i < t.length; i++) {
- r[i] = new ProcessInstanceSignalRunner(i, processInstance, "event" + (i + 1));
- t[i] = new Thread(r[i], "thread-" + i);
- t[i].start();
- }
- for (int i = 0; i < t.length; i++) {
- t[i].join();
- if (r[i].getStatus() == ProcessInstanceSignalRunner.Status.FAIL) {
- success = false;
- }
- }
- if (!success) {
- fail("Multithread test failed. Look at the stack traces for details. ");
- }
- assertThat(list).hasSize(2);
- assertThat(list.get(0)).isNotEqualTo(list.get(1));
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- } catch (Exception e) {
- e.printStackTrace();
- fail("Should not raise any exception: " + e.getMessage());
- }
- }
-
- public static class ProcessInstanceSignalRunner implements Runnable {
-
- private KogitoProcessInstance processInstance;
- private String type;
- private Status status;
- private int id;
-
- public ProcessInstanceSignalRunner(int id, KogitoProcessInstance processInstance, String type) {
- this.id = id;
- this.processInstance = processInstance;
- this.type = type;
- this.status = Status.SUCCESS;
- }
-
- public void run() {
- try {
- processInstance.signalEvent(type, null);
- } catch (Exception e) {
- this.status = Status.FAIL;
- logger.warn("{} failed: {}", Thread.currentThread().getName(), e.getMessage());
- }
- }
-
- public static enum Status {
- SUCCESS,
- FAIL
- }
-
- public int getId() {
- return id;
- }
-
- public Status getStatus() {
- return status;
- }
-
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessSplitTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessSplitTest.java
deleted file mode 100755
index 272e40417f4..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessSplitTest.java
+++ /dev/null
@@ -1,721 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.integrationtests;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.drools.io.ReaderResource;
-import org.jbpm.integrationtests.test.Person;
-import org.jbpm.process.core.context.variable.VariableScope;
-import org.jbpm.process.instance.context.variable.VariableScopeInstance;
-import org.jbpm.ruleflow.instance.RuleFlowProcessInstance;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.internal.builder.KnowledgeBuilderError;
-import org.kie.internal.io.ResourceFactory;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProcessSplitTest extends AbstractBaseTest {
-
- private static final Logger logger = LoggerFactory.getLogger(ProcessSplitTest.class);
-
- @Test
- public void testSplitWithProcessInstanceConstraint() {
- Reader source = new StringReader(
- "" +
- "" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- "" +
- " " +
- " " +
- " insert(kcontext.getProcessInstance());" +
- " " +
- " " +
- " " +
- " eval(true)" +
- " processInstance: org.jbpm.ruleflow.instance.RuleFlowProcessInstance()" +
- "Person( name == (ProcessUtils.getValue(processInstance, \"name\")) )" +
- " " +
- " " +
- " " +
- " " +
- " list.add(kcontext.getProcessInstance().getStringId());" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- "" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
-
- Person john = new Person("John Doe", 20);
- Person jane = new Person("Jane Doe", 20);
- Person julie = new Person("Julie Doe", 20);
- kruntime.getKieSession().insert(john);
- kruntime.getKieSession().insert(jane);
- Map params = new HashMap();
- params.put("name", john.getName());
- KogitoProcessInstance processInstance1 = kruntime.startProcess("org.jbpm.process-split", params);
- params = new HashMap();
- params.put("name", jane.getName());
- KogitoProcessInstance processInstance2 = kruntime.startProcess("org.jbpm.process-split", params);
- params = new HashMap();
- params.put("name", julie.getName());
- KogitoProcessInstance processInstance3 = kruntime.startProcess("org.jbpm.process-split", params);
-
- assertThat(processInstance1.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(processInstance2.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(processInstance3.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(2);
- }
-
- @Test
- public void testSplitWithProcessInstanceConstraint2() {
- Reader source = new StringReader(
- "" +
- "" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- "" +
- " " +
- " " +
- " insert(kcontext.getProcessInstance());" +
- " " +
- " " +
- " " +
- " eval(true)" +
- " processInstance: WorkflowProcessInstance()" +
- "Person( name == ( processInstance.getVariable(\"name\") ) )" +
- " " +
- " " +
- " " +
- " " +
- " list.add(kcontext.getProcessInstance().getStringId());" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- "" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
- for (KnowledgeBuilderError error : builder.getErrors()) {
- logger.error(error.toString());
- }
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
-
- Person john = new Person("John Doe", 20);
- Person jane = new Person("Jane Doe", 20);
- Person julie = new Person("Julie Doe", 20);
- kruntime.getKieSession().insert(john);
- kruntime.getKieSession().insert(jane);
- Map params = new HashMap();
- params.put("name", john.getName());
- KogitoProcessInstance processInstance1 = kruntime.startProcess("org.jbpm.process-split", params);
- params = new HashMap();
- params.put("name", jane.getName());
- KogitoProcessInstance processInstance2 = kruntime.startProcess("org.jbpm.process-split", params);
- params = new HashMap();
- params.put("name", julie.getName());
- KogitoProcessInstance processInstance3 = kruntime.startProcess("org.jbpm.process-split", params);
-
- assertThat(processInstance1.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(processInstance2.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(processInstance3.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(2);
- }
-
- @Test
- @Disabled("MVEL not supported in ScriptTask")
- public void testSplitWithMVELContextConstraint() {
- Reader source = new StringReader(
- "" +
- "" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- "" +
- " " +
- " " +
- " insert(kcontext.getProcessInstance());" +
- " " +
- " " +
- " " +
- " return true;" +
- " return kcontext.getVariable(\"person\") != null && ((Person) kcontext.getVariable(\"person\")).name != null;"
- +
- " " +
- " " +
- " " +
- " " +
- " list.add(kcontext.getProcessInstance().getStringId());" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- "" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
-
- Map params = new HashMap();
- params.put("person", new Person("John Doe"));
- KogitoProcessInstance processInstance = kruntime.startProcess("org.jbpm.process-split", params);
-
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- }
-
- @Test
- public void testSplitWithJavaContextConstraint() {
- Reader source = new StringReader(
- "" +
- "" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- "" +
- " " +
- " " +
- " insert(kcontext.getProcessInstance());" +
- " " +
- " " +
- " " +
- " return true;" +
- " return kcontext.getVariable(\"name\") != null && ((String) kcontext.getVariable(\"name\")).length() > 0;"
- +
- " " +
- " " +
- " " +
- " " +
- " list.add(kcontext.getProcessInstance().getStringId());" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- "" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
-
- Map params = new HashMap();
- params.put("name", "John Doe");
- KogitoProcessInstance processInstance = kruntime.startProcess("org.jbpm.process-split", params);
-
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- }
-
- @Test
- @Disabled("MVEL not supported in ScriptTask")
- public void testSplitWithMVELkContextConstraint() {
- Reader source = new StringReader(
- "" +
- "" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- "" +
- " " +
- " " +
- " insert(kcontext.getProcessInstance());" +
- " " +
- " " +
- " " +
- " return true;" +
- " return kcontext.getVariable(\"person\") != null && ((org.jbpm.integrationtests.test.Person) kcontext.getVariable(\"person\")).name != null;"
- +
- " " +
- " " +
- " " +
- " " +
- " list.add(kcontext.getProcessInstance().getStringId());" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- "" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
-
- Map params = new HashMap();
- params.put("person", new Person("John Doe"));
- KogitoProcessInstance processInstance = kruntime.startProcess("org.jbpm.process-split", params);
-
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- }
-
- @Test
- public void testSplitWithJavakContextConstraint() {
- Reader source = new StringReader(
- "" +
- "" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- "" +
- " " +
- " " +
- " insert(kcontext.getProcessInstance());" +
- " " +
- " " +
- " " +
- " return true;" +
- " return kcontext.getVariable(\"name\") != null && ((String) kcontext.getVariable(\"name\")).length() > 0;"
- +
- " " +
- " " +
- " " +
- " " +
- " list.add(kcontext.getProcessInstance().getStringId());" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- "" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
-
- Map params = new HashMap();
- params.put("name", "John Doe");
- KogitoProcessInstance processInstance = kruntime.startProcess("org.jbpm.process-split", params);
-
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- }
-
- @Test
- @Disabled("MVEL not supported in ScriptTask")
- public void testSplitWithMVELVariableConstraint() {
- Reader source = new StringReader(
- "" +
- "" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- "" +
- " " +
- " " +
- " insert(kcontext.getProcessInstance());" +
- " " +
- " " +
- " " +
- " return true;" +
- " return name != null && name.length > 0;" +
- " " +
- " " +
- " " +
- " " +
- " list.add(kcontext.getProcessInstance().getStringId());" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- "" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
-
- Map params = new HashMap();
- params.put("name", "John Doe");
- KogitoProcessInstance processInstance = kruntime.startProcess("org.jbpm.process-split", params);
-
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- }
-
- @Test
- public void testSplitWithJavaVariableConstraint() {
- Reader source = new StringReader(
- "" +
- "" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- "" +
- " " +
- " " +
- " insert(kcontext.getProcessInstance());" +
- " " +
- " " +
- " " +
- " return true;" +
- " return name != null && name.length() > 0;" +
- " " +
- " " +
- " " +
- " " +
- " list.add(kcontext.getProcessInstance().getStringId());" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- "" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
-
- Map params = new HashMap();
- params.put("name", "John Doe");
- KogitoProcessInstance processInstance = kruntime.startProcess("org.jbpm.process-split", params);
-
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- }
-
- @Test
- @Disabled("MVEL not supported in ScriptTask")
- public void testSplitWithMVELGlobalConstraint() {
- Reader source = new StringReader(
- "" +
- "" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- "" +
- " " +
- " " +
- " insert(kcontext.getProcessInstance());" +
- " " +
- " " +
- " " +
- " return true;" +
- " return list != null && list.size() >= 0;" +
- " " +
- " " +
- " " +
- " " +
- " list.add(kcontext.getProcessInstance().getStringId());" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- "" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
-
- Map params = new HashMap();
- params.put("name", "John Doe");
- KogitoProcessInstance processInstance = kruntime.startProcess("org.jbpm.process-split", params);
-
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- }
-
- @Test
- public void testSplitWithJavaGlobalConstraint() {
- Reader source = new StringReader(
- "" +
- "" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- "" +
- " " +
- " " +
- " insert(kcontext.getProcessInstance());" +
- " " +
- " " +
- " " +
- " return true;" +
- " return list != null && list.size() >= 0;" +
- " " +
- " " +
- " " +
- " " +
- " list.add(kcontext.getProcessInstance().getStringId());" +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- " " +
- "" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
-
- KogitoProcessInstance processInstance = kruntime.startProcess("org.jbpm.process-split");
-
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- }
-
- public static class ProcessUtils {
-
- public static Object getValue(RuleFlowProcessInstance processInstance, String name) {
- VariableScopeInstance scope = (VariableScopeInstance) processInstance.getContextInstance(VariableScope.VARIABLE_SCOPE);
- return scope.getVariable(name);
- }
-
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessStartTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessStartTest.java
deleted file mode 100755
index a0d81a9016d..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessStartTest.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.integrationtests;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.drools.io.ReaderResource;
-import org.jbpm.integrationtests.test.Message;
-import org.jbpm.integrationtests.test.Person;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.api.runtime.KieSession;
-import org.kie.internal.builder.KnowledgeBuilderError;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.fail;
-
-public class ProcessStartTest extends AbstractBaseTest {
-
- private static final Logger logger = LoggerFactory.getLogger(ProcessStartTest.class);
-
- @Test
- public void testStartConstraintTrigger() throws Exception {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " " +
- " \n" +
- " p:Person()\n" +
- " \n" +
- " \n" +
- " \n " +
- " \n" +
- " \n" +
- " \n" +
- " myList.add(kcontext.getVariable(\"SomeVar\"));\n" +
- "myList.add(kcontext.getVariable(\"SomeOtherVar\"));\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.addRuleFlow(source);
- if (!builder.getErrors().isEmpty()) {
- for (KnowledgeBuilderError error : builder.getErrors()) {
- logger.error(error.toString());
- }
- fail("Could not build process");
- }
-
- /*
- * This test cannot be migrated to use KogitoProcessRuntime because during ProcessRuntime initialization
- * multiple listeners are registered and this break the semantic of this test:
- * see ProcessRuntimeImpl#initProcessActivationListener() -> startProcessWithParamsAndTrigger (same for LightProcessRuntime)
- * This listener triggers a start process when the insert is performed (but no rules are fired) that is an expected behavior
- * for BPMN2 processes (see org.jbpm.bpmn2.StartEventTest#testConditionalStart() ) while for DRF processes produces an additional
- * unexpected (broken) execution
- */
- KieSession ksession = createKieSession();
-
- List myList = new ArrayList<>();
- ksession.setGlobal("myList", myList);
-
- assertThat(myList).isEmpty();
-
- Person jack = new Person();
- jack.setName("Jack");
- ksession.insert(jack);
- ksession.fireAllRules();
- assertThat(myList).hasSize(2);
- assertThat(String.valueOf(myList.get(0))).isEqualTo("Jack");
- assertThat(String.valueOf(myList.get(1))).isEqualTo("SomeString");
- }
-
- @Test
- public void testStartEventTrigger() throws Exception {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " " +
- " \n" +
- " " +
- " \n" +
- " " +
- " \n" +
- " \n" +
- " \n " +
- " \n" +
- " \n" +
- " \n" +
- " myList.add(kcontext.getVariable(\"SomeVar\"));\n" +
- "myList.add(kcontext.getVariable(\"SomeOtherVar\"));\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- if (!builder.getErrors().isEmpty()) {
- for (KnowledgeBuilderError error : builder.getErrors()) {
- logger.error(error.toString());
- }
- fail("Could not build process");
- }
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- List myList = new ArrayList();
- kruntime.getKieSession().setGlobal("myList", myList);
-
- assertThat(myList).isEmpty();
-
- kruntime.signalEvent("myEvent", "Jack");
- kruntime.getKieSession().fireAllRules();
- assertThat(myList).hasSize(2);
- assertThat(String.valueOf(myList.get(0))).isEqualTo("Jack");
- assertThat(String.valueOf(myList.get(1))).isEqualTo("SomeString");
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessStateTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessStateTest.java
deleted file mode 100755
index 82e1e4df42f..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessStateTest.java
+++ /dev/null
@@ -1,685 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.integrationtests;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-import org.jbpm.integrationtests.test.Person;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.jbpm.workflow.instance.node.StateNodeInstance;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.api.runtime.process.NodeInstance;
-import org.kie.api.runtime.process.WorkflowProcessInstance;
-import org.kie.internal.io.ResourceFactory;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProcessStateTest extends AbstractBaseTest {
-
- @Test
- public void testManualSignalState() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- // start process
- WorkflowProcessInstance processInstance = (WorkflowProcessInstance) kruntime.startProcess("org.drools.state");
- // should be in state A
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- Collection nodeInstances = processInstance.getNodeInstances();
- assertThat(nodeInstances).hasSize(1);
- StateNodeInstance stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
- assertThat(stateInstance.getNodeName()).isEqualTo("StateA");
- // signal "toB" so we move to state B
- processInstance.signalEvent("signal", "toB");
- nodeInstances = processInstance.getNodeInstances();
- assertThat(nodeInstances).hasSize(1);
- stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
- assertThat(stateInstance.getNodeName()).isEqualTo("StateB");
- // if no constraint specified for a connection,
- // we default to the name of the target node
- // signal "StateA", so we move back to state A
- processInstance.signalEvent("signal", "StateA");
- nodeInstances = processInstance.getNodeInstances();
- assertThat(nodeInstances).hasSize(1);
- stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
- assertThat(stateInstance.getNodeName()).isEqualTo("StateA");
- // signal "toC" so we move to state C
- processInstance.signalEvent("signal", "toC");
- nodeInstances = processInstance.getNodeInstances();
- assertThat(nodeInstances).hasSize(1);
- stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
- assertThat(stateInstance.getNodeName()).isEqualTo("StateC");
- // signal something completely wrong, this should simply be ignored
- processInstance.signalEvent("signal", "Invalid");
- nodeInstances = processInstance.getNodeInstances();
- assertThat(nodeInstances).hasSize(1);
- stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
- assertThat(stateInstance.getNodeName()).isEqualTo("StateC");
- // signal "End", so we move to the end
- processInstance.signalEvent("signal", "End");
- nodeInstances = processInstance.getNodeInstances();
- assertThat(nodeInstances).isEmpty();
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
- @Test
- public void testImmediateStateConstraint1() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " eval(true)" +
- " " +
- " \n" +
- " eval(false)" +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"1\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"2\");\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.state");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- assertThat(list.get(0)).isEqualTo("1");
- }
-
- @Test
- public void testImmediateStateConstraintPriorities1() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " eval(true)" +
- " " +
- " \n" +
- " eval(true)" +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"1\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"2\");\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.state");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- assertThat(list.get(0)).isEqualTo("1");
- }
-
- @Test
- public void testImmediateStateConstraintPriorities2() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " eval(true)" +
- " " +
- " \n" +
- " eval(true)" +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"1\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"2\");\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.state");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- assertThat(list.get(0)).isEqualTo("2");
- }
-
- @Test
- public void testDelayedStateConstraint() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " Person( age > 21 )" +
- " " +
- " \n" +
- " Person( age <= 21 )" +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"1\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"2\");\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.state");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- assertThat(list).isEmpty();
- Person person = new Person("John Doe", 30);
- kruntime.getKieSession().insert(person);
- kruntime.getKieSession().fireAllRules();
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- assertThat(list.get(0)).isEqualTo("1");
- }
-
- @Test
- public void testDelayedStateConstraint2() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " Person( age > 21 )" +
- " " +
- " \n" +
- " Person( age <= 21 )" +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"1\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"2\");\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.state");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- assertThat(list).isEmpty();
- Person person = new Person("John Doe", 20);
- kruntime.getKieSession().insert(person);
- kruntime.getKieSession().fireAllRules();
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- assertThat(list.get(0)).isEqualTo("2");
- }
-
- @Test
- @Disabled("Needs fix")
- public void FIXMEtestDelayedStateConstraintPriorities1() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " Person( )" +
- " " +
- " \n" +
- " Person( )" +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"1\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"2\");\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.state");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- assertThat(list).isEmpty();
- Person person = new Person("John Doe", 30);
- kruntime.getKieSession().insert(person);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- assertThat(list.get(0)).isEqualTo("1");
- }
-
- @Test
- @Disabled("Needs fix")
- public void FIXMEtestDelayedStateConstraintPriorities2() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " Person( )" +
- " " +
- " \n" +
- " Person( )" +
- " " +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"1\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"2\");\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.state");
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- assertThat(list).isEmpty();
- Person person = new Person("John Doe", 30);
- kruntime.getKieSession().insert(person);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(1);
- assertThat(list.get(0)).isEqualTo("2");
- }
-
- @Test
- public void testActionState() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " a\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- " list.add(\"Action1\" + s);\n" +
- " list.add(\"Action2\" + s);\n" +
- " \n" +
- " \n" +
- " list.add(\"Action3\" + s);\n" +
- " list.add(\"Action4\" + s);\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- // start process
- WorkflowProcessInstance processInstance = (WorkflowProcessInstance) kruntime.startProcess("org.drools.state");
- // should be in state A
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- Collection nodeInstances = processInstance.getNodeInstances();
- assertThat(nodeInstances).hasSize(1);
- StateNodeInstance stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
- assertThat(stateInstance.getNodeName()).isEqualTo("State");
- assertThat(list).hasSize(2).contains("Action1a", "Action2a");
-
- processInstance.signalEvent("signal", "End");
- nodeInstances = processInstance.getNodeInstances();
- assertThat(nodeInstances).isEmpty();
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(4).contains("Action3a", "Action4a");
- }
-
- @Test
- public void testTimerState() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " a\n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " list.add(\"Timer1\" + s);\n" +
- " \n" +
- " \n" +
- " list.add(\"Timer2\" + s);\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
- new Thread(() -> kruntime.getKieSession().fireUntilHalt()).start();
- // start process
- WorkflowProcessInstance processInstance = (WorkflowProcessInstance) kruntime.startProcess("org.drools.state");
- // should be in state A
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- Collection nodeInstances = processInstance.getNodeInstances();
- assertThat(nodeInstances).hasSize(1);
- StateNodeInstance stateInstance = (StateNodeInstance) nodeInstances.iterator().next();
- assertThat(stateInstance.getNodeName()).isEqualTo("State");
- assertThat(list).isEmpty();
- try {
- TimeUnit.SECONDS.sleep(4);
- } catch (InterruptedException e) {
- }
- assertThat(list).hasSize(4).contains("Timer1a", "Timer2a");
-
- processInstance.signalEvent("signal", "End");
- nodeInstances = processInstance.getNodeInstances();
- assertThat(nodeInstances).isEmpty();
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(list).hasSize(4);
- try {
- TimeUnit.SECONDS.sleep(2);
- } catch (InterruptedException e) {
- }
- assertThat(list).hasSize(4);
- kruntime.getKieSession().halt();
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessTimerTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessTimerTest.java
deleted file mode 100755
index b25a0ebd9b7..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessTimerTest.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.integrationtests;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-import org.drools.io.ReaderResource;
-import org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.internal.builder.KnowledgeBuilderError;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.awaitility.Awaitility.await;
-
-public class ProcessTimerTest extends AbstractBaseTest {
-
- private static final Logger logger = LoggerFactory.getLogger(ProcessTimerTest.class);
-
- @Test
- void testIncorrectTimerNode() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
- assertThat(builder.getErrors()).hasSize(2);
- for (KnowledgeBuilderError error : builder.getErrors()) {
- logger.error(error.toString());
- }
- }
-
- @Test
- void testOnEntryTimerWorkItemExecuted() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " myList.add(\"Executing timer\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(new ReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- List myList = new ArrayList<>();
- kruntime.getKieSession().setGlobal("myList", myList);
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler());
-
- KogitoProcessInstance processInstance = kruntime.startProcess("org.drools.timer");
- assertThat(myList).isEmpty();
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
-
- await("dead").atMost(5, SECONDS)
- .with().pollInterval(500, TimeUnit.MILLISECONDS)
- .untilAsserted(() -> assertThat(myList).hasSize(1));
-
- kruntime.getKieSession().dispose();
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessUpgradeTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessUpgradeTest.java
deleted file mode 100755
index a99025ef6a1..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessUpgradeTest.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.integrationtests;
-
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.drools.compiler.builder.impl.KnowledgeBuilderImpl;
-import org.drools.io.ByteArrayResource;
-import org.drools.io.ReaderResource;
-import org.drools.kiesession.rulebase.InternalKnowledgeBase;
-import org.drools.kiesession.rulebase.KnowledgeBaseFactory;
-import org.jbpm.integrationtests.handler.TestWorkItemHandler;
-import org.jbpm.integrationtests.test.Person;
-import org.jbpm.process.instance.InternalProcessRuntime;
-import org.jbpm.process.instance.ProcessInstance;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.jbpm.workflow.instance.WorkflowProcessInstanceUpgrader;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.internal.builder.KnowledgeBuilderFactory;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProcessUpgradeTest extends AbstractBaseTest {
-
- @Test
- public void testDefaultUpgrade() throws Exception {
- String rule = "package org.test;\n";
- rule += "import org.jbpm.integrationtests.test.Person\n";
- rule += "global java.util.List list\n";
- rule += "rule \"Rule 1\"\n";
- rule += " ruleflow-group \"hello\"\n";
- rule += "when\n";
- rule += " $p : Person( ) \n";
- rule += "then\n";
- rule += " list.add( $p );\n";
- rule += "end";
-
- builder = (KnowledgeBuilderImpl) KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration());
- builder.add(new ReaderResource(new StringReader(rule)), ResourceType.DRL);
-
- String process =
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "";
- builder.add(new ReaderResource(new StringReader(process)), ResourceType.DRF);
-
- InternalKnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
- kbase.addPackages(builder.getKnowledgePackages());
- KogitoProcessRuntime kruntime = InternalProcessRuntime.asKogitoProcessRuntime(kbase.newKieSession());
-
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler);
-
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
-
- Person p = new Person("bobba fet", 32);
- kruntime.getKieSession().insert(p);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.test.ruleflow");
-
- assertThat(kruntime.getKieSession().getProcessInstances()).hasSize(1);
-
- String process2 =
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- " System.out.println();\n" +
- "list.add(\"Executed\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "";
- builder = (KnowledgeBuilderImpl) KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration());
- builder.add(new ReaderResource(new StringReader(process2)), ResourceType.DRF);
- kbase.addPackages(builder.getKnowledgePackages());
- WorkflowProcessInstanceUpgrader.upgradeProcessInstance(
- kruntime, processInstance.getStringId(), "org.test.ruleflow2", new HashMap<>());
- assertThat(processInstance.getProcessId()).isEqualTo("org.test.ruleflow2");
-
- kruntime.getKogitoWorkItemManager().completeWorkItem(handler.getWorkItem().getStringId(), null);
- assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_COMPLETED);
-
- assertThat(list).hasSize(1);
- }
-
- @Test
- public void testMappingUpgrade() throws Exception {
- String rule = "package org.test;\n";
- rule += "import org.jbpm.integrationtests.test.Person\n";
- rule += "global java.util.List list\n";
- rule += "rule \"Rule 1\"\n";
- rule += " ruleflow-group \"hello\"\n";
- rule += "when\n";
- rule += " $p : Person( ) \n";
- rule += "then\n";
- rule += " list.add( $p );\n";
- rule += "end";
-
- builder = (KnowledgeBuilderImpl) KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration());
- builder.add(new ReaderResource(new StringReader(rule)), ResourceType.DRL);
-
- String process =
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "";
- builder.add(new ReaderResource(new StringReader(process)), ResourceType.DRF);
-
- InternalKnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
- kbase.addPackages(builder.getKnowledgePackages());
- KogitoProcessRuntime kruntime = InternalProcessRuntime.asKogitoProcessRuntime(kbase.newKieSession());
-
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler);
-
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
-
- Person p = new Person("bobba fet", 32);
- kruntime.getKieSession().insert(p);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.test.ruleflow");
-
- assertThat(kruntime.getKogitoProcessInstances()).hasSize(1);
-
- String process2 =
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- " System.out.println();\n" +
- "list.add(\"Executed\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "";
- builder = (KnowledgeBuilderImpl) KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration());
- builder.add(new ReaderResource(new StringReader(process2)), ResourceType.DRF);
- kbase.addPackages(builder.getKnowledgePackages());
- Map mapping = new HashMap();
- mapping.put("2", 102L);
-
- WorkflowProcessInstanceUpgrader.upgradeProcessInstance(
- kruntime, processInstance.getStringId(), "org.test.ruleflow2", mapping);
- assertThat(processInstance.getProcessId()).isEqualTo("org.test.ruleflow2");
-
- kruntime.getKogitoWorkItemManager().completeWorkItem(handler.getWorkItem().getStringId(), null);
- assertThat(list).hasSize(1);
- assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_COMPLETED);
- }
-
- @Test
- public void testCompositeMappingUpgrade() throws Exception {
- String rule = "package org.test;\n";
- rule += "import org.jbpm.integrationtests.test.Person\n";
- rule += "global java.util.List list\n";
- rule += "rule \"Rule 1\"\n";
- rule += " ruleflow-group \"hello\"\n";
- rule += "when\n";
- rule += " $p : Person( ) \n";
- rule += "then\n";
- rule += " list.add( $p );\n";
- rule += "end";
-
- builder = (KnowledgeBuilderImpl) KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration());
- builder.add(new ByteArrayResource(rule.getBytes()), ResourceType.DRL);
-
- String process =
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "";
- builder.add(new ReaderResource(new StringReader(process)), ResourceType.DRF);
-
- InternalKnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
- kbase.addPackages(builder.getKnowledgePackages());
- KogitoProcessRuntime kruntime = InternalProcessRuntime.asKogitoProcessRuntime(kbase.newKieSession());
-
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler);
-
- List list = new ArrayList();
- kruntime.getKieSession().setGlobal("list", list);
-
- Person p = new Person("bobba fet", 32);
- kruntime.getKieSession().insert(p);
- KogitoProcessInstance processInstance = kruntime.startProcess("org.test.ruleflow");
-
- assertThat(kruntime.getKieSession().getProcessInstances()).hasSize(1);
-
- String process2 =
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- " System.out.println();\n" +
- "list.add(\"Executed\");\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "";
- builder.add(new ReaderResource(new StringReader(process2)), ResourceType.DRF);
- kbase.addPackages(builder.getKnowledgePackages());
- Map mapping = new HashMap();
- mapping.put("2:1", 101L);
-
- WorkflowProcessInstanceUpgrader.upgradeProcessInstance(
- kruntime, processInstance.getStringId(), "org.test.ruleflow2", mapping);
- assertThat(processInstance.getProcessId()).isEqualTo("org.test.ruleflow2");
-
- kruntime.getKogitoWorkItemManager().completeWorkItem(handler.getWorkItem().getStringId(), null);
- assertThat(list).hasSize(1);
- assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_COMPLETED);
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessWorkItemTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessWorkItemTest.java
deleted file mode 100755
index b6c711c7c78..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/integrationtests/ProcessWorkItemTest.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.integrationtests;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jbpm.integrationtests.handler.TestWorkItemHandler;
-import org.jbpm.integrationtests.test.Person;
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Test;
-import org.kie.api.io.ResourceType;
-import org.kie.api.runtime.process.WorkflowProcessInstance;
-import org.kie.internal.io.ResourceFactory;
-import org.kie.kogito.internal.process.runtime.KogitoProcessInstance;
-import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime;
-import org.kie.kogito.internal.process.runtime.KogitoWorkItem;
-import org.kie.kogito.internal.process.runtime.KogitoWorkItemHandler;
-import org.kie.kogito.internal.process.runtime.KogitoWorkItemManager;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProcessWorkItemTest extends AbstractBaseTest {
-
- @Test
- public void testWorkItem() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " John Doe\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " #{UserName}\n" +
- " \n" +
- " \n" +
- " \n" +
- " #{Person.name}\n" +
- " \n" +
- " \n" +
- " \n" +
- " Do something\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- " " +
- " " +
- " " +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- TestWorkItemHandler handler = new TestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler);
- Map parameters = new HashMap();
- parameters.put("UserName", "John Doe");
- Person person = new Person();
- person.setName("John Doe");
- parameters.put("Person", person);
- WorkflowProcessInstance processInstance = (WorkflowProcessInstance) kruntime.startProcess("org.drools.actions", parameters);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- KogitoWorkItem workItem = handler.getWorkItem();
- assertThat(workItem).isNotNull();
- assertThat(workItem.getParameter("ActorId")).isEqualTo("John Doe");
- assertThat(workItem.getParameter("Content")).isEqualTo("John Doe");
- assertThat(workItem.getParameter("Comment")).isEqualTo("John Doe");
- kruntime.getKogitoWorkItemManager().completeWorkItem(workItem.getStringId(), Collections.singletonMap("Result", ""));
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- parameters = new HashMap();
- parameters.put("UserName", "Jane Doe");
- parameters.put("MyObject", "SomeString");
- person = new Person();
- person.setName("Jane Doe");
- parameters.put("Person", person);
- processInstance = (WorkflowProcessInstance) kruntime.startProcess("org.drools.actions", parameters);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE);
- workItem = handler.getWorkItem();
- assertThat(workItem).isNotNull();
- assertThat(workItem.getParameter("ActorId")).isEqualTo("Jane Doe");
- assertThat(workItem.getParameter("Attachment")).isEqualTo("SomeString");
- assertThat(workItem.getParameter("Content")).isEqualTo("Jane Doe");
- assertThat(workItem.getParameter("Comment")).isEqualTo("Jane Doe");
- Map results = new HashMap();
- results.put("Result", "SomeOtherString");
- kruntime.getKogitoWorkItemManager().completeWorkItem(workItem.getStringId(), results);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- assertThat(processInstance.getVariable("MyObject")).isEqualTo("SomeOtherString");
- assertThat(processInstance.getVariable("Number")).isEqualTo(15);
- }
-
- @Test
- public void testWorkItemImmediateCompletion() {
- Reader source = new StringReader(
- "\n" +
- "\n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " John Doe\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " #{UserName}\n" +
- " \n" +
- " \n" +
- " \n" +
- " #{Person.name}\n" +
- " \n" +
- " \n" +
- " \n" +
- " Do something\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " " +
- " " +
- " " +
- " " +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "\n" +
- "");
- builder.add(ResourceFactory.newReaderResource(source), ResourceType.DRF);
-
- KogitoProcessRuntime kruntime = createKogitoProcessRuntime();
-
- ImmediateTestWorkItemHandler handler = new ImmediateTestWorkItemHandler();
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler);
- kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler);
- Map parameters = new HashMap();
- parameters.put("UserName", "John Doe");
- Person person = new Person();
- person.setName("John Doe");
- parameters.put("Person", person);
- WorkflowProcessInstance processInstance = (WorkflowProcessInstance) kruntime.startProcess("org.drools.actions", parameters);
- assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED);
- }
-
- private static class ImmediateTestWorkItemHandler implements KogitoWorkItemHandler {
- @Override
- public void executeWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager) {
- manager.completeWorkItem(workItem.getStringId(), null);
- }
-
- @Override
- public void abortWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager) {
- }
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/process/builder/KnowledgeBuilderTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/process/builder/KnowledgeBuilderTest.java
deleted file mode 100755
index bdf2fbfad6f..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/process/builder/KnowledgeBuilderTest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.process.builder;
-
-import java.util.Collection;
-
-import org.jbpm.test.util.AbstractBaseTest;
-import org.junit.jupiter.api.Test;
-import org.kie.api.definition.KiePackage;
-import org.kie.api.definition.process.Process;
-import org.kie.api.io.ResourceType;
-import org.kie.internal.builder.KnowledgeBuilder;
-import org.kie.internal.builder.KnowledgeBuilderFactory;
-import org.kie.internal.io.ResourceFactory;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class KnowledgeBuilderTest extends AbstractBaseTest {
-
- @Test
- public void testKnowledgeProviderWithProcesses() {
- KnowledgeBuilder builder = KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration());
-
- String str = "";
- str += "";
- str += "";
- str += " \n";
- str += " \n";
- str += " ";
- str += "";
- builder.add(ResourceFactory.newByteArrayResource(str.getBytes()), ResourceType.DRF);
-
- str = "";
- str += "";
- str += "";
- str += " \n";
- str += " \n";
- str += " ";
- str += "";
- builder.add(ResourceFactory.newByteArrayResource(str.getBytes()), ResourceType.DRF);
-
- Collection pkgs = builder.getKnowledgePackages();
- assertThat(pkgs).isNotNull().hasSize(2);
-
- KiePackage test1 = getKnowledgePackage(pkgs, "org.test1");
- Collection processes = test1.getProcesses();
- assertThat(processes).hasSize(1);
- Process process = getProcess(processes, "flow1");
- assertThat(process.getName()).isEqualTo("flow1");
-
- KiePackage test2 = getKnowledgePackage(pkgs, "org.test2");
- processes = test2.getProcesses();
- assertThat(processes).hasSize(1);
- process = getProcess(processes, "flow2");
- assertThat(process.getName()).isEqualTo("flow2");
-
- }
-
- public Process getProcess(Collection processes, String name) {
- for (Process process : processes) {
- if (process.getName().equals(name)) {
- return process;
- }
- }
- return null;
- }
-
- public KiePackage getKnowledgePackage(Collection pkgs, String name) {
- for (KiePackage pkg : pkgs) {
- if (pkg.getName().equals(name)) {
- return pkg;
- }
- }
- return null;
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/xml/DumperTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/xml/DumperTest.java
deleted file mode 100644
index 7b933f8f31b..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/xml/DumperTest.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.xml;
-
-import org.drools.drl.ast.descr.PackageDescr;
-import org.drools.drl.ast.dsl.DescrFactory;
-import org.drools.drl.parser.DrlParser;
-import org.drools.drl.parser.DroolsParserException;
-import org.drools.mvel.DrlDumper;
-import org.junit.jupiter.api.Test;
-import org.kie.internal.builder.conf.LanguageLevelOption;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * Test the dump/convert format utilities.
- */
-
-public class DumperTest {
-
- // Xml Dumper test
-
- @Test
- public void testRoundTripAccumulateXml() throws Exception {
- DumperTestHelper.XmlFile("test_ParseAccumulate.xml");
- }
-
- @Test
- public void testRoundTripCollectXml() throws Exception {
- DumperTestHelper.XmlFile("test_ParseCollect.xml");
- }
-
- @Test
- public void testRoundTripExistsXml() throws Exception {
- DumperTestHelper.XmlFile("test_ParseExists.xml");
- }
-
- @Test
- public void testRoundTripForallXml() throws Exception {
- DumperTestHelper.XmlFile("test_ParseForall.xml");
- }
-
- @Test
- public void testRoundTripFromXml() throws Exception {
- DumperTestHelper.XmlFile("test_ParseFrom.xml");
- }
-
- @Test
- public void testRoundTripComplexRuleXml() throws Exception {
- DumperTestHelper.XmlFile("test_RoundTrip.xml");
- }
-
- // Drl Dumper test
-
- @Test
- public void testRoundTripComplexRuleDrl() throws Exception {
- DumperTestHelper.DrlFile("test_RoundTrip.drl");
- }
-
- @Test
- public void testRoundTripCollectDrl() throws Exception {
- DumperTestHelper.DrlFile("test_Collect.drl");
- }
-
- @Test
- public void testRoundTripAccumulateDrl() throws Exception {
- DumperTestHelper.DrlFile("test_accumulateall.drl");
- }
-
- @Test
- public void testRoundTripExistsDrl() throws Exception {
- DumperTestHelper.DrlFile("test_exists.drl");
- }
-
- @Test
- public void testRoundTripForallDrl() throws Exception {
- DumperTestHelper.DrlFile("test_Forall.drl");
- }
-
- @Test
- public void testRoundTripFromDrl() throws Exception {
- DumperTestHelper.DrlFile("test_from.drl");
- }
-
- @Test
- public void testRoundTripSimpleRuleDrl() throws Exception {
- DumperTestHelper.DrlFile("test_simplerule.drl");
- }
-
- @Test
- public void testRoundTripPComplexDrl() throws Exception {
- DumperTestHelper.DrlFile("test_complex.drl");
- }
-
- @Test
- public void testRoundTripDRLAnnotations() throws Exception {
- DumperTestHelper.DrlFile("test_DumpAnnotations.drl");
- }
-
- @Test
- public void testRoundTripDRLNamedConsequences() throws Exception {
- DumperTestHelper.DrlFile("test_NamedConsequences.drl");
- }
-
- @Test
- public void testRoundTripPComplexXml() throws Exception {
- DumperTestHelper.XmlFile("test_ParseComplex.xml");
- }
-
- @Test
- public void testRoundTripTraitDeclarations() throws Exception {
- DumperTestHelper.DrlFile("test_TraitDeclaration.drl");
-
- String out = DumperTestHelper.dump("test_TraitDeclaration.drl");
- assertThat(out).contains("declare trait Foo");
- }
-
- @Test
- public void testRoundTripEnumDeclarations() throws Exception {
- DumperTestHelper.DrlFile("test_EnumDeclaration.drl");
-
- String out = DumperTestHelper.dump("test_EnumDeclaration.drl");
- assertThat(out).contains("declare enum Planets", "MERCURY", "7.1492e7");
- }
-
- @Test
- public void testRoundTripAccumulate() throws Exception {
- String out = DumperTestHelper.dump("test_Accumulate.drl");
- assertThat(out).contains("$sum : count( $s1 )", "count( $s2 )").doesNotContain("null : count( $s2 )");
- }
-
- private void checkRoundtrip(String drl) throws DroolsParserException {
- DrlParser parser = new DrlParser(LanguageLevelOption.DRL6);
- final PackageDescr pkgOriginal = parser.parse(false, drl);
- final DrlDumper dumper = new DrlDumper();
- String out = dumper.dump(pkgOriginal);
- assertThat(drl).isEqualToIgnoringWhitespace(out);
- }
-
- @Test
- public void testRoundTripDRLAccumulate() throws Exception {
- // RHDM-254
- String drl =
- "package org.test\n" +
- "\n" +
- "rule \"last flown date\"\n" +
- "when\n" +
- " $customer : Profile( $ceid : id )\n" +
- " accumulate(\n" +
- " Flight( status == \"Flown\", $dptDate: departureDate.time ) from $customer.flights,\n" +
- " $cnt : count( $dptDate );\n" +
- " $cnt > 0 )\n" +
- "then\n" +
- "end";
-
- checkRoundtrip(drl);
- }
-
- @Test
- public void testRoundTripDRLAccumulateWith2Patterns() throws Exception {
- // DROOLS-5607
- String drl =
- "package org.example\n" +
- "declare Flight \n" +
- " pnrRecordLocator : String \n" +
- " flightSegmentDepartureIataCode : String \n" +
- " flightSegmentArrivalIataCode : String \n" +
- " id : int \n" +
- "end\n" +
- "\n" +
- "rule \"round trips accumulate\"\n" +
- "when\n" +
- " $roundTripSet : java.util.Set( size >= 1 ) from accumulate (\n" +
- " $f1:Flight()\n" +
- " and\n" +
- " $f2:Flight(\n" +
- " id > $f1.id,\n" +
- " pnrRecordLocator==$f1.pnrRecordLocator,\n" +
- " flightSegmentDepartureIataCode==$f1.flightSegmentArrivalIataCode,\n" +
- " flightSegmentArrivalIataCode==$f1.flightSegmentDepartureIataCode\n" +
- " )" +
- " , collectSet($f1.getId()) )\n" +
- "then\n" +
- " System.out.println($roundTripSet);\n" +
- "end";
-
- checkRoundtrip(drl);
- }
-
- @Test
- public void testAccumulateWithCustomImport() throws Exception {
- // DROOLS-5870
- String drl =
- "package org.example\n" +
- "import org.drools.Adult\n" +
- "import org.drools.Child\n" +
- "import org.drools.Result\n" +
- "import accumulate org.drools.TestFunction accfunc\n" +
- "rule \"R\" when\n" +
- " accumulate( $c : Child( age < 10 ) and $a : Adult( name == $c.parent ), $parentAge : accfunc($a.getAge()) )\n" +
- "then\n" +
- " insert(new Result($parentAge));\n" +
- "end";
-
- checkRoundtrip(drl);
- }
-
- @Test
- public void testAccumulateWithoutConstraint() throws Exception {
- // DROOLS-5872
-
- String expectedDrl =
- "package example \n" +
- "\n" +
- "import java.math.BigDecimal\n" +
- "\n" +
- "rule \"Test Rule\"\n" +
- "when\n" +
- " accumulate( \n" +
- " $target : example.RuleTest.Fact( ) ,\n" +
- " $cnt : count( ) \n" +
- " ) \n" +
- "then\n" +
- "System.out.println($cnt);\n" +
- "\n" +
- "end";
-
- PackageDescr packageDescr = DescrFactory.newPackage().name("example")
- .newImport().target("java.math.BigDecimal").end()
- .newRule().name("Test Rule")
- .lhs()
- .accumulate()
- .source().pattern().type("example.RuleTest.Fact").id("$target", false)
- .end()
- .end()
- .function("count", "$cnt", false)
- .end()
- .end()
- .rhs("System.out.println($cnt);")
- .end()
- .end().getDescr();
-
- String drl = new DrlDumper().dump(packageDescr);
-
- assertThat(drl).isEqualToIgnoringWhitespace(expectedDrl);
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/xml/DumperTestHelper.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/xml/DumperTestHelper.java
deleted file mode 100644
index a7ecb91affa..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/xml/DumperTestHelper.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.xml;
-
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.StringReader;
-
-import org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl;
-import org.drools.drl.ast.descr.PackageDescr;
-import org.drools.drl.parser.DrlParser;
-import org.drools.mvel.DrlDumper;
-import org.jbpm.compiler.xml.compiler.SemanticKnowledgeBuilderConfigurationImpl;
-import org.jbpm.compiler.xml.compiler.XmlDumper;
-import org.jbpm.compiler.xml.compiler.XmlPackageReader;
-import org.kie.internal.builder.KnowledgeBuilderFactory;
-import org.kie.internal.builder.conf.LanguageLevelOption;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * Helper Class for both xml and drl Dump Tests
- */
-public class DumperTestHelper {
-
- public static void XmlFile(String filename) throws Exception {
- SemanticKnowledgeBuilderConfigurationImpl conf =
- (SemanticKnowledgeBuilderConfigurationImpl) KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration().as(KnowledgeBuilderConfigurationImpl.KEY);
-
- XmlPackageReader xmlPackageReader = new XmlPackageReader(conf.getSemanticModules());
- xmlPackageReader.getParser().setClassLoader(DumperTestHelper.class.getClassLoader());
- xmlPackageReader.read(new InputStreamReader(DumperTestHelper.class.getResourceAsStream(filename)));
- final PackageDescr pkgOriginal = xmlPackageReader.getPackageDescr();
-
- final XmlDumper dumper = new XmlDumper();
- final String result = dumper.dump(pkgOriginal);
-
- String buffer = readFile(filename);
-
- System.out.println(buffer);
- System.out.println(result);
-
- assertThat(buffer).isEqualToIgnoringWhitespace(result);
- assertThat(result).isNotNull();
- }
-
- public static void DrlFile(String filename) throws Exception {
-
- DrlParser parser = new DrlParser(LanguageLevelOption.DRL5);
- final PackageDescr pkgOriginal = parser.parse(new InputStreamReader(DumperTestHelper.class.getResourceAsStream(filename)));
- final DrlDumper dumper = new DrlDumper();
- String result1 = dumper.dump(pkgOriginal);
- final PackageDescr pkgDerivated = parser.parse(new StringReader(result1));
- String result2 = dumper.dump(pkgDerivated);
- System.out.println(result1);
-
- assertThat(result1).isEqualToIgnoringWhitespace(result2);
- }
-
- public static String dump(String filename) throws Exception {
- DrlParser parser = new DrlParser(LanguageLevelOption.DRL6);
- final PackageDescr pkgOriginal = parser.parse(new InputStreamReader(DumperTestHelper.class.getResourceAsStream(filename)));
- final DrlDumper dumper = new DrlDumper();
- return dumper.dump(pkgOriginal);
- }
-
- private static String readFile(final String file) throws IOException {
- final InputStreamReader reader = new InputStreamReader(DumperTestHelper.class.getResourceAsStream(file));
- final StringBuilder text = new StringBuilder();
- final char[] buf = new char[1024];
- int len = 0;
-
- while ((len = reader.read(buf)) >= 0) {
- text.append(buf,
- 0,
- len);
- }
- return text.toString();
- }
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/xml/XmlPackageReaderTest.java b/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/xml/XmlPackageReaderTest.java
deleted file mode 100644
index 34e07914080..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/java/org/jbpm/xml/XmlPackageReaderTest.java
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.jbpm.xml;
-
-import java.io.InputStreamReader;
-import java.util.List;
-
-import org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl;
-import org.drools.drl.ast.descr.AccumulateDescr;
-import org.drools.drl.ast.descr.AndDescr;
-import org.drools.drl.ast.descr.ExistsDescr;
-import org.drools.drl.ast.descr.ExprConstraintDescr;
-import org.drools.drl.ast.descr.ForallDescr;
-import org.drools.drl.ast.descr.FromDescr;
-import org.drools.drl.ast.descr.FunctionDescr;
-import org.drools.drl.ast.descr.FunctionImportDescr;
-import org.drools.drl.ast.descr.GlobalDescr;
-import org.drools.drl.ast.descr.ImportDescr;
-import org.drools.drl.ast.descr.MVELExprDescr;
-import org.drools.drl.ast.descr.NotDescr;
-import org.drools.drl.ast.descr.PackageDescr;
-import org.drools.drl.ast.descr.PatternDescr;
-import org.drools.drl.ast.descr.QueryDescr;
-import org.drools.drl.ast.descr.RuleDescr;
-import org.drools.mvel.DrlDumper;
-import org.drools.util.StringUtils;
-import org.jbpm.compiler.xml.compiler.SemanticKnowledgeBuilderConfigurationImpl;
-import org.jbpm.compiler.xml.compiler.XmlPackageReader;
-import org.junit.jupiter.api.Test;
-import org.kie.internal.builder.KnowledgeBuilderFactory;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class XmlPackageReaderTest {
-
- @Test
- public void testParseFrom() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_ParseFrom.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
- assertThat(packageDescr).isNotNull();
- RuleDescr obj = packageDescr.getRules().get(0);
- PatternDescr patterndescr = (PatternDescr) obj.getLhs().getDescrs().get(0);
-
- FromDescr from = (FromDescr) patterndescr.getSource();
-
- MVELExprDescr accessordescriptor = (MVELExprDescr) from.getDataSource();
- assertThat(accessordescriptor.getExpression()).isEqualTo("cheesery.getCheeses(i+4)");
-
- assertThat(patterndescr.getObjectType()).isEqualTo("Cheese");
- assertThat(patterndescr.getIdentifier()).isEqualTo("cheese");
-
- }
-
- @Test
- public void testAccumulate() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_ParseAccumulate.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
- assertThat(packageDescr).isNotNull();
- RuleDescr obj = (RuleDescr) packageDescr.getRules().get(0);
-
- Object patternobj = obj.getLhs().getDescrs().get(0);
- assertThat(patternobj).isInstanceOf(PatternDescr.class);
- final PatternDescr patterncheese = (PatternDescr) patternobj;
- assertThat(patterncheese.getIdentifier()).isEqualTo("cheese");
- assertThat(patterncheese.getObjectType()).isEqualTo("Cheese");
-
- AccumulateDescr accumulatedescr = (AccumulateDescr) patterncheese.getSource();
- assertThat(accumulatedescr.getActionCode()).isEqualTo("total += $cheese.getPrice();");
- assertThat(accumulatedescr.getInitCode()).isEqualTo("int total = 0;");
- assertThat(accumulatedescr.getResultCode()).isEqualTo("new Integer( total ) );");
-
- patternobj = obj.getLhs().getDescrs().get(1);
- assertThat(patternobj).isInstanceOf(PatternDescr.class);
-
- final PatternDescr patternmax = (PatternDescr) patternobj;
- assertThat(patternmax.getIdentifier()).isEqualTo("max");
- assertThat(patternmax.getObjectType()).isEqualTo("Number");
-
- accumulatedescr = (AccumulateDescr) patternmax.getSource();
-
- assertThat(accumulatedescr.isExternalFunction()).isTrue();
-
- assertThat(accumulatedescr.getFunctions().get(0).getFunction()).isEqualTo("max");
-
- assertThat(accumulatedescr.getInitCode()).isNull();
- assertThat(accumulatedescr.getActionCode()).isNull();
- assertThat(accumulatedescr.getResultCode()).isNull();
- assertThat(accumulatedescr.getReverseCode()).isNull();
-
- }
-
- @Test
- public void testAccumulateMultiPattern() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_ParseAccumulate.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
- assertThat(packageDescr).isNotNull();
- RuleDescr obj = (RuleDescr) packageDescr.getRules().get(1);
-
- Object patternobj = obj.getLhs().getDescrs().get(0);
- assertThat(patternobj).isInstanceOf(PatternDescr.class);
- final PatternDescr patterncheese = (PatternDescr) patternobj;
- assertThat(patterncheese.getIdentifier()).isEqualTo("cheese");
- assertThat(patterncheese.getObjectType()).isEqualTo("Cheese");
-
- AccumulateDescr accumulatedescr = (AccumulateDescr) patterncheese.getSource();
- assertThat(accumulatedescr.getActionCode()).isEqualTo("total += $cheese.getPrice();");
- assertThat(accumulatedescr.getInitCode()).isEqualTo("int total = 0;");
- assertThat(accumulatedescr.getResultCode()).isEqualTo("new Integer( total ) );");
-
- AndDescr anddescr = (AndDescr) accumulatedescr.getInput();
-
- List descrlist = anddescr.getDescrs();
-
- PatternDescr[] listpattern = (PatternDescr[]) descrlist.toArray(new PatternDescr[descrlist.size()]);
-
- assertThat(listpattern[0].getObjectType()).isEqualTo("Milk");
- assertThat(listpattern[1].getObjectType()).isEqualTo("Cup");
- }
-
- @Test
- public void testParseForall() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_ParseForall.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
- assertThat(packageDescr).isNotNull();
-
- RuleDescr obj = (RuleDescr) packageDescr.getRules().get(0);
- ForallDescr forall = (ForallDescr) obj.getLhs().getDescrs().get(0);
- List forallPaterns = forall.getDescrs();
-
- PatternDescr pattarnState = (PatternDescr) forallPaterns.get(0);
- PatternDescr personState = (PatternDescr) forallPaterns.get(1);
- PatternDescr cheeseState = (PatternDescr) forallPaterns.get(2);
-
- assertThat(pattarnState.getObjectType()).isEqualTo("State");
- assertThat(personState.getObjectType()).isEqualTo("Person");
- assertThat(cheeseState.getObjectType()).isEqualTo("Cheese");
- }
-
- @Test
- public void testParseExists() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_ParseExists.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
- assertThat(packageDescr).isNotNull();
-
- RuleDescr obj = (RuleDescr) packageDescr.getRules().get(0);
- Object existdescr = obj.getLhs().getDescrs().get(0);
- assertThat(existdescr).isInstanceOf(ExistsDescr.class);
-
- Object patternDescriptor = ((ExistsDescr) existdescr).getDescrs().get(0);
- assertThat(patternDescriptor).isInstanceOf(PatternDescr.class);
- assertThat(((PatternDescr) patternDescriptor).getObjectType()).isEqualTo("Person");
-
- Object notDescr = obj.getLhs().getDescrs().get(1);
-
- assertThat(NotDescr.class.getName()).isEqualTo(notDescr.getClass().getName());
- existdescr = ((NotDescr) notDescr).getDescrs().get(0);
- patternDescriptor = ((ExistsDescr) existdescr).getDescrs().get(0);
- assertThat(patternDescriptor).isInstanceOf(PatternDescr.class);
- assertThat(((PatternDescr) patternDescriptor).getObjectType()).isEqualTo("Cheese");
- }
-
- @Test
- public void testParseCollect() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_ParseCollect.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
-
- String expected = StringUtils.readFileAsString(new InputStreamReader(getClass().getResourceAsStream("test_ParseCollect.drl")));
- String expectedWithoutHeader = removeLicenseHeader(expected);
- String actual = new DrlDumper().dump(packageDescr);
-
- assertThat(expectedWithoutHeader).isEqualToIgnoringWhitespace(actual);
- }
-
- @Test
- public void testParsePackageName() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_ParsePackageName.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
- assertThat(packageDescr).isNotNull();
- assertThat(packageDescr.getName()).isEqualTo("com.sample");
- }
-
- @Test
- public void testParseImport() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_ParseImport.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
- assertThat(packageDescr).isNotNull();
- assertThat(packageDescr.getName()).isEqualTo("com.sample");
-
- final List imports = packageDescr.getImports();
- assertThat(imports).hasSize(2);
- assertThat(((ImportDescr) imports.get(0)).getTarget()).isEqualTo("java.util.HashMap");
- assertThat(((ImportDescr) imports.get(1)).getTarget()).isEqualTo("org.drools.mvel.compiler.*");
-
- final List functionImport = packageDescr.getFunctionImports();
-
- assertThat(((FunctionImportDescr) functionImport.get(0)).getTarget()).isEqualTo("org.drools.function");
- }
-
- @Test
- public void testParseGlobal() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_ParseGlobal.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
- assertThat(packageDescr).isNotNull();
- assertThat(packageDescr.getName()).isEqualTo("com.sample");
-
- final List imports = packageDescr.getImports();
- assertThat(imports).hasSize(2);
- assertThat(((ImportDescr) imports.get(0)).getTarget()).isEqualTo("java.util.HashMap");
- assertThat(((ImportDescr) imports.get(1)).getTarget()).isEqualTo("org.drools.mvel.compiler.*");
-
- final List globals = packageDescr.getGlobals();
- assertThat(globals).hasSize(2);
- final GlobalDescr x = (GlobalDescr) globals.get(0);
- final GlobalDescr yada = (GlobalDescr) globals.get(1);
- assertThat(x.getType()).isEqualTo("com.sample.X");
- assertThat(x.getIdentifier()).isEqualTo("x");
- assertThat(yada.getType()).isEqualTo("com.sample.Yada");
- assertThat(yada.getIdentifier()).isEqualTo("yada");
- }
-
- @Test
- public void testParseFunction() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_ParseFunction.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
- assertThat(packageDescr).isNotNull();
- assertThat(packageDescr.getName()).isEqualTo("com.sample");
-
- final List imports = packageDescr.getImports();
- assertThat(imports).hasSize(2);
- assertThat(((ImportDescr) imports.get(0)).getTarget()).isEqualTo("java.util.HashMap");
- assertThat(((ImportDescr) imports.get(1)).getTarget()).isEqualTo("org.drools.mvel.compiler.*");
-
- final List globals = packageDescr.getGlobals();
- assertThat(globals).hasSize(2);
- final GlobalDescr x = (GlobalDescr) globals.get(0);
- final GlobalDescr yada = (GlobalDescr) globals.get(1);
- assertThat(x.getType()).isEqualTo("com.sample.X");
- assertThat(x.getIdentifier()).isEqualTo("x");
- assertThat(yada.getType()).isEqualTo("com.sample.Yada");
- assertThat(yada.getIdentifier()).isEqualTo("yada");
-
- final FunctionDescr functionDescr = (FunctionDescr) packageDescr.getFunctions().get(0);
- final List names = functionDescr.getParameterNames();
- assertThat(names.get(0)).isEqualTo("foo");
- assertThat(names.get(1)).isEqualTo("bada");
-
- final List types = functionDescr.getParameterTypes();
- assertThat(types.get(0)).isEqualTo("Bar");
- assertThat(types.get(1)).isEqualTo("Bing");
-
- assertThat(functionDescr.getText().trim()).isEqualTo("System.out.println(\"hello world\");");
- }
-
- @Test
- public void testParseRule() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_ParseRule.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
-
- String expected = StringUtils.readFileAsString(new InputStreamReader(getClass().getResourceAsStream("test_ParseRule.drl")));
- // remove license header as that one is not stored in the XML
- String expectedWithoutHeader = removeLicenseHeader(expected);
- System.out.println(expectedWithoutHeader);
- String actual = new DrlDumper().dump(packageDescr);
-
- assertThat(expectedWithoutHeader).isEqualToIgnoringWhitespace(actual);
- }
-
- @Test
- public void testParseSimpleRule() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_SimpleRule1.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
- assertThat(packageDescr).isNotNull();
- assertThat(packageDescr.getName()).isEqualTo("com.sample");
-
- final List imports = packageDescr.getImports();
- assertThat(imports).hasSize(2);
- assertThat(((ImportDescr) imports.get(0)).getTarget()).isEqualTo("java.util.List");
- assertThat(((ImportDescr) imports.get(1)).getTarget()).isEqualTo("org.drools.mvel.compiler.Person");
-
- RuleDescr ruleDescr = (RuleDescr) packageDescr.getRules().get(0);
- assertThat(ruleDescr.getName()).isEqualTo("simple_rule1");
- AndDescr lhs = ruleDescr.getLhs();
- PatternDescr patternDescr = (PatternDescr) lhs.getDescrs().get(0);
- assertThat(patternDescr.getObjectType()).isEqualTo("Person");
- ExprConstraintDescr expr = (ExprConstraintDescr) ((AndDescr) patternDescr.getConstraint()).getDescrs().get(0);
- assertThat(expr.getExpression()).isEqualTo("name == \"darth\"");
-
- ruleDescr = (RuleDescr) packageDescr.getRules().get(1);
- assertThat(ruleDescr.getName()).isEqualTo("simple_rule2");
- lhs = ruleDescr.getLhs();
- patternDescr = (PatternDescr) lhs.getDescrs().get(0);
- assertThat(patternDescr.getObjectType()).isEqualTo("Person");
- expr = (ExprConstraintDescr) ((AndDescr) patternDescr.getConstraint()).getDescrs().get(0);
- assertThat(expr.getExpression()).isEqualTo("age == 35 || == -3.5");
-
- ruleDescr = (RuleDescr) packageDescr.getRules().get(2);
- assertThat(ruleDescr.getName()).isEqualTo("simple_rule3");
- lhs = ruleDescr.getLhs();
- patternDescr = (PatternDescr) lhs.getDescrs().get(0);
- assertThat(patternDescr.getObjectType()).isEqualTo("Person");
- expr = (ExprConstraintDescr) ((AndDescr) patternDescr.getConstraint()).getDescrs().get(0);
- assertThat(expr.getExpression()).isEqualTo("age == 35 || (!= 7.0 && != -70)");
-
- ruleDescr = (RuleDescr) packageDescr.getRules().get(3);
- assertThat(ruleDescr.getName()).isEqualTo("simple_rule3");
- lhs = ruleDescr.getLhs();
- patternDescr = (PatternDescr) lhs.getDescrs().get(1);
- assertThat(patternDescr.getObjectType()).isEqualTo("Person");
- expr = (ExprConstraintDescr) ((AndDescr) patternDescr.getConstraint()).getDescrs().get(0);
- assertThat(expr.getExpression()).isEqualTo("name == $s");
-
- ruleDescr = (RuleDescr) packageDescr.getRules().get(4);
- assertThat(ruleDescr.getName()).isEqualTo("simple_rule4");
- lhs = ruleDescr.getLhs();
- patternDescr = (PatternDescr) lhs.getDescrs().get(1);
- assertThat(patternDescr.getObjectType()).isEqualTo("Person");
- expr = (ExprConstraintDescr) ((AndDescr) patternDescr.getConstraint()).getDescrs().get(0);
- assertThat(expr.getExpression()).isEqualTo("(name == $s) || (age == 35 || (!= 7.0 && != -70))");
-
- ruleDescr = (RuleDescr) packageDescr.getRules().get(5);
- assertThat(ruleDescr.getName()).isEqualTo("simple_rule5");
- lhs = ruleDescr.getLhs();
- patternDescr = (PatternDescr) lhs.getDescrs().get(1);
- assertThat(patternDescr.getObjectType()).isEqualTo("Person");
- expr = (ExprConstraintDescr) ((AndDescr) patternDescr.getConstraint()).getDescrs().get(0);
- assertThat(expr.getExpression()).isEqualTo("(name == $s) || ((age != 34) && (age != 37) && (name != \"yoda\"))");
-
- }
-
- @Test
- public void testParseLhs() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_ParseLhs.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
-
- String expected = StringUtils.readFileAsString(new InputStreamReader(getClass().getResourceAsStream("test_ParseLhs.drl")));
- String expectedWithoutHeader = removeLicenseHeader(expected);
- String actual = new DrlDumper().dump(packageDescr);
-
- assertThat(expectedWithoutHeader).isEqualToIgnoringWhitespace(actual);
- }
-
- @Test
- public void testParseRhs() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_ParseRhs.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
- assertThat(packageDescr).isNotNull();
- assertThat(packageDescr.getName()).isEqualTo("com.sample");
-
- final List imports = packageDescr.getImports();
- assertThat(imports).hasSize(2);
- assertThat(((ImportDescr) imports.get(0)).getTarget()).isEqualTo("java.util.HashMap");
- assertThat(((ImportDescr) imports.get(1)).getTarget()).isEqualTo("org.drools.mvel.compiler.*");
-
- final List globals = packageDescr.getGlobals();
- assertThat(globals).hasSize(2);
- final GlobalDescr x = (GlobalDescr) globals.get(0);
- final GlobalDescr yada = (GlobalDescr) globals.get(1);
- assertThat(x.getType()).isEqualTo("com.sample.X");
- assertThat(x.getIdentifier()).isEqualTo("x");
- assertThat(yada.getType()).isEqualTo("com.sample.Yada");
- assertThat(yada.getIdentifier()).isEqualTo("yada");
-
- final FunctionDescr functionDescr = (FunctionDescr) packageDescr.getFunctions().get(0);
- final List names = functionDescr.getParameterNames();
- assertThat(names.get(0)).isEqualTo("foo");
- assertThat(names.get(1)).isEqualTo("bada");
-
- final List types = functionDescr.getParameterTypes();
- assertThat(types.get(0)).isEqualTo("Bar");
- assertThat(types.get(1)).isEqualTo("Bing");
-
- assertThat(functionDescr.getText().trim()).isEqualTo("System.out.println(\"hello world\");");
-
- final RuleDescr ruleDescr = (RuleDescr) packageDescr.getRules().get(0);
- assertThat(ruleDescr.getName()).isEqualTo("my rule");
-
- final String consequence = (String) ruleDescr.getConsequence();
- assertThat(consequence).isNotNull();
- assertThat(consequence.trim()).isEqualTo("System.out.println( \"hello\" );");
- }
-
- @Test
- public void testParseQuery() throws Exception {
- final XmlPackageReader xmlPackageReader = getXmReader();
- xmlPackageReader.read(new InputStreamReader(getClass().getResourceAsStream("test_ParseQuery.xml")));
- final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();
- assertThat(packageDescr).isNotNull();
- assertThat(packageDescr.getName()).isEqualTo("com.sample");
-
- final List imports = packageDescr.getImports();
- assertThat(imports).hasSize(2);
- assertThat(((ImportDescr) imports.get(0)).getTarget()).isEqualTo("java.util.HashMap");
- assertThat(((ImportDescr) imports.get(1)).getTarget()).isEqualTo("org.drools.mvel.compiler.*");
-
- final List globals = packageDescr.getGlobals();
- assertThat(globals).hasSize(2);
- final GlobalDescr x = (GlobalDescr) globals.get(0);
- final GlobalDescr yada = (GlobalDescr) globals.get(1);
- assertThat(x.getType()).isEqualTo("com.sample.X");
- assertThat(x.getIdentifier()).isEqualTo("x");
- assertThat(yada.getType()).isEqualTo("com.sample.Yada");
- assertThat(yada.getIdentifier()).isEqualTo("yada");
-
- final FunctionDescr functionDescr = (FunctionDescr) packageDescr.getFunctions().get(0);
- final List names = functionDescr.getParameterNames();
- assertThat(names.get(0)).isEqualTo("foo");
- assertThat(names.get(1)).isEqualTo("bada");
-
- final List types = functionDescr.getParameterTypes();
- assertThat(types.get(0)).isEqualTo("Bar");
- assertThat(types.get(1)).isEqualTo("Bing");
-
- assertThat(functionDescr.getText().trim()).isEqualTo("System.out.println(\"hello world\");");
-
- final QueryDescr queryDescr = (QueryDescr) packageDescr.getRules().get(0);
- assertThat(queryDescr.getName()).isEqualTo("my query");
-
- final AndDescr lhs = queryDescr.getLhs();
- assertThat(lhs.getDescrs()).hasSize(1);
- final PatternDescr patternDescr = (PatternDescr) lhs.getDescrs().get(0);
- assertThat(patternDescr.getObjectType()).isEqualTo("Foo");
-
- }
-
- private XmlPackageReader getXmReader() {
- SemanticKnowledgeBuilderConfigurationImpl conf =
- (SemanticKnowledgeBuilderConfigurationImpl) KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration().as(KnowledgeBuilderConfigurationImpl.KEY);
- XmlPackageReader xmlReader = new XmlPackageReader(conf.getSemanticModules());
- xmlReader.getParser().setClassLoader(XmlPackageReaderTest.class.getClassLoader());
-
- return xmlReader;
- }
-
- private String removeLicenseHeader(String content) {
- String[] lines = content.trim().split("\n");
- StringBuilder result = new StringBuilder();
- if (lines.length > 1 && lines[0].startsWith("/*")) {
- boolean inHeader = true;
- for (String line : lines) {
- if (line.trim().startsWith("package")) {
- inHeader = false;
- }
- if (!inHeader) {
- result.append(line);
- result.append("\n");
- }
- }
- return result.toString();
- } else {
- return content;
- }
- }
-
-}
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/compiler/xml/XmlTest.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/compiler/xml/XmlTest.xml
deleted file mode 100755
index b617d393e16..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/compiler/xml/XmlTest.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
- list.add( "action node was here" );
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/compiler/xml/processes/ActionNodeTest.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/compiler/xml/processes/ActionNodeTest.xml
deleted file mode 100755
index 8d236511a62..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/compiler/xml/processes/ActionNodeTest.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
- list.add( "action node was here" );
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/integrationtests/marshalling/simpleProcess.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/integrationtests/marshalling/simpleProcess.xml
deleted file mode 100755
index 35204f42260..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/integrationtests/marshalling/simpleProcess.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
- list.add( Boolean.TRUE );
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/integrationtests/test_ConstraintDialects.rfm b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/integrationtests/test_ConstraintDialects.rfm
deleted file mode 100755
index 29ff8980d76..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/integrationtests/test_ConstraintDialects.rfm
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-
-
- list : List();
-eval( list.contains( 6 ) )
- list : List();
-eval( list.contains( 25 ) )
- return inList.contains( 1 );
- return inList.contains( 3 );
-
-
-
- outList.add("MVELRuleConstraint was here");
-
-
- outList.add("JavaRuleConstraint was here");
-
-
- outList.add("MVELCodeConstraint was here");
-
-
- outList.add("JavaCodeConstraint was here");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/integrationtests/test_ProcessMultithreadEvent.rf b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/integrationtests/test_ProcessMultithreadEvent.rf
deleted file mode 100755
index a5fb4fb2866..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/integrationtests/test_ProcessMultithreadEvent.rf
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- kcontext.setVariable("var", "action1"); try { Thread.sleep(3000); } catch (Throwable t) {} list.add(kcontext.getVariable("var"));
-
-
-
-
-
-
-
- kcontext.setVariable("var", "action2"); try { Thread.sleep(3000); } catch (Throwable t) {} list.add(kcontext.getVariable("var"));
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/integrationtests/test_modifyWithRuleflowAndSubnetwork.rf b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/integrationtests/test_modifyWithRuleflowAndSubnetwork.rf
deleted file mode 100755
index b345286cdd2..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/integrationtests/test_modifyWithRuleflowAndSubnetwork.rf
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_Accumulate.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_Accumulate.drl
deleted file mode 100644
index adf171a3894..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_Accumulate.drl
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.test;
-
-rule R1 when
- accumulate( $s1: String(), $sum : count( $s1 ) )
-then
- System.out.println( $sum );
-end
-
-rule R2 when
- $sum : Number() from accumulate( $s2: String(), count( $s2 ) )
-then
- System.out.println( $sum );
-end
\ No newline at end of file
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_Collect.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_Collect.drl
deleted file mode 100755
index 8f46ba8d335..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_Collect.drl
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.drools.compiler.test;
-
-import org.drools.mvel.compiler.Cheese;
-import org.drools.mvel.compiler.Person;
-import java.util.ArrayList;
-
-global java.util.List results;
-
-rule "Collect Test" salience 70
- when
- $person : Person( name == "Bob", $likes : likes )
- $cheeseList : ArrayList(size > 2) from collect( Cheese( type == $likes ) );
- then
- //System.out.println($person.getName() +" will buy "+ $cheeseList.size() + " pieces of cheese");
- results.add($cheeseList);
-end
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_Dump.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_Dump.drl
deleted file mode 100644
index 0b167734e84..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_Dump.drl
+++ /dev/null
@@ -1,24 +0,0 @@
-package foo;
-
-rule "simple_rule"
- salience 10
- no-loop true
- agenda-group "agenda-group"
- activation-group "activation-group"
- when
- foo2 : Bar( a ( > 60 && < 70 ) || ( > 50 && < 55 ) && a3 == "black" || a == 40 && a3 == "pink" || a == 12 && a3 == "yellow" || a3 == "blue")
- foo3 : Bar( a == 3 || == 4, a3 == "hello", a4 == null )
- foo4 : Bar( a4 : a != 4 && != 5)
- foo5 : Bar( b == (a4 + 1) || > a4)
- foo6 : Bar( a4 : a, b == 6)
- foo7 : Bar( a4 : a, b4 : b)
- $cheeseList : ArrayList(size > 2) from collect( Cheese( type == $likes ) );
- Baz()
- then
- if ( a == b ) {
- assert( foo3 );
- } else {
- retract( foo4 );
- }
- System.out.println( a4 );
-end
\ No newline at end of file
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_DumpAnnotations.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_DumpAnnotations.drl
deleted file mode 100644
index 40e9c091bda..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_DumpAnnotations.drl
+++ /dev/null
@@ -1,17 +0,0 @@
-package foo
-
-declare SomeEvent
- @role( event )
- @author( name = "Bob" )
- @copyright( year = "2011", license="ASL" )
-end
-
-rule "simple_rule"
- @role( event )
- @author( name = "Bob" )
- @copyright( year = "2011", license="ASL" )
-when
- Foo( )
-then
- System.out.println( "bar" );
-end
\ No newline at end of file
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_EnumDeclaration.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_EnumDeclaration.drl
deleted file mode 100644
index c8c4842fe8b..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_EnumDeclaration.drl
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.test;
-
-declare enum Planets
- MERCURY ( 3.303e+23, 2.4397e6, new String("Mer") + new String("cury").substring(0) ),
- VENUS ( 4.869e+24, 6.0518e6, "Venus" ),
- EARTH ( 5.976e+24, 6.37814e6, "Earth" ),
- MARS ( 6.421e+23, 3.3972e6, "Mars" ),
- JUPITER ( 1.9e+27, 7.1492e7, "Jupiter" ),
- SATURN ( 5.688e+26, 6.0268e7, "Saturn" ),
- URANUS ( 8.686e+25, 2.5559e7, "Uranus" ),
- NEPTUNE ( 1.024e+26, 2.4746e7, "Neptune" );
-
- mass : double
- radius : double
- name : String
-
-end
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_Forall.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_Forall.drl
deleted file mode 100755
index e25ab4de98a..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_Forall.drl
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.drools.mvel.compiler
-
-global java.util.List results;
-
-rule "test nested CEs"
- when
- forall( State( $state : state )
- Person( status == $state, $likes : likes )
- Cheese( type == $likes ) )
- then
- results.add("OK");
-end
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_NamedConsequences.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_NamedConsequences.drl
deleted file mode 100644
index 1aa27f82924..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_NamedConsequences.drl
+++ /dev/null
@@ -1,10 +0,0 @@
-package foo;
-
-rule "simple_rule"
-when
- String() do[x]
-then
- System.out.println( "bar" );
-then[x]
- System.out.println( "foo" );
-end
\ No newline at end of file
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseAccumulate.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseAccumulate.xml
deleted file mode 100644
index d9393a26b40..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseAccumulate.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- int total = 0;
-
-
- total += $cheese.getPrice();
-
-
- new Integer( total ) );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- list1.add( $cheese );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- int total = 0;
-
-
- total += $cheese.getPrice();
-
-
- new Integer( total ) );
-
-
-
-
-
-
- list1.add( $cheese );
-
-
-
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseCollect.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseCollect.drl
deleted file mode 100644
index eed3a0b24a0..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseCollect.drl
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.sample
-
-import import java.util.List
-import org.drools.compiler.Cheese
-import org.drools.compiler.Cheesery
-
-global Cheesery cheesery
-global List list
-
-rule "simple_rule"
- salience 10
- no-loop true
- agenda-group agenda-group
- activation-group activation-group
-when
- cheese : Cheese( type == 1 ) from collect( Person( hair == "pink" ) )
-then
- list.add( $cheese ); end
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseCollect.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseCollect.xml
deleted file mode 100644
index 9d8f3f33ba3..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseCollect.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- type == 1
-
-
-
-
-
-
-
- hair == "pink"
-
-
-
-
-
-
-
-
-
-
- list.add( $cheese );
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseComplex.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseComplex.xml
deleted file mode 100644
index a73e13f31c8..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseComplex.xml
+++ /dev/null
@@ -1,228 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-artigoID == 3
-
-
-
-
-
-
-
-
-
-
-
-
-inspectionActionID == InspectionAction
-
-
-
-
-
-
-
-
-inspAccaoOperacaoID == inspectionActionOperation
-
-
-
-
-
-
-
-
-operacaoID == operation
-
-
-recursoID == resource
-
-
-
-
-
-
-
-
-insert(new MelhorEmNaoConformidades(ProductionOrder,NCNumber,operation,resource));
-
-
-
-
-artigoID == 3
-
-
-
-
-
-
-
-
-
-
-
-
-inspectionActionID == InspectionAction
-
-
-
-
-
-
-
-
-inspAccaoOperacaoID == inspectionActionOperation
-
-
-
-
-
-
-
-
-operacaoID == operation
-
-
-recursoID == resource
-
-
-numeroDefeitos > NCNumber
-
-
-
-
-
-
-TheBest.setNumeroDefeitos(NCNumber);
-TheBest.setOrdemProducaoID(ProductionOrder);
-update(TheBest);
-
-
-
-
-
-
-
-
-
-
-
-
-
-productionOrderID == $poID
-
-
-
-
-
-
-
-
-setupUseID == $setup
-
-
-
-
-
-
-
-
-parameterID == $parID
-
-
-
-
-
-
-
-
-BestParms newBest=new BestParms();
-newBest.setParameterID($parID);
-newBest.setNominalValue(new Float($p.getNominalValue()));
-newBest.setMaxLimit(new Float($p.getMaxLimit()));
-newBest.setMinLimit(new Float($p.getMinLimit()));
-newBest.setMaxLimitAlarm(new Float($p.getMaxLimitAlarm()));
-newBest.setMinLimitAlarm(new Float($p.getMinLimitAlarm()));
-newBest.setNonConformities(new Float($NC));
-insert(newBest);
-
-
-
-
-
-
-
-
-
-
-
-
-
-productionOrderID == $poID
-
-
-
-
-
-
-
-
-setupUseID == $setup
-
-
-
-
-
-
-
-
-parameterID == $parID
-
-
-nonConformities > $NC
-
-
-
-
-
-
-$newBest.setNominalValue(new Float(p.getNominalValue()));
-$newBest.setMaxLimit(new Float(p.getMaxLimit()));
-$newBest.setMinLimit(new Float(p.getMinLimit()));
-$newBest.setMaxLimitAlarm(new Float(p.getMaxLimitAlarm()));
-$newBest.setMinLimitAlarm(new Float(p.getMinLimitAlarm()));
-$newBest.setNonConformities(new Float($NC));
-update($newBest);
-
-
-
-
-
-
-
-
-
-
-System.out.println("Parameter: "+bp.getParameterID()+" Value: "+bp.getNominalValue()+" NC: "+bp.getNonConformities());
-
-
-
\ No newline at end of file
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseExists.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseExists.xml
deleted file mode 100644
index 50f9744b2ee..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseExists.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-likes == type
-
-
-
-
-
-
-
-
-likes == type
-
-
-
-
-
- list.add( $cheese );
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseForall.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseForall.xml
deleted file mode 100644
index 8ca06507c2c..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseForall.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- status == state
-
-
-
-
-
-
-
-
-
-
-
- results.add("OK");
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseFrom.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseFrom.xml
deleted file mode 100644
index cb705188730..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseFrom.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- cheesery.getCheeses(i+4)
-
-
-
-
-
- list1.add( $cheese );
-
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseFunction.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseFunction.xml
deleted file mode 100644
index 0dc5932eec0..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseFunction.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- System.out.println("hello world");
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseGlobal.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseGlobal.xml
deleted file mode 100644
index 913c4dde143..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseGlobal.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseImport.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseImport.xml
deleted file mode 100644
index 04853ea8562..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseImport.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseLhs.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseLhs.drl
deleted file mode 100644
index 4afd987e3ea..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseLhs.drl
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.sample
-
-import java.util.HashMap
-import org.drools.compiler.*
-
-global com.sample.X x
-global com.sample.Yada yada
-
-function void myFunc( Bar foo, Bing bada ) {
-
- System.out.println("hello world");
-
-}
-
-
-rule "my rule"
-when
- Foo( )
- bar : Bar( )
- Foo( var1 : field1, field1 == "value1" && == (1==1) && == var1, eval(1==1) )
- not(
- Bar( ) )
- exists(
- Bar( ) )
-
- (Yada( )
- and
- Bar( ))
-
- (Zaa( )
- or
- Foo( ))
-
- eval( 1==1 )
-then
-
- end
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseLhs.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseLhs.xml
deleted file mode 100644
index 30f0eb20d70..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseLhs.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- System.out.println("hello world");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1==1
-
-
-
- 1==1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1==1
-
-
-
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParsePackageName.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParsePackageName.xml
deleted file mode 100644
index 5b5de775daa..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParsePackageName.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseQuery.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseQuery.xml
deleted file mode 100644
index 7150ec959e9..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseQuery.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- System.out.println("hello world");
-
-
-
-
-
-
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseRhs.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseRhs.xml
deleted file mode 100644
index b24f8c3f884..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseRhs.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- System.out.println("hello world");
-
-
-
-
-
-
-
-
- System.out.println( "hello" );
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseRule.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseRule.drl
deleted file mode 100644
index 1aa47493da8..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseRule.drl
+++ /dev/null
@@ -1,56 +0,0 @@
-package com.sample
-
-import java.util.HashMap
-import org.drools.compiler.*
-
-global com.sample.X x
-global com.sample.Yada yada
-
-function void myFunc( Bar foo, Bing bada ) {
-
- System.out.println("hello world");
-
-}
-
-
-rule "simple_rule"
- salience 10
- no-loop true
- agenda-group agenda-group
- activation-group activation-group
-when
- foo2 : Bar( ((a (> 60 && < 70) || (< 50 && > 55)) && (a3 == "black")) || ((a == 40) && (a3 == "pink")) || ((a == 12) && (a3 == "yellow" || == "blue")) )
- not(
- Person( likes == type )
- exists(
- Person( likes == type ) ) )
-
- (foo3 : Bar( a == 3 || == 4, a3 == "hello", a4 == null ) or
- foo4 : Bar( a4 : a, a != 4 && != 5 ))
- foo5 : Bar( b == (a4 + 1) || > a4 || ==
- org.drools.compiler.Bar.BAR_ENUM_VALUE
- )
- foo6 : Bar( a4 : a, b == 6 )
- foo7 : Bar( a4 : a, b4 : b )
- Baz( )
-then
-
- if ( a == b ) {
- assert( foo3 );
- } else {
- retract( foo4 );
- }
- System.out.println( a4 );
- end
-
-rule "Check_NotNullof_rfqId"
- agenda-group Check
-when
- RFQBean( (m_rfqId == null) || (m_rfqId == "") )
-then
- response.setStatus("For RFQ Bean: The value of m_rfqId is
- null.");
-
- System.out.println(response.getStatus());
-
-end
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseRule.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseRule.xml
deleted file mode 100644
index b55ecbd0a7d..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_ParseRule.xml
+++ /dev/null
@@ -1,209 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- System.out.println("hello world");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- a4 + 1
-
-
- org.drools.compiler.Bar.BAR_ENUM_VALUE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if ( a == b ) {
- assert( foo3 );
- } else {
- retract( foo4 );
- }
- System.out.println( a4 );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- response.setStatus("For RFQ Bean: The value of m_rfqId is
- null.");
-
- System.out.println(response.getStatus());
-
-
-
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_RoundTrip.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_RoundTrip.drl
deleted file mode 100644
index fa21c99968d..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_RoundTrip.drl
+++ /dev/null
@@ -1,81 +0,0 @@
-package foo;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.utilArrayList;
-
-global HashMap m;
-global HashSet s;
-global org.drools.Person p;
-
-import function org.drools.xml.DumperTest.testStaticMethod1;
-import function org.drools.xml.DumperTest.testStaticMethod2;
-import function org.drools.xml.DumperTest.testStaticMethod3;
-
-dialect "java"
-salience 0
-auto-focus false
-
-declare SomeType
- @ann1( "some value" )
- @ann2( key1="value1", key2="value2" )
- field1 : String @key
- field2 : int
-end
-
-function int func1( String p1, boolean p2 ) {
- return 10;
-}
-
-function func2() {
- String x = "abc";
-}
-
-rule "simple_rule"
- @author(name="Some author", version="1")
- salience 10
- no-loop true
- agenda-group "agenda-group"
- activation-group "activation-group"
- ruleflow-group "xxx"
- lock-on-active true
- auto-focus true
- date-effective "01-Jan-2007"
- date-expires "01-Feb-2007"
- when
- foo2 : Bar( a ( > 60 && < 70 ) || ( > 50 && < 55 ) && a3 == "black" || a == 40 && a3 == "pink" || a == 12 && a3 == "yellow" || a3 == "blue")
- foo3 : Bar( a == 3 || == 4, a3 == "hello", a4 == null )
- foo4 : Bar( a4 : a != 4 && != 5) from entry-point "abc"
- foo5 : Bar( b == (a4 + 1) || > a4) from $foo3.bla( x, y )
- foo6 : Bar( a4 : a, b == 6)
- foo7 : Bar( a4 : a, b4 : b)
- $cheeseList : ArrayList(size > 2) from collect( Cheese( type == $likes ) );
- Baz()
- then
- if ( a == b ) {
- assert( foo3 );
- } else {
- retract( foo4 );
- }
- System.out.println( a4 );
- testStaticMethod1();
- testStaticMethod2();
- testStaticMethod3();
-end
-
-rule "simple_rule2"
- salience (10 + a)
- dialect "mvel"
- when
- foo4 : Bar( a4 : a != 4 && != 5)
- then
- if ( a == b ) {
- assert( foo3 );
- } else {
- retract( foo4 );
- }
- System.out.println( a4 );
- testStaticMethod1();
- testStaticMethod2();
- testStaticMethod3();
-end
\ No newline at end of file
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_RoundTrip.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_RoundTrip.xml
deleted file mode 100644
index 36eec73d42a..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_RoundTrip.xml
+++ /dev/null
@@ -1,142 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-((a (> 60 && < 70) || (> 50 && < 55)) && (a3 == "black")) || ((a == 40) && (a3 == "pink")) || ((a == 12) && (a3 == "yellow")) || (a3 == "blue")
-
-
-
-
-
-
-
-a == 3 || == 4
-
-
-a3 == "hello"
-
-
-a4 == null
-
-
-
-
-
-
-
-a != 4 && != 5
-
-
-
-
-
-
-
-
-b == (a4
- + 1) || > a4
-
-
-
-
-
-
-
-b == 6
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-size > 2
-
-
-
-
-
-type == $likes
-
-
-
-
-
-
-
-
-
-
-
-
- if ( a == b ) {
- assert( foo3 );
- } else {
- retract( foo4 );
- }
- System.out.println( a4 );
- testStaticMethod1();
- testStaticMethod2();
- testStaticMethod3();
-
-
-
-
-
-
-
-a != 4 && != 5
-
-
-
-
-
-
-
- if ( a == b ) {
- assert( foo3 );
- } else {
- retract( foo4 );
- }
- System.out.println( a4 );
- testStaticMethod1();
- testStaticMethod2();
- testStaticMethod3();
-
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_SimpleRule1.xml b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_SimpleRule1.xml
deleted file mode 100644
index 5f223616d39..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_SimpleRule1.xml
+++ /dev/null
@@ -1,146 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- list.add( p );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- list.add( p );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- list.add( p );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- list.add( p );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- list.add( p );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- list.add( p );
-
-
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_TraitDeclaration.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_TraitDeclaration.drl
deleted file mode 100644
index 07ce2aeb081..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_TraitDeclaration.drl
+++ /dev/null
@@ -1,6 +0,0 @@
-package org.test;
-
-declare trait Foo
-@propertyReactive
- a : int
-end
\ No newline at end of file
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_accumulateall.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_accumulateall.drl
deleted file mode 100644
index a8533b57b8b..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_accumulateall.drl
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.drools.compiler.test;
-
-import org.drools.compiler.Cheese;
-import org.drools.compiler.Person;
-import org.drools.compiler.Cheesery;
-
-global java.util.List results;
-
-rule "AccumulateTest" salience 100
- when
- $totalAmount : Integer() from accumulate( $cheese : Cheese( ),
- init( int total = 0; ),
- action( total += $cheese.getPrice(); ),
- result( new Integer( total ) ) );
- then
- //System.out.println("Total amount = US$ "+$totalAmount );
- results.add($totalAmount);
-end
-
-rule "Accumulate with Bindings" salience 90
- when
- $person : Person( name == "Bob", $likes : likes )
- $totalAmount : Integer() from accumulate( $cheese : Cheese( type == $likes ),
- init( int total = 0; ),
- action( total += $cheese.getPrice(); ),
- result( new Integer( total ) ) );
- then
- //System.out.println($person.getName() +" will spend US$ "+ $totalAmount + " buying cheese");
- results.add($totalAmount);
-end
-
-rule "Constraints everywhere" salience 80
- when
- $person : Person( $likes : likes )
- $cheesery : Cheesery( totalAmount > 100 )
- from accumulate( $cheese : Cheese( type == $likes ),
- init( Cheesery cheesery = new Cheesery(); ),
- action( cheesery.addCheese( $cheese ); ),
- result( cheesery ) );
- then
- //System.out.println($person.getName() +" is spending a lot buying cheese ( US$ "+$cheesery.getTotalAmount()+" )!");
- results.add(new Integer($cheesery.getTotalAmount()));
-end
-
-rule "Source pattern binds" salience 70
- when
- $person : Person( name == "Bob", $likes : likes )
- $totalAmount : Integer() from accumulate( $cheese : Cheese( type == $likes, $price: price ),
- init( int total = 0; ),
- action( total += $price; ),
- result( new Integer( total ) ) );
- then
- //System.out.println($person.getName() +" will spend US$ "+ $totalAmount + " buying cheese");
- results.add($totalAmount);
-end
-
-rule "Accumulate with previous Bindings" salience 60
- when
- $person : Person( name == "Bob", $likes : likes, $age : age )
- $totalAmount : Integer() from accumulate( $cheese : Cheese( type == $likes, $price : price ),
- init( int total = $age * 10; ),
- action( total += $price; ),
- result( new Integer( total ) ) );
- then
- results.add($totalAmount);
-end
-
-
-rule "External Function" salience 80
- when
- $person : Person( $likes : likes )
- $max : Number( intValue >= 5 )
- from accumulate( $cheese : Cheese( type == $likes, $price : price ),
- max( $price ) );
- then
- results.add( $max );
-end
-
-
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_complex.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_complex.drl
deleted file mode 100644
index 5042174eb15..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_complex.drl
+++ /dev/null
@@ -1,83 +0,0 @@
-package rules;
-
-
-import pt.inescporto.cec.entities.SetupUse;
-import pt.inescporto.cec.entities.SetupInUse;
-import pt.inescporto.cec.entities.Parameter;
-import pt.inescporto.cec.entities.OrdemFabrico;
-import pt.inescporto.cec.entities.AccaoInspeccao;
-import pt.inescporto.cec.entities.AccaoInspeccaoOperacao;
-import pt.inescporto.cec.entities.MelhorEmNaoConformidades;
-import pt.inescporto.cec.entities.OtherInspectionMethod;
-import pt.inescporto.cec.entities.BestParms;
-
-
-rule "ruleBestProductionOrderCreator"
-when
- AccaoInspeccao( artigoID == 3 , $operID: operacaoID , $resourceID: recursoID, $ProdOrderID: ordemProducaoID, $IAID: accaoInspeccaoID )
- AccaoInspeccaoOperacao( inspectionActionID == $IAID, $tmp: inspAccaoOperacaoID )
- OtherInspectionMethod(inspActionOperacaoID == $tmp, $NCNumber: numeroNaoConformidades )
- not (MelhorEmNaoConformidades( operacaoID == $operID, recursoID == $resourceID ) )
- then
- insert(new MelhorEmNaoConformidades($ProdOrderID,$NCNumber,$operID,$resourceID));
-end
-
-rule "ruleBestProductionOrderChecker"
-when
- AccaoInspeccao( artigoID ==3 , $operID: operacaoID, $resourceID: recursoID, $ProdOrderID: ordemProducaoID, $IAID: accaoInspeccaoID )
- AccaoInspeccaoOperacao( inspectionActionID == $IAID, $tmp: inspAccaoOperacaoID )
- OtherInspectionMethod( inspActionOperacaoID == $tmp, $NCNumber: numeroNaoConformidades )
- $t: MelhorEmNaoConformidades( operacaoID == $operID, recursoID == $resourceID, numeroDefeitos > $NCNumber )
- then
- $t.setNumeroDefeitos($NCNumber);
- $t.setOrdemProducaoID($ProdOrderID);
- update($t);
-end
-
-rule "ruleBestParametersCreator"
-salience -100
-when
- MelhorEmNaoConformidades($poID: ordemProducaoID, $nonConformities: numeroDefeitos )
- SetupInUse( $setup: setupUseID , productionOrderID == $poID )
- p: Parameter( $parID: parameterID, setupUseID == $setup )
- not (BestParms( parameterID == $parID ))
-then
- BestParms newBest=new BestParms();
- newBest.setParameterID($parID);
- newBest.setNominalValue(new Float(p.getNominalValue()));
- newBest.setMaxLimit(new Float(p.getMaxLimit()));
- newBest.setMinLimit(new Float(p.getMinLimit()));
- newBest.setMaxLimitAlarm(new Float(p.getMaxLimitAlarm()));
- newBest.setMinLimitAlarm(new Float(p.getMinLimitAlarm()));
- newBest.setNonConformities($nonConformities);
- insert(newBest);
-end
-
-rule "ruleBestParametersChecker"
-salience -10
-when
- MelhorEmNaoConformidades($poID: ordemProducaoID, $NC: numeroDefeitos )
- SetupInUse( $setup: setupUseID , productionOrderID == $poID )
- p: Parameter( $parID: parameterID, setupUseID == $setup )
- newBest: BestParms( parameterID == $parID, nonConformities > $NC )
-then
- newBest.setNominalValue(new Float(p.getNominalValue()));
- newBest.setMaxLimit(new Float(p.getMaxLimit()));
- newBest.setMinLimit(new Float(p.getMinLimit()));
- newBest.setMaxLimitAlarm(new Float(p.getMaxLimitAlarm()));
- newBest.setMinLimitAlarm(new Float(p.getMinLimitAlarm()));
- newBest.setNonConformities($NC);
- update(newBest);
-end
-
-rule "print"
-salience -20
-when
- bp: BestParms( )
-then
- System.out.println("Parameter: "+bp.getParameterID()+" Value: "+bp.getNominalValue()+" NC: "+bp.getNonConformities());
-end
-
-query "get results"
- mnc: BestParms( )
-end
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_exists.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_exists.drl
deleted file mode 100755
index 10803a8b0a6..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_exists.drl
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.drools.examples;
-
-import org.drools.mvel.compiler.Person;
-import org.drools.mvel.compiler.Cheese;
-
-global java.util.List list;
-
-rule "Buy cheese"
-when
- $cheese: Cheese($type : type)
- exists Person(likes == $type);
-then
- list.add($cheese);
-end
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_from.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_from.drl
deleted file mode 100644
index f252466b602..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_from.drl
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.drools.compiler.test;
-
-import org.drools.compiler.Cheese;
-import org.drools.compiler.Cheesery;
-import java.util.List;
-
-global List list1;
-global List list2;
-global List list3;
-global Cheesery cheesery;
-
-rule "test from using a global"
- when
- $cheese : Cheese() from cheesery.getCheeses()
- then
- list1.add( $cheese );
-end
-
-rule "test from using a global against a map lookup"
- when
- Person( $stilton : type, type == "stilton" )
- $cheese : Cheese( type == $stilton ) from cheesery.getCheeseMap["stilton"]
- then
- list1.add( $cheese );
-end
diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_simplerule.drl b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_simplerule.drl
deleted file mode 100644
index c0242e34cd6..00000000000
--- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/xml/test_simplerule.drl
+++ /dev/null
@@ -1,15 +0,0 @@
-package foo;
-
-rule "simple_rule"
- when
- foo3 : Bar(a==3)
- foo4 : Bar(a4:a==4)
- Baz()
- then
- if ( a == b ) {
- assert( foo3 );
- } else {
- retract( foo4 );
- }
- System.out.println( a4 );
-end
\ No newline at end of file
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/context/variable/Variable.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/context/variable/Variable.java
index e81f4f55e24..f70815a0445 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/context/variable/Variable.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/context/variable/Variable.java
@@ -35,6 +35,7 @@
import org.jbpm.process.core.datatype.DataType;
import org.jbpm.process.core.datatype.impl.coverter.CloneHelper;
import org.jbpm.process.core.datatype.impl.type.UndefinedDataType;
+import org.kie.kogito.internal.utils.KogitoTags;
/**
* Default implementation of a variable.
@@ -44,13 +45,6 @@ public class Variable implements TypeObject, ValueObject, Serializable {
private static final long serialVersionUID = 510l;
- public static final String VARIABLE_TAGS = "customTags";
-
- public static final String READONLY_TAG = "readonly";
- public static final String REQUIRED_TAG = "required";
- public static final String INTERNAL_TAG = "internal";
- public static final String INPUT_TAG = "input";
- public static final String OUTPUT_TAG = "output";
public static final String BUSINESS_RELEVANT = "business-relevant";
public static final String TRACKED = "tracked";
public static final Set KOGITO_RESERVED = Set.of("id");
@@ -134,19 +128,14 @@ public void setValue(final Object value) {
if (this.type.verifyDataType(value)) {
this.value = value;
} else {
- final StringBuilder sb = new StringBuilder();
- sb.append("Value <");
- sb.append(value);
- sb.append("> is not valid for datatype: ");
- sb.append(this.type);
- throw new IllegalArgumentException(sb.toString());
+ throw new IllegalArgumentException("Value <" + value + "> of datatype: " + value.getClass() + " is not valid for datatype: " + type.getObjectClass());
}
}
public void setMetaData(String name, Object value) {
this.metaData.put(name, value);
- if (VARIABLE_TAGS.equals(name) && value != null) {
+ if (KogitoTags.VARIABLE_TAGS.equals(name) && value != null) {
tags = Arrays.asList(value.toString().split(","));
}
}
@@ -165,8 +154,8 @@ public String toString() {
}
public List getTags() {
- if (tags.isEmpty() && this.metaData.containsKey(VARIABLE_TAGS)) {
- tags = Arrays.asList(metaData.get(VARIABLE_TAGS).toString().split(","));
+ if (tags.isEmpty() && this.metaData.containsKey(KogitoTags.VARIABLE_TAGS)) {
+ tags = Arrays.asList(metaData.get(KogitoTags.VARIABLE_TAGS).toString().split(","));
}
return tags;
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/context/variable/VariableScope.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/context/variable/VariableScope.java
index dd2ecf66777..613926aaf7d 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/context/variable/VariableScope.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/context/variable/VariableScope.java
@@ -24,6 +24,7 @@
import org.jbpm.process.core.Context;
import org.jbpm.process.core.context.AbstractContext;
+import org.kie.kogito.internal.utils.KogitoTags;
public class VariableScope extends AbstractContext {
@@ -110,7 +111,7 @@ public boolean isReadOnly(String name) {
Variable v = findVariable(name);
if (v != null) {
- return v.hasTag(Variable.READONLY_TAG);
+ return v.hasTag(KogitoTags.READONLY_TAG);
}
return false;
}
@@ -119,7 +120,7 @@ public boolean isRequired(String name) {
Variable v = findVariable(name);
if (v != null) {
- return v.hasTag(Variable.REQUIRED_TAG);
+ return v.hasTag(KogitoTags.REQUIRED_TAG);
}
return false;
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/AbstractProcessNodeEvent.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/AbstractProcessNodeEvent.java
new file mode 100644
index 00000000000..9ad5cc225ef
--- /dev/null
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/AbstractProcessNodeEvent.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.jbpm.process.instance.event;
+
+import org.kie.api.event.process.ProcessNodeEvent;
+import org.kie.api.runtime.KieRuntime;
+import org.kie.api.runtime.process.NodeInstance;
+import org.kie.api.runtime.process.ProcessInstance;
+
+public abstract class AbstractProcessNodeEvent extends ProcessEvent implements ProcessNodeEvent {
+
+ private final NodeInstance nodeInstance;
+
+ protected AbstractProcessNodeEvent(NodeInstance nodeInstance, ProcessInstance instance, KieRuntime kruntime) {
+ super(instance, kruntime);
+ this.nodeInstance = nodeInstance;
+ }
+
+ protected AbstractProcessNodeEvent(NodeInstance nodeInstance, ProcessInstance instance, KieRuntime kruntime, String identity) {
+ super(instance, kruntime, identity);
+ this.nodeInstance = nodeInstance;
+ }
+
+ @Override
+ public NodeInstance getNodeInstance() {
+ return nodeInstance;
+ }
+
+}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/ErrorEventImpl.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/ErrorEventImpl.java
new file mode 100644
index 00000000000..b6e3488c5eb
--- /dev/null
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/ErrorEventImpl.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.jbpm.process.instance.event;
+
+import org.kie.api.event.process.ErrorEvent;
+import org.kie.api.runtime.KieRuntime;
+import org.kie.api.runtime.process.NodeInstance;
+import org.kie.api.runtime.process.ProcessInstance;
+
+public class ErrorEventImpl extends AbstractProcessNodeEvent implements ErrorEvent {
+
+ private static final long serialVersionUID = 1L;
+ private final Exception exception;
+
+ public ErrorEventImpl(ProcessInstance instance, KieRuntime kruntime, NodeInstance nodeInstance,
+ Exception exception) {
+ super(nodeInstance, instance, kruntime);
+ this.exception = exception;
+ }
+
+ @Override
+ public Exception getException() {
+ return exception;
+ }
+
+ @Override
+ public String toString() {
+ return "ErrorEventImpl [nodeInstance=" + getNodeInstance() + ", exception=" + exception + "]";
+ }
+}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/KogitoProcessEventSupportImpl.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/KogitoProcessEventSupportImpl.java
index 2a87fcd4c95..4bbd2314858 100644
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/KogitoProcessEventSupportImpl.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/KogitoProcessEventSupportImpl.java
@@ -367,4 +367,10 @@ public void reset() {
this.clear();
}
+ @Override
+ public void fireOnError(KogitoProcessInstance instance, KogitoNodeInstance nodeInstance, KieRuntime kruntime, Exception exception) {
+ ErrorEventImpl event = new ErrorEventImpl(instance, kruntime, nodeInstance, exception);
+ notifyAllListeners(l -> l.onError(event));
+ }
+
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/KogitoProcessNodeLeftEventImpl.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/KogitoProcessNodeLeftEventImpl.java
index 9fa10db97ee..be9a0262f56 100644
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/KogitoProcessNodeLeftEventImpl.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/KogitoProcessNodeLeftEventImpl.java
@@ -23,24 +23,17 @@
import org.kie.api.runtime.process.NodeInstance;
import org.kie.kogito.internal.process.runtime.KogitoNodeInstance;
-public class KogitoProcessNodeLeftEventImpl extends ProcessEvent implements ProcessNodeLeftEvent {
+public class KogitoProcessNodeLeftEventImpl extends AbstractProcessNodeEvent implements ProcessNodeLeftEvent {
private static final long serialVersionUID = 510l;
- private NodeInstance nodeInstance;
-
public KogitoProcessNodeLeftEventImpl(NodeInstance nodeInstance, KieRuntime kruntime, String identity) {
- super(nodeInstance.getProcessInstance(), kruntime, identity);
- this.nodeInstance = nodeInstance;
- }
-
- public NodeInstance getNodeInstance() {
- return nodeInstance;
+ super(nodeInstance, nodeInstance.getProcessInstance(), kruntime, identity);
}
@Override
public String toString() {
- return "==>[ProcessNodeLeft(nodeId=" + nodeInstance.getNodeId() + "; id=" + ((KogitoNodeInstance) nodeInstance).getStringId()
+ return "==>[ProcessNodeLeft(nodeId=" + getNodeInstance().getNodeId() + "; id=" + ((KogitoNodeInstance) getNodeInstance()).getStringId()
+ "; nodeName=" + getNodeInstance().getNodeName() + "; processName=" + getProcessInstance().getProcessName() + "; processId=" + getProcessInstance().getProcessId() + ")]";
}
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/KogitoProcessNodeTriggeredEventImpl.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/KogitoProcessNodeTriggeredEventImpl.java
index 9882ac6f02e..f47ae407658 100644
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/KogitoProcessNodeTriggeredEventImpl.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/KogitoProcessNodeTriggeredEventImpl.java
@@ -23,24 +23,18 @@
import org.kie.api.runtime.process.NodeInstance;
import org.kie.kogito.internal.process.runtime.KogitoNodeInstance;
-public class KogitoProcessNodeTriggeredEventImpl extends ProcessEvent implements ProcessNodeTriggeredEvent {
+public class KogitoProcessNodeTriggeredEventImpl extends AbstractProcessNodeEvent implements ProcessNodeTriggeredEvent {
private static final long serialVersionUID = 510l;
- private NodeInstance nodeInstance;
-
public KogitoProcessNodeTriggeredEventImpl(NodeInstance nodeInstance, KieRuntime kruntime, String identity) {
- super(nodeInstance.getProcessInstance(), kruntime, identity);
- this.nodeInstance = nodeInstance;
- }
+ super(nodeInstance, nodeInstance.getProcessInstance(), kruntime, identity);
- public NodeInstance getNodeInstance() {
- return nodeInstance;
}
@Override
public String toString() {
- return "==>[ProcessNodeTriggered(nodeId=" + nodeInstance.getNodeId() + "; id=" + ((KogitoNodeInstance) nodeInstance).getStringId()
+ return "==>[ProcessNodeTriggered(nodeId=" + getNodeInstance().getNodeId() + "; id=" + ((KogitoNodeInstance) getNodeInstance()).getStringId()
+ "; nodeName=" + getNodeInstance().getNodeName() + "; processName=" + getProcessInstance().getProcessName() + "; processId=" + getProcessInstance().getProcessId() + ")]";
}
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/MessageEventImpl.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/MessageEventImpl.java
index 25882a36025..b74e1d6508d 100644
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/MessageEventImpl.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/MessageEventImpl.java
@@ -23,26 +23,19 @@
import org.kie.api.runtime.process.NodeInstance;
import org.kie.api.runtime.process.ProcessInstance;
-public class MessageEventImpl extends ProcessEvent implements MessageEvent {
+public class MessageEventImpl extends AbstractProcessNodeEvent implements MessageEvent {
private static final long serialVersionUID = 1L;
- private NodeInstance nodeInstance;
- private String messageName;
- private Object messageObject;
+ private final String messageName;
+ private final Object messageObject;
public MessageEventImpl(ProcessInstance instance, KieRuntime kruntime, NodeInstance nodeInstance,
String messageName, Object messageObject, String identity) {
- super(instance, kruntime, identity);
- this.nodeInstance = nodeInstance;
+ super(nodeInstance, instance, kruntime, identity);
this.messageName = messageName;
this.messageObject = messageObject;
}
- @Override
- public NodeInstance getNodeInstance() {
- return nodeInstance;
- }
-
@Override
public String getMessageName() {
return messageName;
@@ -55,7 +48,7 @@ public Object getMessage() {
@Override
public String toString() {
- return "MessageEventImpl [nodeInstance=" + nodeInstance + ", messageName=" + messageName + ", messageObject=" +
+ return "MessageEventImpl [nodeInstance=" + getNodeInstance() + ", messageName=" + messageName + ", messageObject=" +
messageObject + "]";
}
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/SignalEventImpl.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/SignalEventImpl.java
index ec2b01cae23..55fb834c3d9 100644
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/SignalEventImpl.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/SignalEventImpl.java
@@ -23,26 +23,19 @@
import org.kie.api.runtime.process.NodeInstance;
import org.kie.api.runtime.process.ProcessInstance;
-public class SignalEventImpl extends ProcessEvent implements SignalEvent {
+public class SignalEventImpl extends AbstractProcessNodeEvent implements SignalEvent {
private static final long serialVersionUID = 1L;
- private NodeInstance nodeInstance;
- private String signalName;
- private Object signalObject;
+ private final String signalName;
+ private final Object signalObject;
public SignalEventImpl(ProcessInstance instance, KieRuntime kruntime, NodeInstance nodeInstance,
String signalName, Object signalObject, String identity) {
- super(instance, kruntime, identity);
- this.nodeInstance = nodeInstance;
+ super(nodeInstance, instance, kruntime, identity);
this.signalName = signalName;
this.signalObject = signalObject;
}
- @Override
- public NodeInstance getNodeInstance() {
- return nodeInstance;
- }
-
@Override
public String getSignalName() {
return signalName;
@@ -55,7 +48,7 @@ public Object getSignal() {
@Override
public String toString() {
- return "SignalEventImpl [nodeInstance=" + nodeInstance + ", signalName=" + signalName + ", signalObject=" +
+ return "SignalEventImpl [nodeInstance=" + getNodeInstance() + ", signalName=" + signalName + ", signalObject=" +
signalObject + "]";
}
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/ForEachNodeFactory.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/ForEachNodeFactory.java
index aa462310aec..4ee362d81bd 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/ForEachNodeFactory.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/ForEachNodeFactory.java
@@ -27,6 +27,7 @@
import org.jbpm.workflow.core.impl.DataDefinition;
import org.jbpm.workflow.core.node.CompositeContextNode;
import org.jbpm.workflow.core.node.ForEachNode;
+import org.kie.kogito.internal.utils.KogitoTags;
public class ForEachNodeFactory> extends AbstractCompositeNodeFactory, T> {
@@ -99,7 +100,7 @@ public ForEachNodeFactory tempVariable(String varRef, String variableName, Da
private ForEachNodeFactory addVariable(String varRef, String variableName, DataType dataType, boolean eval) {
Variable variable = getForEachNode().addContextVariable(varRef, variableName, dataType);
variable.setMetaData(Metadata.EVAL_VARIABLE, eval);
- variable.setMetaData(Variable.VARIABLE_TAGS, Variable.INTERNAL_TAG);
+ variable.setMetaData(KogitoTags.VARIABLE_TAGS, KogitoTags.INTERNAL_TAG);
return this;
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/NodeInstance.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/NodeInstance.java
index 47e84a4f425..bb4109242f4 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/NodeInstance.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/NodeInstance.java
@@ -18,6 +18,7 @@
*/
package org.jbpm.workflow.instance;
+import java.util.Date;
import java.util.Map;
import org.jbpm.process.instance.ContextInstance;
@@ -52,6 +53,8 @@ public interface NodeInstance extends KogitoNodeInstance {
String getSlaTimerId();
+ void internalSetTriggerTime(Date date);
+
default KogitoProcessInstance getKogitoProcessInstance() {
return (KogitoProcessInstance) getProcessInstance();
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/NodeInstanceContainer.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/NodeInstanceContainer.java
index 015fc35119e..ac573322705 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/NodeInstanceContainer.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/NodeInstanceContainer.java
@@ -63,7 +63,11 @@ default NodeInstance getByNodeDefinitionId(final String nodeDefinitionId, NodeCo
for (Node node : nodeContainer.getNodes()) {
if (nodeDefinitionId.equals(node.getMetaData().get(UNIQUE_ID))) {
- return getNodeInstance(node);
+ if (nodeContainer instanceof Node) {
+ return ((NodeInstanceContainer) getNodeInstance((Node) nodeContainer)).getNodeInstance(node);
+ } else {
+ return getNodeInstance(node);
+ }
}
if (node instanceof NodeContainer) {
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java
index e13e3d50248..437b054eecf 100755
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java
@@ -1149,6 +1149,7 @@ public void setErrorState(NodeInstance nodeInstanceInError, Exception e) {
this.errorMessage = rootException.getClass().getCanonicalName() + " - " + rootException.getMessage();
setState(STATE_ERROR);
logger.error("Unexpected error while executing node {} in process instance {}", nodeInstanceInError.getNode().getName(), this.getStringId(), e);
+ ((InternalProcessRuntime) getKnowledgeRuntime().getProcessRuntime()).getProcessEventSupport().fireOnError(this, nodeInstanceInError, getKnowledgeRuntime(), e);
// remove node instance that caused an error
((org.jbpm.workflow.instance.NodeInstanceContainer) nodeInstanceInError.getNodeInstanceContainer()).removeNodeInstance(nodeInstanceInError);
}
diff --git a/jbpm/jbpm-flow/src/main/java/org/kie/kogito/process/impl/AbstractProcessInstance.java b/jbpm/jbpm-flow/src/main/java/org/kie/kogito/process/impl/AbstractProcessInstance.java
index 154a1cec752..218a51da754 100644
--- a/jbpm/jbpm-flow/src/main/java/org/kie/kogito/process/impl/AbstractProcessInstance.java
+++ b/jbpm/jbpm-flow/src/main/java/org/kie/kogito/process/impl/AbstractProcessInstance.java
@@ -34,7 +34,6 @@
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
-import java.util.stream.Collectors;
import org.jbpm.process.instance.InternalProcessRuntime;
import org.jbpm.ruleflow.core.RuleFlowProcess;
@@ -372,19 +371,20 @@ public void setVersion(long version) {
@Override
public T updateVariables(T updates) {
- return updateVariables(bind(updates));
+ Map map = bind(updates);
+ variables.update(map);
+ return updateVariables(map);
}
@Override
public T updateVariablesPartially(T updates) {
- return updateVariables(bind(updates).entrySet().stream().filter(e -> e.getValue() != null).collect(Collectors.toMap(Entry::getKey, Entry::getValue)));
+ return updateVariables(this.variables.updatePartially(bind(updates)));
}
private T updateVariables(Map map) {
for (Entry entry : map.entrySet()) {
processInstance().setVariable(entry.getKey(), entry.getValue());
}
- this.variables.update(map);
addToUnitOfWork(pi -> ((MutableProcessInstances) process.instances()).update(pi.id(), pi));
return variables;
}
@@ -704,6 +704,10 @@ public void retrigger() {
pInstance.setState(STATE_ACTIVE);
pInstance.internalSetErrorNodeId(null);
pInstance.internalSetErrorMessage(null);
+ org.kie.api.runtime.process.NodeInstanceContainer nodeInstanceContainer = ni.getNodeInstanceContainer();
+ if (nodeInstanceContainer instanceof NodeInstance) {
+ ((NodeInstance) nodeInstanceContainer).internalSetTriggerTime(new Date());
+ }
ni.trigger(null, Node.CONNECTION_DEFAULT_TYPE);
removeOnFinish();
}
diff --git a/kogito-bom/pom.xml b/kogito-bom/pom.xml
index 64c1aeddc2b..8301f6c4019 100755
--- a/kogito-bom/pom.xml
+++ b/kogito-bom/pom.xml
@@ -242,18 +242,18 @@
sources
- org.kie.kogito
- kogito-addons-quarkus-marshallers-avro
+ org.kie
+ kie-addons-quarkus-marshallers-avro
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-marshallers-avro-deployment
+ org.kie
+ kie-addons-quarkus-marshallers-avro-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-marshallers-avro-deployment
+ org.kie
+ kie-addons-quarkus-marshallers-avro-deployment
${project.version}
sources
@@ -316,199 +316,199 @@
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-fabric8-kubernetes-service-catalog
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-fabric8-kubernetes-service-catalog
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-fabric8-kubernetes-service-catalog-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-microprofile-config-service-catalog
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-microprofile-config-service-catalog
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-microprofile-config-service-catalog-deployment
${project.version}
pom
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-common-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-common-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-common-reactive-messaging
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-common-reactive-messaging
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-knative-eventing
+ org.kie
+ kie-addons-quarkus-knative-eventing
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-knative-eventing
+ org.kie
+ kie-addons-quarkus-knative-eventing
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-knative-eventing-deployment
+ org.kie
+ kie-addons-quarkus-knative-eventing-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-knative-eventing-deployment
+ org.kie
+ kie-addons-quarkus-knative-eventing-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-knative-serving
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-knative-serving
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-knative-serving-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-knative-serving-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-kubernetes
+ org.kie
+ kie-addons-quarkus-kubernetes
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-kubernetes
+ org.kie
+ kie-addons-quarkus-kubernetes
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-kubernetes-deployment
+ org.kie
+ kie-addons-quarkus-kubernetes-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-kubernetes-deployment
+ org.kie
+ kie-addons-quarkus-kubernetes-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-fabric8-kubernetes-service-catalog-test-utils
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-fabric8-kubernetes-service-catalog-test-utils
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-kubernetes
+ org.kie
+ kie-addons-springboot-kubernetes
${project.version}
- org.kie.kogito
- kogito-addons-springboot-kubernetes
+ org.kie
+ kie-addons-springboot-kubernetes
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-messaging
+ org.kie
+ kie-addons-quarkus-messaging
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-messaging
+ org.kie
+ kie-addons-quarkus-messaging
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-messaging-deployment
+ org.kie
+ kie-addons-quarkus-messaging-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-messaging-deployment
+ org.kie
+ kie-addons-quarkus-messaging-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-messaging-common
+ org.kie
+ kie-addons-quarkus-messaging-common
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-messaging-common
+ org.kie
+ kie-addons-quarkus-messaging-common
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-messaging
+ org.kie
+ kie-addons-springboot-messaging
${project.version}
- org.kie.kogito
- kogito-addons-springboot-messaging
+ org.kie
+ kie-addons-springboot-messaging
${project.version}
sources
@@ -633,35 +633,35 @@
sources
- org.kie.kogito
- kogito-addons-quarkus-monitoring-prometheus
+ org.kie
+ kie-addons-quarkus-monitoring-prometheus
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-monitoring-prometheus
+ org.kie
+ kie-addons-quarkus-monitoring-prometheus
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-monitoring-prometheus-deployment
+ org.kie
+ kie-addons-quarkus-monitoring-prometheus-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-monitoring-prometheus-deployment
+ org.kie
+ kie-addons-quarkus-monitoring-prometheus-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-monitoring-prometheus
+ org.kie
+ kie-addons-springboot-monitoring-prometheus
${project.version}
- org.kie.kogito
- kogito-addons-springboot-monitoring-prometheus
+ org.kie
+ kie-addons-springboot-monitoring-prometheus
${project.version}
sources
@@ -685,24 +685,24 @@
test
- org.kie.kogito
- kogito-addons-quarkus-monitoring-core
+ org.kie
+ kie-addons-quarkus-monitoring-core
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-monitoring-core
+ org.kie
+ kie-addons-quarkus-monitoring-core
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-monitoring-core
+ org.kie
+ kie-addons-springboot-monitoring-core
${project.version}
- org.kie.kogito
- kogito-addons-springboot-monitoring-core
+ org.kie
+ kie-addons-springboot-monitoring-core
${project.version}
sources
@@ -718,35 +718,35 @@
sources
- org.kie.kogito
- kogito-addons-quarkus-monitoring-elastic
+ org.kie
+ kie-addons-quarkus-monitoring-elastic
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-monitoring-elastic
+ org.kie
+ kie-addons-quarkus-monitoring-elastic
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-monitoring-elastic-deployment
+ org.kie
+ kie-addons-quarkus-monitoring-elastic-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-monitoring-elastic-deployment
+ org.kie
+ kie-addons-quarkus-monitoring-elastic-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-monitoring-elastic
+ org.kie
+ kie-addons-springboot-monitoring-elastic
${project.version}
- org.kie.kogito
- kogito-addons-springboot-monitoring-elastic
+ org.kie
+ kie-addons-springboot-monitoring-elastic
${project.version}
sources
@@ -776,13 +776,13 @@
sources
- org.kie.kogito
- kogito-addons-springboot-persistence-infinispan
+ org.kie
+ kie-addons-springboot-persistence-infinispan
${project.version}
- org.kie.kogito
- kogito-addons-springboot-persistence-infinispan
+ org.kie
+ kie-addons-springboot-persistence-infinispan
${project.version}
sources
@@ -798,189 +798,189 @@
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-kafka
+ org.kie
+ kie-addons-quarkus-persistence-kafka
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-kafka
+ org.kie
+ kie-addons-quarkus-persistence-kafka
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-kafka-deployment
+ org.kie
+ kie-addons-quarkus-persistence-kafka-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-kafka-deployment
+ org.kie
+ kie-addons-quarkus-persistence-kafka-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-infinispan
+ org.kie
+ kie-addons-quarkus-persistence-infinispan
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-infinispan
+ org.kie
+ kie-addons-quarkus-persistence-infinispan
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-infinispan-deployment
+ org.kie
+ kie-addons-quarkus-persistence-infinispan-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-infinispan-deployment
+ org.kie
+ kie-addons-quarkus-persistence-infinispan-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-infinispan-health
+ org.kie
+ kie-addons-quarkus-persistence-infinispan-health
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-infinispan-health
+ org.kie
+ kie-addons-quarkus-persistence-infinispan-health
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-jdbc
+ org.kie
+ kie-addons-quarkus-persistence-jdbc
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-jdbc
+ org.kie
+ kie-addons-quarkus-persistence-jdbc
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-persistence-jdbc
+ org.kie
+ kie-addons-springboot-persistence-jdbc
${project.version}
- org.kie.kogito
- kogito-addons-springboot-persistence-jdbc
+ org.kie
+ kie-addons-springboot-persistence-jdbc
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-jdbc-deployment
+ org.kie
+ kie-addons-quarkus-persistence-jdbc-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-jdbc-deployment
+ org.kie
+ kie-addons-quarkus-persistence-jdbc-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-mongodb
+ org.kie
+ kie-addons-quarkus-persistence-mongodb
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-mongodb
+ org.kie
+ kie-addons-quarkus-persistence-mongodb
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-mongodb-deployment
+ org.kie
+ kie-addons-quarkus-persistence-mongodb-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-mongodb-deployment
+ org.kie
+ kie-addons-quarkus-persistence-mongodb-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-rocksdb
+ org.kie
+ kie-addons-quarkus-persistence-rocksdb
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-rocksdb
+ org.kie
+ kie-addons-quarkus-persistence-rocksdb
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-rocksdb-deployment
+ org.kie
+ kie-addons-quarkus-persistence-rocksdb-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-rocksdb-deployment
+ org.kie
+ kie-addons-quarkus-persistence-rocksdb-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-postgresql
+ org.kie
+ kie-addons-quarkus-persistence-postgresql
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-postgresql
+ org.kie
+ kie-addons-quarkus-persistence-postgresql
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-postgresql-deployment
+ org.kie
+ kie-addons-quarkus-persistence-postgresql-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-postgresql-deployment
+ org.kie
+ kie-addons-quarkus-persistence-postgresql-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-persistence-postgresql
+ org.kie
+ kie-addons-springboot-persistence-postgresql
${project.version}
- org.kie.kogito
- kogito-addons-springboot-persistence-postgresql
+ org.kie
+ kie-addons-springboot-persistence-postgresql
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-filesystem
+ org.kie
+ kie-addons-quarkus-persistence-filesystem
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-filesystem
+ org.kie
+ kie-addons-quarkus-persistence-filesystem
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-persistence-filesystem-deployment
+ org.kie
+ kie-addons-quarkus-persistence-filesystem-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-persistence-filesystem-deployment
+ org.kie
+ kie-addons-quarkus-persistence-filesystem-deployment
${project.version}
sources
@@ -1009,13 +1009,13 @@
sources
- org.kie.kogito
- kogito-addons-springboot-persistence-filesystem
+ org.kie
+ kie-addons-springboot-persistence-filesystem
${project.version}
- org.kie.kogito
- kogito-addons-springboot-persistence-filesystem
+ org.kie
+ kie-addons-springboot-persistence-filesystem
${project.version}
sources
@@ -1031,13 +1031,13 @@
sources
- org.kie.kogito
- kogito-addons-springboot-persistence-mongodb
+ org.kie
+ kie-addons-springboot-persistence-mongodb
${project.version}
- org.kie.kogito
- kogito-addons-springboot-persistence-mongodb
+ org.kie
+ kie-addons-springboot-persistence-mongodb
${project.version}
sources
@@ -1053,35 +1053,35 @@
sources
- org.kie.kogito
- kogito-addons-quarkus-events-process
+ org.kie
+ kie-addons-quarkus-events-process
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-events-process
+ org.kie
+ kie-addons-quarkus-events-process
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-events-process-deployment
+ org.kie
+ kie-addons-quarkus-events-process-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-events-process-deployment
+ org.kie
+ kie-addons-quarkus-events-process-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-events-process-kafka
+ org.kie
+ kie-addons-springboot-events-process-kafka
${project.version}
- org.kie.kogito
- kogito-addons-springboot-events-process-kafka
+ org.kie
+ kie-addons-springboot-events-process-kafka
${project.version}
sources
@@ -1097,35 +1097,35 @@
sources
- org.kie.kogito
- kogito-addons-quarkus-events-mongodb
+ org.kie
+ kie-addons-quarkus-events-mongodb
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-events-mongodb
+ org.kie
+ kie-addons-quarkus-events-mongodb
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-events-mongodb-deployment
+ org.kie
+ kie-addons-quarkus-events-mongodb-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-events-mongodb-deployment
+ org.kie
+ kie-addons-quarkus-events-mongodb-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-events-mongodb
+ org.kie
+ kie-addons-springboot-events-mongodb
${project.version}
- org.kie.kogito
- kogito-addons-springboot-events-mongodb
+ org.kie
+ kie-addons-springboot-events-mongodb
${project.version}
sources
@@ -1141,81 +1141,81 @@
sources
- org.kie.kogito
- kogito-addons-quarkus-process-management
+ org.kie
+ kie-addons-quarkus-process-management
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-process-management
+ org.kie
+ kie-addons-quarkus-process-management
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-process-management-deployment
+ org.kie
+ kie-addons-quarkus-process-management-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-process-management-deployment
+ org.kie
+ kie-addons-quarkus-process-management-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-process-definitions
+ org.kie
+ kie-addons-quarkus-process-definitions
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-process-definitions
+ org.kie
+ kie-addons-quarkus-process-definitions
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-process-definitions-deployment
+ org.kie
+ kie-addons-quarkus-process-definitions-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-process-definitions-deployment
+ org.kie
+ kie-addons-quarkus-process-definitions-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-source-files
+ org.kie
+ kie-addons-quarkus-source-files
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-source-files
+ org.kie
+ kie-addons-quarkus-source-files
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-source-files-deployment
+ org.kie
+ kie-addons-quarkus-source-files-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-source-files-deployment
+ org.kie
+ kie-addons-quarkus-source-files-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-process-management
+ org.kie
+ kie-addons-springboot-process-management
${project.version}
- org.kie.kogito
- kogito-addons-springboot-process-management
+ org.kie
+ kie-addons-springboot-process-management
${project.version}
sources
@@ -1231,68 +1231,68 @@
sources
- org.kie.kogito
- kogito-addons-quarkus-task-management
+ org.jbpm
+ jbpm-addons-quarkus-task-management
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-task-management
+ org.jbpm
+ jbpm-addons-quarkus-task-management
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-task-management-deployment
+ org.jbpm
+ jbpm-addons-quarkus-task-management-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-task-management-deployment
+ org.jbpm
+ jbpm-addons-quarkus-task-management-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-task-management
+ org.jbpm
+ jbpm-addons-springboot-task-management
${project.version}
- org.kie.kogito
- kogito-addons-springboot-task-management
+ org.jbpm
+ jbpm-addons-springboot-task-management
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-task-notification
+ org.jbpm
+ jbpm-addons-quarkus-task-notification
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-task-notification
+ org.jbpm
+ jbpm-addons-quarkus-task-notification
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-task-notification-deployment
+ org.jbpm
+ jbpm-addons-quarkus-task-notification-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-task-notification-deployment
+ org.jbpm
+ jbpm-addons-quarkus-task-notification-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-task-notification
+ org.jbpm
+ jbpm-addons-springboot-task-notification
${project.version}
- org.kie.kogito
- kogito-addons-springboot-task-notification
+ org.jbpm
+ jbpm-addons-springboot-task-notification
${project.version}
sources
@@ -1308,35 +1308,35 @@
sources
- org.kie.kogito
- kogito-addons-quarkus-mail
+ org.jbpm
+ jbpm-addons-quarkus-mail
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-mail
+ org.jbpm
+ jbpm-addons-quarkus-mail
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-mail-deployment
+ org.jbpm
+ jbpm-addons-quarkus-mail-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-mail-deployment
+ org.jbpm
+ jbpm-addons-quarkus-mail-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-mail
+ org.jbpm
+ jbpm-addons-springboot-mail
${project.version}
- org.kie.kogito
- kogito-addons-springboot-mail
+ org.jbpm
+ jbpm-addons-springboot-mail
${project.version}
sources
@@ -1352,24 +1352,24 @@
sources
- org.kie.kogito
- kogito-addons-quarkus-rest-exception-handler
+ org.kie
+ kie-addons-quarkus-rest-exception-handler
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-rest-exception-handler
+ org.kie
+ kie-addons-quarkus-rest-exception-handler
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-rest-exception-handler
+ org.kie
+ kie-addons-springboot-rest-exception-handler
${project.version}
- org.kie.kogito
- kogito-addons-springboot-rest-exception-handler
+ org.kie
+ kie-addons-springboot-rest-exception-handler
${project.version}
sources
@@ -1393,35 +1393,35 @@
test-jar
- org.kie.kogito
- kogito-addons-quarkus-process-svg
+ org.kie
+ kie-addons-quarkus-process-svg
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-process-svg
+ org.kie
+ kie-addons-quarkus-process-svg
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-process-svg-deployment
+ org.kie
+ kie-addons-quarkus-process-svg-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-process-svg-deployment
+ org.kie
+ kie-addons-quarkus-process-svg-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-process-svg
+ org.kie
+ kie-addons-springboot-process-svg
${project.version}
- org.kie.kogito
- kogito-addons-springboot-process-svg
+ org.kie
+ kie-addons-springboot-process-svg
${project.version}
sources
@@ -1446,176 +1446,176 @@
test
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-rest-callback
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-rest-callback
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-common-messaging
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-common-messaging
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-common-messaging
${project.version}
test-jar
test
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-management
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-management
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-management-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-management-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-messaging
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-messaging
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-messaging-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-messaging-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-knative-eventing
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-knative-eventing
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-knative-eventing-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-knative-eventing-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-common-health
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-common-health
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-common-health
${project.version}
test-jar
test
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-service-health
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-service-health
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-health
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-health
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-springboot-jobs-management
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-springboot-jobs-management
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-service-embedded
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-service-embedded
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-service-embedded
${project.version}
test
test-jar
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-service-embedded-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-jobs-service-embedded-deployment
${project.version}
sources
@@ -2094,68 +2094,68 @@
- org.kie.kogito
- kogito-spring-boot-starter
+ org.jbpm
+ jbpm-with-drools-spring-boot-starter
${project.version}
- org.kie.kogito
- kogito-rules-spring-boot-starter
+ org.drools
+ drools-rules-spring-boot-starter
${project.version}
- org.kie.kogito
- kogito-processes-spring-boot-starter
+ org.jbpm
+ jbpm-spring-boot-starter
${project.version}
- org.kie.kogito
- kogito-processes-spring-boot-starter
+ org.jbpm
+ jbpm-spring-boot-starter
${project.version}
sources
- org.kie.kogito
- kogito-decisions-spring-boot-starter
+ org.drools
+ drools-decisions-spring-boot-starter
${project.version}
- org.kie.kogito
- kogito-predictions-spring-boot-starter
+ org.kie
+ kie-predictions-spring-boot-starter
${project.version}
- org.kie.kogito
- kogito-quarkus
+ org.jbpm
+ jbpm-with-drools-quarkus
${project.version}
- org.kie.kogito
- kogito-quarkus
+ org.jbpm
+ jbpm-with-drools-quarkus
${project.version}
sources
- org.kie.kogito
- kogito-quarkus-deployment
+ org.jbpm
+ jbpm-with-drools-quarkus-deployment
${project.version}
- org.kie.kogito
- kogito-quarkus-decisions
+ org.drools
+ drools-quarkus-decisions
${project.version}
- org.kie.kogito
- kogito-quarkus-decisions
+ org.drools
+ drools-quarkus-decisions
${project.version}
sources
- org.kie.kogito
- kogito-quarkus-decisions-deployment
+ org.drools
+ drools-quarkus-decisions-deployment
${project.version}
+
- org.kie.kogito
- runtime-tools-quarkus-extension
+ org.jbpm
+ jbpm-quarkus-devui
${project.version}
- org.kie.kogito
- runtime-tools-quarkus-extension
+ org.jbpm
+ jbpm-quarkus-devui
${project.version}
sources
- org.kie.kogito
- runtime-tools-quarkus-extension-deployment
+ org.jbpm
+ jbpm-quarkus-devui-deployment
${project.version}
- org.kie.kogito
- runtime-tools-quarkus-extension-deployment
+ org.jbpm
+ jbpm-quarkus-devui-deployment
${project.version}
sources
org.kie.kogito
- kogito-quarkus-serverless-workflow-devui
+ sonataflow-quarkus-devui
${project.version}
org.kie.kogito
- kogito-quarkus-serverless-workflow-devui
+ sonataflow-quarkus-devui
${project.version}
sources
org.kie.kogito
- kogito-quarkus-serverless-workflow-devui-deployment
+ sonataflow-quarkus-devui-deployment
${project.version}
org.kie.kogito
- kogito-quarkus-serverless-workflow-devui-deployment
+ sonataflow-quarkus-devui-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-common-runtime
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-common-runtime
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-common-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-common-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-common-runtime
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-common-runtime
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-common-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-common-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-postgresql
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-postgresql
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-postgresql-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-postgresql-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-postgresql
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-postgresql
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-postgresql-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-postgresql-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-inmemory
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-inmemory
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-inmemory-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-inmemory-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-infinispan
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-infinispan
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-infinispan-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-infinispan-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-infinispan
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-infinispan
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-infinispan-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-infinispan-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-mongodb
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-mongodb
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-mongodb-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-mongodb-deployment
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-mongodb
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-mongodb
${project.version}
sources
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-mongodb-deployment
${project.version}
- org.kie.kogito
+ org.kie
kogito-addons-quarkus-data-index-persistence-mongodb-deployment
${project.version}
sources
@@ -2560,35 +2560,35 @@
sources
- org.kie.kogito
- kogito-addons-quarkus-tracing-decision
+ org.kie
+ kie-addons-quarkus-tracing-decision
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-tracing-decision
+ org.kie
+ kie-addons-quarkus-tracing-decision
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-tracing-decision-deployment
+ org.kie
+ kie-addons-quarkus-tracing-decision-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-tracing-decision-deployment
+ org.kie
+ kie-addons-quarkus-tracing-decision-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-tracing-decision
+ org.kie
+ kie-addons-springboot-tracing-decision
${project.version}
- org.kie.kogito
- kogito-addons-springboot-tracing-decision
+ org.kie
+ kie-addons-springboot-tracing-decision
${project.version}
sources
@@ -2618,36 +2618,36 @@
- org.kie.kogito
- kogito-addons-springboot-explainability
+ org.kie
+ kie-addons-springboot-explainability
${project.version}
- org.kie.kogito
- kogito-addons-springboot-explainability
+ org.kie
+ kie-addons-springboot-explainability
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-explainability
+ org.kie
+ kie-addons-quarkus-explainability
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-explainability
+ org.kie
+ kie-addons-quarkus-explainability
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-explainability-deployment
+ org.kie
+ kie-addons-quarkus-explainability-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-explainability-deployment
+ org.kie
+ kie-addons-quarkus-explainability-deployment
${project.version}
sources
@@ -2665,35 +2665,35 @@
sources
- org.kie.kogito
- kogito-addons-quarkus-events-decisions
+ org.kie
+ kie-addons-quarkus-events-decisions
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-events-decisions
+ org.kie
+ kie-addons-quarkus-events-decisions
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-events-decisions-deployment
+ org.kie
+ kie-addons-quarkus-events-decisions-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-events-decisions-deployment
+ org.kie
+ kie-addons-quarkus-events-decisions-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-events-decisions
+ org.kie
+ kie-addons-springboot-events-decisions
${project.version}
- org.kie.kogito
- kogito-addons-springboot-events-decisions
+ org.kie
+ kie-addons-springboot-events-decisions
${project.version}
sources
@@ -2711,35 +2711,35 @@
sources
- org.kie.kogito
- kogito-addons-quarkus-events-predictions
+ org.kie
+ kie-addons-quarkus-events-predictions
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-events-predictions
+ org.kie
+ kie-addons-quarkus-events-predictions
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-events-predictions-deployment
+ org.kie
+ kie-addons-quarkus-events-predictions-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-events-predictions-deployment
+ org.kie
+ kie-addons-quarkus-events-predictions-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-events-predictions
+ org.kie
+ kie-addons-springboot-events-predictions
${project.version}
- org.kie.kogito
- kogito-addons-springboot-events-predictions
+ org.kie
+ kie-addons-springboot-events-predictions
${project.version}
sources
@@ -2757,35 +2757,35 @@
sources
- org.kie.kogito
- kogito-addons-quarkus-events-rules
+ org.drools
+ drools-addons-quarkus-events-rules
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-events-rules
+ org.drools
+ drools-addons-quarkus-events-rules
${project.version}
sources
- org.kie.kogito
- kogito-addons-quarkus-events-rules-deployment
+ org.drools
+ drools-addons-quarkus-events-rules-deployment
${project.version}
- org.kie.kogito
- kogito-addons-quarkus-events-rules-deployment
+ org.drools
+ drools-addons-quarkus-events-rules-deployment
${project.version}
sources
- org.kie.kogito
- kogito-addons-springboot-events-rules
+ org.drools
+ drools-addons-springboot-events-rules
${project.version}
- org.kie.kogito
- kogito-addons-springboot-events-rules
+ org.drools
+ drools-addons-springboot-events-rules
${project.version}
sources
diff --git a/kogito-build/kogito-build-no-bom-parent/pom.xml b/kogito-build/kogito-build-no-bom-parent/pom.xml
index 98041ecfe75..d13e70d16dd 100644
--- a/kogito-build/kogito-build-no-bom-parent/pom.xml
+++ b/kogito-build/kogito-build-no-bom-parent/pom.xml
@@ -112,12 +112,12 @@
1.1.0
2.8.2
3.0.0-M2
- 1.6.0
+ 3.1.1
3.0.5
2.5.2
3.2.2
0.8.11
- 3.0.5
+ 3.1.6
3.2.0
2.0
2.3.9
@@ -146,6 +146,10 @@
3.3.0
+
+
+
+ ${project.version}
@@ -695,6 +699,58 @@
org.apache.maven.plugins
maven-checkstyle-plugin
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+
+
+ org.drools
+ drools-util
+ ${version.drools.util}
+
+
+
+
+ Remove comments from generated files
+ prepare-package
+
+ java
+
+
+ false
+ true
+
+