From da6107357ef2858d879af4e8f964283741f9bdff Mon Sep 17 00:00:00 2001 From: Walter Medvedeo Date: Mon, 18 Nov 2024 18:29:12 +0100 Subject: [PATCH 1/6] kie-kogito-runtimes-3780: Disable the ADJUST_DATES_TO_CONTEXT_TIME_ZONE jackson feature in the jobs service api default deserializer (#3781) --- .../jobs/service/api/serlialization/SerializationUtils.java | 3 ++- .../api/event/serialization/JobCloudEventDeserializerTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/kogito-jobs-service-api/src/main/java/org/kie/kogito/jobs/service/api/serlialization/SerializationUtils.java b/api/kogito-jobs-service-api/src/main/java/org/kie/kogito/jobs/service/api/serlialization/SerializationUtils.java index 7cca0a4535e..d5dcdb6c49d 100644 --- a/api/kogito-jobs-service-api/src/main/java/org/kie/kogito/jobs/service/api/serlialization/SerializationUtils.java +++ b/api/kogito-jobs-service-api/src/main/java/org/kie/kogito/jobs/service/api/serlialization/SerializationUtils.java @@ -54,7 +54,8 @@ private static ObjectMapper buildObjectMapper() { ObjectMapper objectMapper = new ObjectMapper() .registerModule(new JavaTimeModule()) .registerModule(JsonFormat.getCloudEventJacksonModule()) - .disable(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + .disable(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .disable(com.fasterxml.jackson.databind.DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); registerDescriptors(objectMapper); return objectMapper; } diff --git a/api/kogito-jobs-service-api/src/test/java/org/kie/kogito/jobs/service/api/event/serialization/JobCloudEventDeserializerTest.java b/api/kogito-jobs-service-api/src/test/java/org/kie/kogito/jobs/service/api/event/serialization/JobCloudEventDeserializerTest.java index e4088fdc83d..d83677f74b9 100644 --- a/api/kogito-jobs-service-api/src/test/java/org/kie/kogito/jobs/service/api/event/serialization/JobCloudEventDeserializerTest.java +++ b/api/kogito-jobs-service-api/src/test/java/org/kie/kogito/jobs/service/api/event/serialization/JobCloudEventDeserializerTest.java @@ -150,7 +150,7 @@ private static void assertCreateJobEvent(JobCloudEvent result) { assertThat(job.getSchedule()).isInstanceOf(TimerSchedule.class); TimerSchedule schedule = (TimerSchedule) job.getSchedule(); - assertThat(schedule.getStartTime()).isEqualTo(SCHEDULE_START_TIME); + assertThat(schedule.getStartTime()).hasToString(SCHEDULE_START_TIME.toString()); assertThat(schedule.getRepeatCount()).isEqualTo(SCHEDULE_REPEAT_COUNT); assertThat(schedule.getDelay()).isEqualTo(SCHEDULE_DELAY); assertThat(schedule.getDelayUnit()).isEqualTo(SCHEDULE_DELAY_UNIT); From bff06209529ec77fd9b62ba7c0a5b271110e0285 Mon Sep 17 00:00:00 2001 From: Deepak Joseph <159427631+josedee@users.noreply.github.com> Date: Tue, 19 Nov 2024 13:51:14 +0530 Subject: [PATCH 2/6] [kie-issues#1610] Remove WorkItemDefinition mechanism (#3766) --- .../process/workitem/WorkDefinitionImpl.java | 153 -------------- .../process/workitem/WorkItemRepository.java | 191 ------------------ .../TestServiceFive/TestServiceFive.wid | 28 --- .../TestServiceFour/TestServiceFour.wid | 70 ------- .../TestServiceOne/TestServiceOne.wid | 35 ---- .../TestServiceThree/TestServiceThree.wid | 43 ---- .../TestServiceTwo/TestServiceTwo.wid | 39 ---- .../TestServiceWithParamValues.wid | 44 ---- .../TestServiceWithParamValuesThree.wid | 44 ---- .../TestServiceWithParamValuesTwo.wid | 44 ---- .../process/workitem/repository/index.conf | 27 --- .../workitem/repositorysingledir/repowid.wid | 44 ---- .../process/core/WorkDefinitionExtension.java | 31 --- .../impl/WorkDefinitionExtensionImpl.java | 64 ------ .../process/core/impl/WorkDefinitionImpl.java | 106 ---------- .../java/org/jbpm/util/WidMVELEvaluator.java | 59 ------ .../jbpm/util/WidMVELEvaluatorSafeTest.java | 73 ------- .../org/jbpm/util/WidMVELEvaluatorTest.java | 104 ---------- .../resources/wids/test-backwardscompat.wid | 65 ------ ...-backwardscompatmixedandmissingimports.wid | 63 ------ .../wids/test-backwardscompatpkgimport.wid | 58 ------ .../resources/wids/test-customdatatype.wid | 58 ------ .../wids/test-customdatatypenoimport.wid | 56 ----- .../test/resources/wids/test-noimports.wid | 56 ----- .../src/main/resources/CustomTask.wid | 33 --- .../.gitignore | 1 - .../pom.xml | 1 - .../.gitignore | 1 - .../pom.xml | 1 - .../.gitignore | 1 - .../pom.xml | 1 - .../.gitignore | 1 - .../pom.xml | 1 - .../src/main/resources/CustomTask.wid | 33 --- .../.gitignore | 1 - .../pom.xml | 1 - .../pom.xml | 1 - 37 files changed, 1632 deletions(-) delete mode 100755 jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/workitem/WorkDefinitionImpl.java delete mode 100755 jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/workitem/WorkItemRepository.java delete mode 100755 jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceFive/TestServiceFive.wid delete mode 100755 jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceFour/TestServiceFour.wid delete mode 100755 jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceOne/TestServiceOne.wid delete mode 100755 jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceThree/TestServiceThree.wid delete mode 100755 jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceTwo/TestServiceTwo.wid delete mode 100755 jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceWithParamValues/TestServiceWithParamValues.wid delete mode 100755 jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceWithParamValuesThree/TestServiceWithParamValuesThree.wid delete mode 100755 jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceWithParamValuesTwo/TestServiceWithParamValuesTwo.wid delete mode 100755 jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/index.conf delete mode 100755 jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repositorysingledir/repowid.wid delete mode 100755 jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/WorkDefinitionExtension.java delete mode 100755 jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/impl/WorkDefinitionExtensionImpl.java delete mode 100755 jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/impl/WorkDefinitionImpl.java delete mode 100755 jbpm/jbpm-flow/src/main/java/org/jbpm/util/WidMVELEvaluator.java delete mode 100755 jbpm/jbpm-flow/src/test/java/org/jbpm/util/WidMVELEvaluatorSafeTest.java delete mode 100755 jbpm/jbpm-flow/src/test/java/org/jbpm/util/WidMVELEvaluatorTest.java delete mode 100755 jbpm/jbpm-flow/src/test/resources/wids/test-backwardscompat.wid delete mode 100755 jbpm/jbpm-flow/src/test/resources/wids/test-backwardscompatmixedandmissingimports.wid delete mode 100755 jbpm/jbpm-flow/src/test/resources/wids/test-backwardscompatpkgimport.wid delete mode 100755 jbpm/jbpm-flow/src/test/resources/wids/test-customdatatype.wid delete mode 100755 jbpm/jbpm-flow/src/test/resources/wids/test-customdatatypenoimport.wid delete mode 100755 jbpm/jbpm-flow/src/test/resources/wids/test-noimports.wid delete mode 100644 quarkus/integration-tests/integration-tests-quarkus-processes-persistence/integration-tests-processes-persistence-common/src/main/resources/CustomTask.wid delete mode 100644 springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-persistence-common/src/main/resources/CustomTask.wid diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/workitem/WorkDefinitionImpl.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/workitem/WorkDefinitionImpl.java deleted file mode 100755 index 8d79a11aaee..00000000000 --- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/workitem/WorkDefinitionImpl.java +++ /dev/null @@ -1,153 +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.workitem; - -import java.util.HashMap; -import java.util.Map; - -public class WorkDefinitionImpl extends org.jbpm.process.core.impl.WorkDefinitionExtensionImpl { - - private static final long serialVersionUID = 5L; - - private String[] dependencies; - private String[] mavenDependencies; - private String description; - private String defaultHandler; - private String category; - private String path; - private String file; - private String documentation; - private String iconEncoded; - private String version; - private String widType; - private Map parameterValues = new HashMap<>(); - - public String getDocumentation() { - return documentation; - } - - public void setDocumentation(String documentation) { - this.documentation = documentation; - } - - public String getFile() { - return file; - } - - public void setFile(String file) { - this.file = file; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public String getCategory() { - return category; - } - - public void setCategory(String category) { - this.category = category; - } - - public String[] getDependencies() { - return dependencies; - } - - public void setDependencies(String[] dependencies) { - this.dependencies = dependencies; - } - - public String getDefaultHandler() { - return defaultHandler; - } - - public void setDefaultHandler(String defaultHandler) { - this.defaultHandler = defaultHandler; - } - - public String getIconEncoded() { - return iconEncoded; - } - - public void setIconEncoded(String iconEncoded) { - this.iconEncoded = iconEncoded; - } - - public String[] getMavenDependencies() { - return mavenDependencies; - } - - public void setMavenDependencies(String[] mavenDependencies) { - this.mavenDependencies = mavenDependencies; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getWidType() { - return widType; - } - - public void setWidType(String widType) { - this.widType = widType; - } - - public Map getParameterValues() { - return this.parameterValues; - } - - public void setParameterValues(Map parameterValues) { - this.parameterValues.clear(); - if (parameterValues != null) { - this.parameterValues.putAll(parameterValues); - } - - } - - public void addParameterValue(String key, Object value) { - this.parameterValues.put(key, value); - } - - public void removeParameterValue(String key) { - this.parameterValues.remove(key); - } - - public String[] getParameterValueNames() { - return this.parameterValues.keySet().toArray(new String[this.parameterValues.size()]); - } - -} diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/workitem/WorkItemRepository.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/workitem/WorkItemRepository.java deleted file mode 100755 index 166f7d40e30..00000000000 --- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/workitem/WorkItemRepository.java +++ /dev/null @@ -1,191 +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.workitem; - -import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.drools.core.util.ConfFileUtils; -import org.jbpm.process.core.ParameterDefinition; -import org.jbpm.process.core.datatype.DataType; -import org.jbpm.process.core.impl.ParameterDefinitionImpl; -import org.jbpm.util.WidMVELEvaluator; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class WorkItemRepository { - - private WorkItemRepository() { - - } - - private static final Logger logger = LoggerFactory.getLogger(WorkItemRepository.class); - - public static Map getWorkDefinitions(String path) { - return getWorkDefinitions(path, null, null); - } - - public static Map getWorkDefinitions(String path, String[] definitionNames) { - return getWorkDefinitions(path, definitionNames, null); - } - - public static Map getWorkDefinitions(String path, String[] definitionNames, String widName) { - Map workDefinitions = new HashMap<>(); - List> workDefinitionsMaps = getAllWorkDefinitionsMap(path, widName); - for (Map workDefinitionMap : workDefinitionsMaps) { - if (workDefinitionMap != null) { - WorkDefinitionImpl workDefinition = new WorkDefinitionImpl(); - workDefinition.setName((String) workDefinitionMap.get("name")); - workDefinition.setDisplayName((String) workDefinitionMap.get("displayName")); - workDefinition.setIcon((String) workDefinitionMap.get("icon")); - workDefinition.setCustomEditor((String) workDefinitionMap.get("customEditor")); - workDefinition.setCategory((String) workDefinitionMap.get("category")); - workDefinition.setPath((String) workDefinitionMap.get("path")); - workDefinition.setFile((String) workDefinitionMap.get("file")); - workDefinition.setDocumentation((String) workDefinitionMap.get("documentation")); - Set parameters = new HashSet<>(); - Map parameterMap = (Map) workDefinitionMap.get("parameters"); - if (parameterMap != null) { - for (Map.Entry entry : parameterMap.entrySet()) { - parameters.add(new ParameterDefinitionImpl(entry.getKey(), entry.getValue())); - } - } - workDefinition.setParameters(parameters); - - if (workDefinitionMap.get("parameterValues") != null) { - workDefinition.setParameterValues((Map) workDefinitionMap.get("parameterValues")); - } - - Set results = new HashSet<>(); - Map resultMap = (Map) workDefinitionMap.get("results"); - if (resultMap != null) { - for (Map.Entry entry : resultMap.entrySet()) { - results.add(new ParameterDefinitionImpl(entry.getKey(), entry.getValue())); - } - } - workDefinition.setResults(results); - - workDefinition.setDefaultHandler((String) workDefinitionMap.get("defaultHandler")); - - if (workDefinitionMap.get("dependencies") != null) { - workDefinition.setDependencies(((List) workDefinitionMap.get("dependencies")).toArray(new String[0])); - } - - if (workDefinitionMap.get("mavenDependencies") != null) { - workDefinition.setMavenDependencies(((List) workDefinitionMap.get("mavenDependencies")).toArray(new String[0])); - } - - if (workDefinitionMap.get("version") != null) { - workDefinition.setVersion((String) workDefinitionMap.get("version")); - } - - if (workDefinitionMap.get("description") != null) { - workDefinition.setDescription((String) workDefinitionMap.get("description")); - } - - if (workDefinitionMap.get("widType") != null) { - workDefinition.setWidType((String) workDefinitionMap.get("widType")); - } - - workDefinitions.put(workDefinition.getName(), workDefinition); - } - } - - if (definitionNames != null) { - if (definitionNames.length > 0) { - workDefinitions.keySet().retainAll(new HashSet(Arrays.asList(definitionNames))); - } else { - return new HashMap<>(); - } - - } - return workDefinitions; - } - - private static List> getAllWorkDefinitionsMap(String directory, String widName) { - List> workDefinitions = new ArrayList<>(); - if (widName != null) { - workDefinitions.addAll(getWorkDefinitionsMapForSingleDir(directory, widName)); - } else { - for (String s : getDirectories(directory)) { - try { - workDefinitions.addAll(getAllWorkDefinitionsMap(directory + "/" + s, null)); - } catch (Exception t) { - logger.error("Error retrieving work definitions: " + t.getMessage()); - } - workDefinitions.addAll(getWorkDefinitionsMap(directory, s)); - } - } - return workDefinitions; - } - - private static String[] getDirectories(String path) { - String content = null; - try { - content = ConfFileUtils.URLContentsToString( - new URL(path + "/index.conf")); - } catch (Exception e) { - // directory has no index.conf - do nothing - } - if (content == null) { - return new String[0]; - } - return content.split("\n"); - } - - private static List> getWorkDefinitionsMapForSingleDir(String parentPath, String widName) { - String path = parentPath + "/" + widName + ".wid"; - return getWorkDefinitionsForPath(parentPath, path, widName); - } - - private static List> getWorkDefinitionsMap(String parentPath, String file) { - String path = parentPath + "/" + file + "/" + file + ".wid"; - return getWorkDefinitionsForPath(parentPath, path, file); - } - - private static List> getWorkDefinitionsForPath(String parentPath, String path, String file) { - String content = null; - try { - content = ConfFileUtils.URLContentsToString(new URL(path)); - } catch (Exception e) { - // Do nothing - } - if (content == null) { - return new ArrayList(); - } - try { - List> result = (List>) WidMVELEvaluator.eval(content); - for (Map wid : result) { - wid.put("path", parentPath + "/" + file); - wid.put("file", file + ".wid"); - wid.put("widType", "mvel"); - } - return result; - } catch (Exception t) { - throw new RuntimeException("Could not parse work definition as mvel.", t); - } - } - -} diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceFive/TestServiceFive.wid b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceFive/TestServiceFive.wid deleted file mode 100755 index e9bb15266ee..00000000000 --- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceFive/TestServiceFive.wid +++ /dev/null @@ -1,28 +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. -// - -[ - [ - "java.util.HashMap", - { - "displayName":"TestServiceFive", - "name":"TestServiceFive" - } - ] -] \ No newline at end of file diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceFour/TestServiceFour.wid b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceFour/TestServiceFour.wid deleted file mode 100755 index de1d864cf22..00000000000 --- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceFour/TestServiceFour.wid +++ /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. -// - -[ - [ - "java.util.HashMap", - { - "displayName":"TestServiceFour", - "name":"TestServiceFour", - "description":"Test Service Four", - "parameters":[ - "java.util.HashMap", - { - "a":["org.jbpm.process.core.datatype.impl.type.ListDataType", {}], - "b":["org.jbpm.process.core.datatype.impl.type.StringDataType", {}], - "c":["org.jbpm.process.core.datatype.impl.type.StringDataType", {}] - } - ], - "version":"1.0", - "dependencies":[ - "java.util.ArrayList", [ "depends1", "depends2" ] - ] - } - ], - [ - "java.util.HashMap", - { - "displayName":"TestServiceFour2", - "name":"TestServiceFour2", - "description":"Test Service Four2", - "parameters":[ - "java.util.HashMap", - { - "a":["org.jbpm.process.core.datatype.impl.type.ListDataType", {}], - "b":["org.jbpm.process.core.datatype.impl.type.StringDataType", {}] - } - ], - "results":[ - "java.util.HashMap", - { - "c":["org.jbpm.process.core.datatype.impl.type.ListDataType", {}], - "d":["org.jbpm.process.core.datatype.impl.type.StringDataType", {}] - } - ], - "version":"2.0", - "dependencies":[ - "java.util.ArrayList", [ "depends1", "depends2", "depends3" ] - ], - "mavenDependencies":[ - "java.util.ArrayList", [ "jbpm:jbpm-twitter:1.0", "twitter4j:twitter4j-core:3.0.3" ] - ] - } - ] -] \ No newline at end of file diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceOne/TestServiceOne.wid b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceOne/TestServiceOne.wid deleted file mode 100755 index f74dd347596..00000000000 --- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceOne/TestServiceOne.wid +++ /dev/null @@ -1,35 +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. -// - -[ - [ - "name" : "TestServiceOne", - "description" : "Test Service One", - "parameters" : [ - "param1" : new StringDataType(), - "param2" : new StringDataType(), - "param3" : new StringDataType() - ], - "displayName" : "TestServiceOne", - "icon" : "testserviceone.png", - "category" : "MyTestServices", - "dependencies" : [ - ] - ] -] diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceThree/TestServiceThree.wid b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceThree/TestServiceThree.wid deleted file mode 100755 index 592fc3388eb..00000000000 --- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceThree/TestServiceThree.wid +++ /dev/null @@ -1,43 +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. -// - -[ - [ - "name" : "TestServiceThree", - "description" : "TestServiceThree", - "version" : "1.0", - "parameters" : [ - "param1" : new StringDataType() - ], - "displayName" : "TestServiceThree", - "icon" : "testservicethree.png", - "category" : "Communication", - "customEditor" : "org.drools.eclipse.flow.common.editor.editpart.work.SampleCustomEditor", - "defaultHandler" : "org.jbpm.process.workitem.MyHandler", - "documentation" : "index.html", - "dependencies" : [ - "file:./lib/jbpm-twitter.jar", - "file:./lib/twitter4j-core-3.0.3.jar" - ], - "mavenDependencies" : [ - "jbpm:jbpm-twitter:1.0", - "twitter4j:twitter4j-core:3.0.3" - ] - ] -] diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceTwo/TestServiceTwo.wid b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceTwo/TestServiceTwo.wid deleted file mode 100755 index b2f65212886..00000000000 --- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceTwo/TestServiceTwo.wid +++ /dev/null @@ -1,39 +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. -// - -[ - [ - "name" : "TestServiceTwo", - "description" : "TestServiceTwo", - "parameters" : [ - "param1" : new StringDataType(), - "param2" : new StringDataType() - ], - "results" : [ - "result1" : new StringDataType(), - "result2" : new StringDataType() - ], - "displayName" : "TestServiceTwo", - "icon" : "testservicetwo.png", - "category": "MyTestServices", - "dependencies" : [ - ] - ] -] - diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceWithParamValues/TestServiceWithParamValues.wid b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceWithParamValues/TestServiceWithParamValues.wid deleted file mode 100755 index e0825414dee..00000000000 --- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceWithParamValues/TestServiceWithParamValues.wid +++ /dev/null @@ -1,44 +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. -// - -[ - [ - "name" : "TestServiceWithParamValues", - "description" : "TestServiceWithParamValues", - "parameters" : [ - "param1" : new StringDataType(), - "param2" : new StringDataType(), - "param3" : new StringDataType() - ], - "parameterValues" : [ - "param1" : new EnumDataType("org.jbpm.process.workitem.enums.AnimalsEnum"), - "param3" : new EnumDataType("org.jbpm.process.workitem.enums.CarsEnum") - ], - "results" : [ - "result1" : new StringDataType(), - "result2" : new StringDataType() - ], - "displayName" : "TestServiceWithParamValues", - "icon" : "testservicewithparamvalues.png", - "category": "MyTestServices", - "dependencies" : [ - ] - ] -] - diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceWithParamValuesThree/TestServiceWithParamValuesThree.wid b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceWithParamValuesThree/TestServiceWithParamValuesThree.wid deleted file mode 100755 index 8b00866b0a9..00000000000 --- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceWithParamValuesThree/TestServiceWithParamValuesThree.wid +++ /dev/null @@ -1,44 +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. -// - -[ - [ - "name" : "TestServiceWithParamValuesThree", - "description" : "TestServiceWithParamValuesThree", - "parameters" : [ - "param1" : new StringDataType(), - "param2" : new StringDataType(), - "param3" : new StringDataType() - ], - "parameterValues" : [ - "param1" : new EnumDataType("org.jbpm.process.workitem.enums.AnimalsEnum"), - "param3" : "one,two,three" - ], - "results" : [ - "result1" : new StringDataType(), - "result2" : new StringDataType() - ], - "displayName" : "TestServiceWithParamValuesThree", - "icon" : "testservicewithparamvaluesthree.png", - "category": "MyTestServices", - "dependencies" : [ - ] - ] -] - diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceWithParamValuesTwo/TestServiceWithParamValuesTwo.wid b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceWithParamValuesTwo/TestServiceWithParamValuesTwo.wid deleted file mode 100755 index ff6d6759d4c..00000000000 --- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/TestServiceWithParamValuesTwo/TestServiceWithParamValuesTwo.wid +++ /dev/null @@ -1,44 +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. -// - -[ - [ - "name" : "TestServiceWithParamValuesTwo", - "description" : "TestServiceWithParamValuesTwo", - "parameters" : [ - "param1" : new StringDataType(), - "param2" : new StringDataType(), - "param3" : new StringDataType() - ], - "parameterValues" : [ - "param1" : "one,two,three", - "param3" : "four,five,six" - ], - "results" : [ - "result1" : new StringDataType(), - "result2" : new StringDataType() - ], - "displayName" : "TestServiceWithParamValuesTwo", - "icon" : "testservicewithparamvaluestwo.png", - "category": "MyTestServices", - "dependencies" : [ - ] - ] -] - diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/index.conf b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/index.conf deleted file mode 100755 index e33d8d50a86..00000000000 --- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repository/index.conf +++ /dev/null @@ -1,27 +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. -# - -TestServiceOne -TestServiceTwo -TestServiceThree -TestServiceFour -TestServiceFive -TestServiceWithParamValues -TestServiceWithParamValuesTwo -TestServiceWithParamValuesThree diff --git a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repositorysingledir/repowid.wid b/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repositorysingledir/repowid.wid deleted file mode 100755 index 1aab68affb2..00000000000 --- a/jbpm/jbpm-flow-builder/src/test/resources/org/jbpm/process/workitem/repositorysingledir/repowid.wid +++ /dev/null @@ -1,44 +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. -// - -[ - [ - "name" : "RepoSingleDir", - "description" : "RepoSingleDir", - "parameters" : [ - "param1" : new StringDataType(), - "param2" : new StringDataType(), - "param3" : new StringDataType() - ], - "parameterValues" : [ - "param1" : new EnumDataType("org.jbpm.process.workitem.enums.AnimalsEnum"), - "param3" : new EnumDataType("org.jbpm.process.workitem.enums.CarsEnum") - ], - "results" : [ - "result1" : new StringDataType(), - "result2" : new StringDataType() - ], - "displayName" : "RepoSingleDir", - "icon" : "RepoSingleDir.png", - "category": "RepoSingleDir", - "dependencies" : [ - ] - ] -] - diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/WorkDefinitionExtension.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/WorkDefinitionExtension.java deleted file mode 100755 index 890e06c8df9..00000000000 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/WorkDefinitionExtension.java +++ /dev/null @@ -1,31 +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.core; - -public interface WorkDefinitionExtension { - - String getDisplayName(); - - String getExplanationText(); - - String getIcon(); - - String getCustomEditor(); - -} diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/impl/WorkDefinitionExtensionImpl.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/impl/WorkDefinitionExtensionImpl.java deleted file mode 100755 index e93f3b4ef53..00000000000 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/impl/WorkDefinitionExtensionImpl.java +++ /dev/null @@ -1,64 +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.core.impl; - -import org.jbpm.process.core.WorkDefinitionExtension; - -public class WorkDefinitionExtensionImpl extends WorkDefinitionImpl implements WorkDefinitionExtension { - - private static final long serialVersionUID = 510l; - - private String displayName; - private String explanationText; - private String icon; - private String editor; - - public String getDisplayName() { - return displayName; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - public String getExplanationText() { - return explanationText; - } - - public void setExplanationText(String explanationText) { - this.explanationText = explanationText; - } - - public String getIcon() { - return icon; - } - - public void setIcon(String icon) { - this.icon = icon; - } - - public String getCustomEditor() { - return editor; - } - - public void setCustomEditor(String editor) { - this.editor = editor; - } - -} diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/impl/WorkDefinitionImpl.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/impl/WorkDefinitionImpl.java deleted file mode 100755 index 8c10aba007c..00000000000 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/impl/WorkDefinitionImpl.java +++ /dev/null @@ -1,106 +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.core.impl; - -import java.io.Serializable; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.jbpm.process.core.ParameterDefinition; -import org.jbpm.process.core.WorkDefinition; - -public class WorkDefinitionImpl implements WorkDefinition, Serializable { - - private static final long serialVersionUID = 510l; - - private String name; - private Map parameters = new HashMap<>(); - private Map results = new HashMap<>(); - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Set getParameters() { - return new HashSet<>(parameters.values()); - } - - public void setParameters(Set parameters) { - this.parameters.clear(); - Iterator iterator = parameters.iterator(); - while (iterator.hasNext()) { - addParameter(iterator.next()); - } - } - - public void addParameter(ParameterDefinition parameter) { - parameters.put(parameter.getName(), parameter); - } - - public void removeParameter(String name) { - parameters.remove(name); - } - - public String[] getParameterNames() { - return parameters.keySet().toArray(new String[parameters.size()]); - } - - public ParameterDefinition getParameter(String name) { - return parameters.get(name); - } - - public Set getResults() { - return new HashSet<>(results.values()); - } - - public void setResults(Set results) { - this.results.clear(); - Iterator it = results.iterator(); - while (it.hasNext()) { - addResult(it.next()); - } - } - - public void addResult(ParameterDefinition result) { - results.put(result.getName(), result); - } - - public void removeResult(String name) { - results.remove(name); - } - - public String[] getResultNames() { - return results.keySet().toArray(new String[results.size()]); - } - - public ParameterDefinition getResult(String name) { - return results.get(name); - } - - public String toString() { - return name; - } -} diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/util/WidMVELEvaluator.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/util/WidMVELEvaluator.java deleted file mode 100755 index dd9cac0bb79..00000000000 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/util/WidMVELEvaluator.java +++ /dev/null @@ -1,59 +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.util; - -import java.util.HashMap; - -import org.drools.util.StringUtils; -import org.mvel2.MVEL; -import org.mvel2.ParserContext; -import org.mvel2.compiler.ExpressionCompiler; - -public class WidMVELEvaluator { - - public static ParserContext WID_PARSER_CONTEXT; - // change this if data types change location - public static final String DATA_TYPE_PACKAGE = "org.jbpm.process.core.datatype.impl.type"; - - static { - WID_PARSER_CONTEXT = new ParserContext(); - WID_PARSER_CONTEXT.addPackageImport(DATA_TYPE_PACKAGE); - WID_PARSER_CONTEXT.setRetainParserState(false); - } - - private WidMVELEvaluator() { - - } - - public static Object eval(final String expression) { - ExpressionCompiler compiler = new ExpressionCompiler(getRevisedExpression(expression), - WID_PARSER_CONTEXT); - - return MVEL.executeExpression(compiler.compile(), new HashMap()); - } - - private static String getRevisedExpression(String expression) { - if (StringUtils.isEmpty(expression)) { - return expression; - } - return expression.replaceAll("import org\\.drools\\.core\\.process\\.core\\.datatype\\.impl\\.type\\.*([^;])*;", - "").replaceAll("import org\\.jbpm\\.process\\.core\\.datatype\\.impl\\.type\\.*([^;])*;", - ""); - } -} diff --git a/jbpm/jbpm-flow/src/test/java/org/jbpm/util/WidMVELEvaluatorSafeTest.java b/jbpm/jbpm-flow/src/test/java/org/jbpm/util/WidMVELEvaluatorSafeTest.java deleted file mode 100755 index 97684faf9ad..00000000000 --- a/jbpm/jbpm-flow/src/test/java/org/jbpm/util/WidMVELEvaluatorSafeTest.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.util; - -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; - -import static org.assertj.core.api.Assertions.fail; - -@Disabled("This test causes problems to surefire (see same issue with org.drools.core.util.MVELSafeHelperTest) It works when executed by itself.") -public class WidMVELEvaluatorSafeTest extends WidMVELEvaluatorTest { - - private static TestSecurityManager tsm; - - @BeforeEach - public void before() { - try { - String enginePolicy = getResouce("/policy/engine.policy"); - String kiePolicy = getResouce("/policy/kie.policy"); - System.setProperty("java.security.policy", - enginePolicy); - System.setProperty("kie.security.policy", - kiePolicy); - - tsm = new TestSecurityManager(); - System.setSecurityManager(tsm); - } catch (Exception e) { - fail("unable to initiate security manager : " + e.getMessage()); - } - } - - @AfterEach - public void after() { - System.setSecurityManager(null); - System.setProperty("java.security.policy", - ""); - System.setProperty("kie.security.policy", - ""); - } - - public static class TestSecurityManager extends SecurityManager { - - @Override - public void checkExit(int status) { - super.checkExit(status); - throw new ShouldHavePrevented("The security policy should have prevented the call to System.exit()"); - } - } - - public static class ShouldHavePrevented extends SecurityException { - - public ShouldHavePrevented(String message) { - super(message); - } - } -} diff --git a/jbpm/jbpm-flow/src/test/java/org/jbpm/util/WidMVELEvaluatorTest.java b/jbpm/jbpm-flow/src/test/java/org/jbpm/util/WidMVELEvaluatorTest.java deleted file mode 100755 index e9e17392eb2..00000000000 --- a/jbpm/jbpm-flow/src/test/java/org/jbpm/util/WidMVELEvaluatorTest.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.util; - -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.List; -import java.util.Map; - -import org.jbpm.process.core.datatype.DataType; -import org.jbpm.test.util.AbstractBaseTest; -import org.junit.jupiter.api.Test; -import org.mvel2.CompileException; - -import static org.assertj.core.api.Assertions.assertThat; - -public class WidMVELEvaluatorTest extends AbstractBaseTest { - - public void addLogger() { - logger = org.slf4j.LoggerFactory.getLogger(this.getClass()); - } - - @Test - public void testWidNoImports() throws Exception { - assertCorrectWids(WidMVELEvaluator.eval(getResourceContent("/wids/test-noimports.wid"))); - } - - @Test - public void testWidBackwardsCompatImports() throws Exception { - assertCorrectWids(WidMVELEvaluator.eval(getResourceContent("/wids/test-backwardscompat.wid"))); - } - - @Test - public void testWidBackwardsCompatPkgImports() throws Exception { - assertCorrectWids(WidMVELEvaluator.eval(getResourceContent("/wids/test-backwardscompatpkgimport.wid"))); - } - - @Test - public void testWidBackwardsCompatMixedAndMissingImports() throws Exception { - assertCorrectWids(WidMVELEvaluator.eval(getResourceContent("/wids/test-backwardscompatmixedandmissingimports.wid"))); - } - - @Test - public void testWidCustomDataType() throws Exception { - assertCorrectWids(WidMVELEvaluator.eval(getResourceContent("/wids/test-customdatatype.wid"))); - } - - @Test - public void testWidCustomDataTypeNoImport() { - try { - assertCorrectWids(WidMVELEvaluator.eval(getResourceContent("/wids/test-customdatatypenoimport.wid"))); - } catch (Throwable t) { - assertThat(t).isInstanceOf(CompileException.class); - } - } - - protected String getResourceContent(String path) throws Exception { - return new String(Files.readAllBytes(Paths.get(this.getClass().getResource(path).getPath())), "UTF-8"); - } - - protected String getResouce(String path) throws Exception { - return this.getClass().getResource(path).getFile(); - } - - private void assertCorrectWids(Object wids) { - assertThat(wids).isNotNull(); - List> widsMap = (List>) wids; - assertThat(widsMap).hasSize(2); - - Map firstWid = widsMap.get(0); - assertThat(firstWid).isNotNull().containsEntry("name", "MyFirstWorkItem"); - - Map firstWidParams = (Map) firstWid.get("parameters"); - assertThat(firstWidParams).isNotNull().hasSize(6); - - Map firstWidParamValues = (Map) firstWid.get("parameterValues"); - assertThat(firstWidParamValues).isNotNull().hasSize(1); - - Map secondWid = widsMap.get(1); - assertThat(secondWid).isNotNull().containsEntry("name", "MySecondWorkItem"); - - Map secondWidParams = (Map) secondWid.get("parameters"); - assertThat(secondWidParams).isNotNull().hasSize(6); - - Map secondWidParamValues = (Map) secondWid.get("parameterValues"); - assertThat(secondWidParamValues).isNotNull().hasSize(1); - } -} diff --git a/jbpm/jbpm-flow/src/test/resources/wids/test-backwardscompat.wid b/jbpm/jbpm-flow/src/test/resources/wids/test-backwardscompat.wid deleted file mode 100755 index 4b05562c8cf..00000000000 --- a/jbpm/jbpm-flow/src/test/resources/wids/test-backwardscompat.wid +++ /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. -// - -import org.drools.core.process.core.datatype.impl.type.StringDataType; -import org.drools.core.process.core.datatype.impl.type.BooleanDataType; -import org.drools.core.process.core.datatype.impl.type.FloatDataType; -import org.drools.core.process.core.datatype.impl.type.IntegerDataType; -import org.drools.core.process.core.datatype.impl.type.ListDataType; -import org.drools.core.process.core.datatype.impl.type.UndefinedDataType; -import org.drools.core.process.core.datatype.impl.type.EnumDataType; -import org.drools.core.process.core.datatype.impl.type.ObjectDataType; - -[ - [ - "name" : "MyFirstWorkItem", - "parameters" : [ - "One" : new StringDataType(), - "Two" : new BooleanDataType(), - "Three" : new FloatDataType(), - "Four" : new IntegerDataType(), - "Five" : new ListDataType(), - "Six" : new UndefinedDataType() - ], - "parameterValues" : [ - "One" : new EnumDataType("org.jbpm.util.CarsEnum") - ], - "Result" : new ObjectDataType(), - "displayName" : "MyFirstWorkItem", - "icon" : "defaultemailicon.gif" - ], - - [ - "name" : "MySecondWorkItem", - "parameters" : [ - "One" : new StringDataType(), - "Two" : new BooleanDataType(), - "Three" : new FloatDataType(), - "Four" : new IntegerDataType(), - "Five" : new ListDataType(), - "Six" : new UndefinedDataType() - ], - "parameterValues" : [ - "One" : new EnumDataType("org.jbpm.util.CarsEnum") - ], - "Result" : new ObjectDataType(), - "displayName" : "MySecondWorkItem", - "icon" : "defaultemailicon.gif" - ], -] diff --git a/jbpm/jbpm-flow/src/test/resources/wids/test-backwardscompatmixedandmissingimports.wid b/jbpm/jbpm-flow/src/test/resources/wids/test-backwardscompatmixedandmissingimports.wid deleted file mode 100755 index ab972200891..00000000000 --- a/jbpm/jbpm-flow/src/test/resources/wids/test-backwardscompatmixedandmissingimports.wid +++ /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. -// - -import org.drools.core.process.core.datatype.impl.type.StringDataType; -import org.drools.core.process.core.datatype.impl.type.BooleanDataType; - -import org.jbpm.process.core.datatype.impl.type.StringDataType; - -import org.jbpm.process.core.datatype.impl.type.SomeDataTypeThatDoesNotExist; - -[ - [ - "name" : "MyFirstWorkItem", - "parameters" : [ - "One" : new StringDataType(), - "Two" : new BooleanDataType(), - "Three" : new FloatDataType(), - "Four" : new IntegerDataType(), - "Five" : new ListDataType(), - "Six" : new UndefinedDataType() - ], - "parameterValues" : [ - "One" : new EnumDataType("org.jbpm.util.CarsEnum") - ], - "Result" : new ObjectDataType(), - "displayName" : "MyFirstWorkItem", - "icon" : "defaultemailicon.gif" - ], - - [ - "name" : "MySecondWorkItem", - "parameters" : [ - "One" : new StringDataType(), - "Two" : new BooleanDataType(), - "Three" : new FloatDataType(), - "Four" : new IntegerDataType(), - "Five" : new ListDataType(), - "Six" : new UndefinedDataType() - ], - "parameterValues" : [ - "One" : new EnumDataType("org.jbpm.util.CarsEnum") - ], - "Result" : new ObjectDataType(), - "displayName" : "MySecondWorkItem", - "icon" : "defaultemailicon.gif" - ], -] \ No newline at end of file diff --git a/jbpm/jbpm-flow/src/test/resources/wids/test-backwardscompatpkgimport.wid b/jbpm/jbpm-flow/src/test/resources/wids/test-backwardscompatpkgimport.wid deleted file mode 100755 index 43c8be36a2a..00000000000 --- a/jbpm/jbpm-flow/src/test/resources/wids/test-backwardscompatpkgimport.wid +++ /dev/null @@ -1,58 +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. -// - -import org.drools.core.process.core.datatype.impl.type.*; - -[ - [ - "name" : "MyFirstWorkItem", - "parameters" : [ - "One" : new StringDataType(), - "Two" : new BooleanDataType(), - "Three" : new FloatDataType(), - "Four" : new IntegerDataType(), - "Five" : new ListDataType(), - "Six" : new UndefinedDataType() - ], - "parameterValues" : [ - "One" : new EnumDataType("org.jbpm.util.CarsEnum") - ], - "Result" : new ObjectDataType(), - "displayName" : "MyFirstWorkItem", - "icon" : "defaultemailicon.gif" - ], - - [ - "name" : "MySecondWorkItem", - "parameters" : [ - "One" : new StringDataType(), - "Two" : new BooleanDataType(), - "Three" : new FloatDataType(), - "Four" : new IntegerDataType(), - "Five" : new ListDataType(), - "Six" : new UndefinedDataType() - ], - "parameterValues" : [ - "One" : new EnumDataType("org.jbpm.util.CarsEnum") - ], - "Result" : new ObjectDataType(), - "displayName" : "MySecondWorkItem", - "icon" : "defaultemailicon.gif" - ], -] diff --git a/jbpm/jbpm-flow/src/test/resources/wids/test-customdatatype.wid b/jbpm/jbpm-flow/src/test/resources/wids/test-customdatatype.wid deleted file mode 100755 index 734d2d4bad0..00000000000 --- a/jbpm/jbpm-flow/src/test/resources/wids/test-customdatatype.wid +++ /dev/null @@ -1,58 +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. -// - -import org.jbpm.util.CustomDataType; - -[ - [ - "name" : "MyFirstWorkItem", - "parameters" : [ - "One" : new CustomDataType(), - "Two" : new BooleanDataType(), - "Three" : new FloatDataType(), - "Four" : new IntegerDataType(), - "Five" : new ListDataType(), - "Six" : new UndefinedDataType() - ], - "parameterValues" : [ - "One" : new EnumDataType("org.jbpm.util.CarsEnum") - ], - "Result" : new CustomDataType(), - "displayName" : "MyFirstWorkItem", - "icon" : "defaultemailicon.gif" - ], - - [ - "name" : "MySecondWorkItem", - "parameters" : [ - "One" : new StringDataType(), - "Two" : new BooleanDataType(), - "Three" : new FloatDataType(), - "Four" : new IntegerDataType(), - "Five" : new ListDataType(), - "Six" : new UndefinedDataType() - ], - "parameterValues" : [ - "One" : new EnumDataType("org.jbpm.util.CarsEnum") - ], - "Result" : new ObjectDataType(), - "displayName" : "MySecondWorkItem", - "icon" : "defaultemailicon.gif" - ], -] \ No newline at end of file diff --git a/jbpm/jbpm-flow/src/test/resources/wids/test-customdatatypenoimport.wid b/jbpm/jbpm-flow/src/test/resources/wids/test-customdatatypenoimport.wid deleted file mode 100755 index dc3c7004bfd..00000000000 --- a/jbpm/jbpm-flow/src/test/resources/wids/test-customdatatypenoimport.wid +++ /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. -// - -[ - [ - "name" : "MyFirstWorkItem", - "parameters" : [ - "One" : new CustomDataType(), - "Two" : new BooleanDataType(), - "Three" : new FloatDataType(), - "Four" : new IntegerDataType(), - "Five" : new ListDataType(), - "Six" : new UndefinedDataType() - ], - "parameterValues" : [ - "One" : new EnumDataType("org.jbpm.util.CarsEnum") - ], - "Result" : new CustomDataType(), - "displayName" : "MyFirstWorkItem", - "icon" : "defaultemailicon.gif" - ], - - [ - "name" : "MySecondWorkItem", - "parameters" : [ - "One" : new StringDataType(), - "Two" : new BooleanDataType(), - "Three" : new FloatDataType(), - "Four" : new IntegerDataType(), - "Five" : new ListDataType(), - "Six" : new UndefinedDataType() - ], - "parameterValues" : [ - "One" : new EnumDataType("org.jbpm.util.CarsEnum") - ], - "Result" : new ObjectDataType(), - "displayName" : "MySecondWorkItem", - "icon" : "defaultemailicon.gif" - ], -] \ No newline at end of file diff --git a/jbpm/jbpm-flow/src/test/resources/wids/test-noimports.wid b/jbpm/jbpm-flow/src/test/resources/wids/test-noimports.wid deleted file mode 100755 index 79afd0d819c..00000000000 --- a/jbpm/jbpm-flow/src/test/resources/wids/test-noimports.wid +++ /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. -// - -[ - [ - "name" : "MyFirstWorkItem", - "parameters" : [ - "One" : new StringDataType(), - "Two" : new BooleanDataType(), - "Three" : new FloatDataType(), - "Four" : new IntegerDataType(), - "Five" : new ListDataType(), - "Six" : new UndefinedDataType() - ], - "parameterValues" : [ - "One" : new EnumDataType("org.jbpm.util.CarsEnum") - ], - "Result" : new ObjectDataType(), - "displayName" : "MyFirstWorkItem", - "icon" : "defaultemailicon.gif" - ], - - [ - "name" : "MySecondWorkItem", - "parameters" : [ - "One" : new StringDataType(), - "Two" : new BooleanDataType(), - "Three" : new FloatDataType(), - "Four" : new IntegerDataType(), - "Five" : new ListDataType(), - "Six" : new UndefinedDataType() - ], - "parameterValues" : [ - "One" : new EnumDataType("org.jbpm.util.CarsEnum") - ], - "Result" : new ObjectDataType(), - "displayName" : "MySecondWorkItem", - "icon" : "defaultemailicon.gif" - ], -] \ No newline at end of file diff --git a/quarkus/integration-tests/integration-tests-quarkus-processes-persistence/integration-tests-processes-persistence-common/src/main/resources/CustomTask.wid b/quarkus/integration-tests/integration-tests-quarkus-processes-persistence/integration-tests-processes-persistence-common/src/main/resources/CustomTask.wid deleted file mode 100644 index e91c5545afd..00000000000 --- a/quarkus/integration-tests/integration-tests-quarkus-processes-persistence/integration-tests-processes-persistence-common/src/main/resources/CustomTask.wid +++ /dev/null @@ -1,33 +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. -// - -[ - [ - "name" : "CustomTask", - "displayName" : "Custom Task", - "documentation" : "Basic minimal custom task.", - - "parameters" : [ - "Input" : new StringDataType() - ], - "results" : [ - "Result" : new StringDataType() - ] - ] -] \ No newline at end of file diff --git a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-filesystem/.gitignore b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-filesystem/.gitignore index c2ca403117d..e5746b6cbea 100644 --- a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-filesystem/.gitignore +++ b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-filesystem/.gitignore @@ -18,5 +18,4 @@ ### *.bpmn -*.wid /target/ diff --git a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-filesystem/pom.xml b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-filesystem/pom.xml index 1552f63af67..5e09343afcb 100644 --- a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-filesystem/pom.xml +++ b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-filesystem/pom.xml @@ -95,7 +95,6 @@ ${project.basedir}/src/main/resources **/*.bpmn - **/*.wid diff --git a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-infinispan/.gitignore b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-infinispan/.gitignore index c2ca403117d..e5746b6cbea 100644 --- a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-infinispan/.gitignore +++ b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-infinispan/.gitignore @@ -18,5 +18,4 @@ ### *.bpmn -*.wid /target/ diff --git a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-infinispan/pom.xml b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-infinispan/pom.xml index 81108b3bfbd..5054c7c4156 100644 --- a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-infinispan/pom.xml +++ b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-infinispan/pom.xml @@ -120,7 +120,6 @@ ${project.basedir}/src/main/resources **/*.bpmn - **/*.wid diff --git a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-jdbc/.gitignore b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-jdbc/.gitignore index c2ca403117d..e5746b6cbea 100644 --- a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-jdbc/.gitignore +++ b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-jdbc/.gitignore @@ -18,5 +18,4 @@ ### *.bpmn -*.wid /target/ diff --git a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-jdbc/pom.xml b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-jdbc/pom.xml index f967b626380..790361dfe8f 100644 --- a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-jdbc/pom.xml +++ b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-jdbc/pom.xml @@ -112,7 +112,6 @@ ${project.basedir}/src/main/resources **/*.bpmn - **/*.wid diff --git a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-mongodb/.gitignore b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-mongodb/.gitignore index a180e83ba79..cd27123c4fc 100644 --- a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-mongodb/.gitignore +++ b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-mongodb/.gitignore @@ -18,4 +18,3 @@ ### *.bpmn -*.wid diff --git a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-mongodb/pom.xml b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-mongodb/pom.xml index 07a2eec267d..7f8bb15e3e6 100644 --- a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-mongodb/pom.xml +++ b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-mongodb/pom.xml @@ -104,7 +104,6 @@ ${project.basedir}/src/main/resources **/*.bpmn - **/*.wid diff --git a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-persistence-common/src/main/resources/CustomTask.wid b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-persistence-common/src/main/resources/CustomTask.wid deleted file mode 100644 index e91c5545afd..00000000000 --- a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-persistence-common/src/main/resources/CustomTask.wid +++ /dev/null @@ -1,33 +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. -// - -[ - [ - "name" : "CustomTask", - "displayName" : "Custom Task", - "documentation" : "Basic minimal custom task.", - - "parameters" : [ - "Input" : new StringDataType() - ], - "results" : [ - "Result" : new StringDataType() - ] - ] -] \ No newline at end of file diff --git a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-postgresql/.gitignore b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-postgresql/.gitignore index a180e83ba79..cd27123c4fc 100644 --- a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-postgresql/.gitignore +++ b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-postgresql/.gitignore @@ -18,4 +18,3 @@ ### *.bpmn -*.wid diff --git a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-postgresql/pom.xml b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-postgresql/pom.xml index 7ed90b3c37e..b454ed8004f 100644 --- a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-postgresql/pom.xml +++ b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/integration-tests-springboot-processes-postgresql/pom.xml @@ -109,7 +109,6 @@ ${project.basedir}/src/main/resources **/*.bpmn - **/*.wid diff --git a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/pom.xml b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/pom.xml index ac43bc7bec8..a44daa7807f 100644 --- a/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/pom.xml +++ b/springboot/integration-tests/integration-tests-springboot-processes-persistence-it/pom.xml @@ -196,7 +196,6 @@ ${project.parent.basedir}/integration-tests-springboot-processes-persistence-common/src/main/resources **/*.bpmn - **/*.wid From da8e17238367dec6e359c8de2d80d499d375b59b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pere=20Fern=C3=A1ndez?= Date: Tue, 19 Nov 2024 19:33:27 +0100 Subject: [PATCH 3/6] incubator-kie-issues#1626: Fix Typo in public API method for custom User Task assignment strategy (#3786) - Included reassignments typos. --- .../kogito/usertask/UserTaskAssignmentStrategy.java | 2 +- .../org/kie/kogito/usertask/model/Reassignment.java | 2 +- .../org/kie/kogito/usertask/impl/AbstractUserTask.java | 10 +++++----- .../usertask/impl/BasicUserTaskAssignmentStrategy.java | 2 +- .../kogito/usertask/impl/DefaultUserTaskInstance.java | 8 ++++---- .../impl/lifecycle/DefaultUserTaskLifeCycle.java | 2 +- .../kie/kogito/usertask/impl/model/DeadlineHelper.java | 4 ++-- .../kogito/usertask/impl/model/DeadlineHelperTest.java | 6 +++--- .../kie/kogito/codegen/usertask/UserTaskCodegen.java | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/api/kogito-api/src/main/java/org/kie/kogito/usertask/UserTaskAssignmentStrategy.java b/api/kogito-api/src/main/java/org/kie/kogito/usertask/UserTaskAssignmentStrategy.java index 985a5d25572..47086286508 100644 --- a/api/kogito-api/src/main/java/org/kie/kogito/usertask/UserTaskAssignmentStrategy.java +++ b/api/kogito-api/src/main/java/org/kie/kogito/usertask/UserTaskAssignmentStrategy.java @@ -30,6 +30,6 @@ default String getName() { return getClass().getName(); } - Optional computeAssigment(UserTaskInstance userTaskInstance, IdentityProvider identityProvider); + Optional computeAssignment(UserTaskInstance userTaskInstance, IdentityProvider identityProvider); } diff --git a/api/kogito-api/src/main/java/org/kie/kogito/usertask/model/Reassignment.java b/api/kogito-api/src/main/java/org/kie/kogito/usertask/model/Reassignment.java index 89bda5921fc..dc1c6e90b48 100644 --- a/api/kogito-api/src/main/java/org/kie/kogito/usertask/model/Reassignment.java +++ b/api/kogito-api/src/main/java/org/kie/kogito/usertask/model/Reassignment.java @@ -52,7 +52,7 @@ public Set getPotentialGroups() { @Override public String toString() { - return "Reassigment [potentialUsers=" + potentialUsers + ", potentialGroups=" + potentialGroups + "]"; + return "Reassignment [potentialUsers=" + potentialUsers + ", potentialGroups=" + potentialGroups + "]"; } @Override diff --git a/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/AbstractUserTask.java b/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/AbstractUserTask.java index 8fb214c0b17..1f103115291 100644 --- a/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/AbstractUserTask.java +++ b/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/AbstractUserTask.java @@ -46,7 +46,7 @@ public abstract class AbstractUserTask implements UserTask { private Set excludedUsers; private Collection> startDeadlines; private Collection> endDeadlines; - private Collection> startReassigments; + private Collection> startReassignments; private Collection> endReassignments; public AbstractUserTask(String id, String name) { @@ -60,7 +60,7 @@ public AbstractUserTask(String id, String name) { this.excludedUsers = new HashSet<>(); this.startDeadlines = new HashSet<>(); this.endDeadlines = new HashSet<>(); - this.startReassigments = new HashSet<>(); + this.startReassignments = new HashSet<>(); this.endReassignments = new HashSet<>(); } @@ -223,11 +223,11 @@ public void setNotCompletedDeadlines(String notStarted) { @Override public Collection> getNotStartedReassignments() { - return startReassigments; + return startReassignments; } public void setNotStartedReassignments(String reassignments) { - this.startReassigments = DeadlineHelper.parseReassignments(reassignments); + this.startReassignments = DeadlineHelper.parseReassignments(reassignments); } @Override @@ -235,7 +235,7 @@ public Collection> getNotCompletedReassignments() { return endReassignments; } - public void setNotCompletedReassigments(String reassignments) { + public void setNotCompletedReassignments(String reassignments) { this.endReassignments = DeadlineHelper.parseReassignments(reassignments); } diff --git a/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/BasicUserTaskAssignmentStrategy.java b/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/BasicUserTaskAssignmentStrategy.java index 076a62c313e..2d6fddcdffc 100644 --- a/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/BasicUserTaskAssignmentStrategy.java +++ b/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/BasicUserTaskAssignmentStrategy.java @@ -34,7 +34,7 @@ public String getName() { } @Override - public Optional computeAssigment(UserTaskInstance userTaskInstance, IdentityProvider identityProvider) { + public Optional computeAssignment(UserTaskInstance userTaskInstance, IdentityProvider identityProvider) { Set users = new HashSet<>(userTaskInstance.getPotentialUsers()); users.removeAll(userTaskInstance.getExcludedUsers()); if (users.size() == 1) { diff --git a/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/DefaultUserTaskInstance.java b/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/DefaultUserTaskInstance.java index 15e2477fc1e..26cfb631a8b 100644 --- a/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/DefaultUserTaskInstance.java +++ b/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/DefaultUserTaskInstance.java @@ -105,7 +105,7 @@ public class DefaultUserTaskInstance implements UserTaskInstance { private Collection> notStartedReassignments; - private Collection> notCompletedReassigments; + private Collection> notCompletedReassignments; private Map notStartedDeadlinesTimers; @@ -643,11 +643,11 @@ public void setNotStartedReassignments(Collection> no @Override public Collection> getNotCompletedReassignments() { - return notCompletedReassigments; + return notCompletedReassignments; } - public void setNotCompletedReassignments(Collection> notCompletedReassigments) { - this.notCompletedReassigments = notCompletedReassigments; + public void setNotCompletedReassignments(Collection> notCompletedReassignments) { + this.notCompletedReassignments = notCompletedReassignments; } public void setJobsService(JobsService jobsService) { diff --git a/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/lifecycle/DefaultUserTaskLifeCycle.java b/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/lifecycle/DefaultUserTaskLifeCycle.java index 5b871d2a8f6..986de80780b 100644 --- a/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/lifecycle/DefaultUserTaskLifeCycle.java +++ b/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/lifecycle/DefaultUserTaskLifeCycle.java @@ -216,7 +216,7 @@ public Optional fail(UserTaskInstance userTaskInstance, private String assignStrategy(UserTaskInstance userTaskInstance, IdentityProvider identityProvider) { UserTaskAssignmentStrategy assignmentStrategy = userTaskInstance.getUserTask().getAssignmentStrategy(); - return assignmentStrategy.computeAssigment(userTaskInstance, identityProvider).orElse(null); + return assignmentStrategy.computeAssignment(userTaskInstance, identityProvider).orElse(null); } private void checkPermission(UserTaskInstance userTaskInstance, IdentityProvider identityProvider) { diff --git a/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/model/DeadlineHelper.java b/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/model/DeadlineHelper.java index 3e0793830b6..e492bfcc737 100644 --- a/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/model/DeadlineHelper.java +++ b/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/model/DeadlineHelper.java @@ -93,7 +93,7 @@ public static Collection> parseReassignments(Object t if (text instanceof String textString && textString.isBlank()) { return Collections.emptyList(); } - return parseDeadlines(text, DeadlineHelper::parseReassigment, DeadlineHelper::getReassignmentSchedule); + return parseDeadlines(text, DeadlineHelper::parseReassignment, DeadlineHelper::getReassignmentSchedule); } public static Collection> parseDeadlines(Object text) { @@ -221,7 +221,7 @@ private static Map asMap(String text) { return result; } - private static Reassignment parseReassigment(String text) { + private static Reassignment parseReassignment(String text) { Map map = asMap(text); return new Reassignment(parseSet(map.get("users")), parseSet(map.get("groups"))); } diff --git a/jbpm/jbpm-usertask/src/test/java/org/kie/kogito/usertask/impl/model/DeadlineHelperTest.java b/jbpm/jbpm-usertask/src/test/java/org/kie/kogito/usertask/impl/model/DeadlineHelperTest.java index 2c022d7672d..2f83ce37530 100644 --- a/jbpm/jbpm-usertask/src/test/java/org/kie/kogito/usertask/impl/model/DeadlineHelperTest.java +++ b/jbpm/jbpm-usertask/src/test/java/org/kie/kogito/usertask/impl/model/DeadlineHelperTest.java @@ -239,10 +239,10 @@ public void testMultipleNotification() { @Test public void testReassignment() { - Collection> reassigments = DeadlineHelper.parseReassignments( + Collection> reassignments = DeadlineHelper.parseReassignments( "[users:Pepe,Pepa|groups:Admin,Managers]@[1m]"); - assertThat(reassigments).hasSize(1); - DeadlineInfo reassignment = reassigments.iterator().next(); + assertThat(reassignments).hasSize(1); + DeadlineInfo reassignment = reassignments.iterator().next(); assertThat(reassignment.getNotification().getPotentialUsers()).containsExactlyInAnyOrder("Pepe", "Pepa"); assertThat(reassignment.getNotification().getPotentialGroups()).containsExactlyInAnyOrder("Admin", "Managers"); assertThat(reassignment.getScheduleInfo().iterator().next().getDuration()).isEqualTo(Duration.ofMinutes(1)); diff --git a/kogito-codegen-modules/kogito-codegen-processes/src/main/java/org/kie/kogito/codegen/usertask/UserTaskCodegen.java b/kogito-codegen-modules/kogito-codegen-processes/src/main/java/org/kie/kogito/codegen/usertask/UserTaskCodegen.java index 9f4e1abb8d0..83a6c998f36 100644 --- a/kogito-codegen-modules/kogito-codegen-processes/src/main/java/org/kie/kogito/codegen/usertask/UserTaskCodegen.java +++ b/kogito-codegen-modules/kogito-codegen-processes/src/main/java/org/kie/kogito/codegen/usertask/UserTaskCodegen.java @@ -227,7 +227,7 @@ public List generateUserTask() { block.addStatement(new MethodCallExpr(new ThisExpr(), "setNotStartedDeadLines", NodeList.nodeList(toDeadlineExpression(info.getParameter("NotStartedNotify"))))); block.addStatement(new MethodCallExpr(new ThisExpr(), "setNotCompletedDeadlines", NodeList.nodeList(toDeadlineExpression(info.getParameter("NotCompletedNotify"))))); block.addStatement(new MethodCallExpr(new ThisExpr(), "setNotStartedReassignments", NodeList.nodeList(toDeadlineExpression(info.getParameter("NotStartedReassign"))))); - block.addStatement(new MethodCallExpr(new ThisExpr(), "setNotCompletedReassigments", NodeList.nodeList(toDeadlineExpression(info.getParameter("NotCompletedReassign"))))); + block.addStatement(new MethodCallExpr(new ThisExpr(), "setNotCompletedReassignments", NodeList.nodeList(toDeadlineExpression(info.getParameter("NotCompletedReassign"))))); generatedFiles.add(new GeneratedFile(GeneratedFileType.SOURCE, UserTaskCodegenHelper.path(info).resolve(className + ".java"), unit.toString())); } @@ -240,7 +240,7 @@ private Expression toDeadlineExpression(Object parameter) { DeadlineHelper.parseDeadlines(stringParam); return toStringExpression(stringParam); } catch (Exception e) { - LOG.debug("to deadline calculation failure. {} it is not a proper expression"); + LOG.debug("to deadline calculation failure. {} it is not a proper expression", stringParam); } } return new CastExpr(StaticJavaParser.parseType(String.class.getName()), new NullLiteralExpr()); From 89aa79f49f0e0fc6d30a0faabd1d9f46edde2321 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:23:54 +0100 Subject: [PATCH 4/6] [Fix #3782] Properly resolving root dir in all CI environments (#3783) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Fix #3782] Properly resolving root dir in all CI environments * Update kogito-build/kogito-build-no-bom-parent/pom.xml Co-authored-by: Gonzalo Muñoz * Use relative path for resources * Change phase to validate * [Fix #3782] Using relative path --------- Co-authored-by: Gonzalo Muñoz Co-authored-by: gmunozfe --- .../kogito-build-no-bom-parent/pom.xml | 22 ++++++++++++++++++- .../pom.xml | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/kogito-build/kogito-build-no-bom-parent/pom.xml b/kogito-build/kogito-build-no-bom-parent/pom.xml index 94e930a526e..b7c3505d201 100644 --- a/kogito-build/kogito-build-no-bom-parent/pom.xml +++ b/kogito-build/kogito-build-no-bom-parent/pom.xml @@ -87,7 +87,6 @@ possible to measure cross-module test coverage --> ${project.root.dir}/target/jacoco.exec - ${maven.multiModuleProjectDirectory} org.jboss.logmanager.LogManager **/*Test.java **/*IT.java @@ -671,10 +670,31 @@ true + + org.commonjava.maven.plugins + directory-maven-plugin + 1.0 + + + directories + + highest-basedir + + validate + + project.root.dir + + + + + + org.commonjava.maven.plugins + directory-maven-plugin + net.revelc.code.formatter formatter-maven-plugin diff --git a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-image-integration-test/pom.xml b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-image-integration-test/pom.xml index 0cde3b27060..a9ba1c715f0 100644 --- a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-image-integration-test/pom.xml +++ b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-image-integration-test/pom.xml @@ -87,7 +87,7 @@ src/main/resources - ${project.root.dir}/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/main/resources + ../kogito-quarkus-serverless-workflow-integration-test/src/main/resources expression.sw.json schema/expressionInput.json From f7a1fda9f24c1265487f381655063544bbf75dfd Mon Sep 17 00:00:00 2001 From: Yeser Amer Date: Wed, 20 Nov 2024 20:02:07 +0100 Subject: [PATCH 5/6] Explicitly declaring xstream to override a transitively imported version affected by CVE (#3785) * exclude_xstream * Updated comment * change * change * change * change --- kogito-build/kogito-dependencies-bom/pom.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kogito-build/kogito-dependencies-bom/pom.xml b/kogito-build/kogito-dependencies-bom/pom.xml index 6e3de9522a3..9d4c812444c 100644 --- a/kogito-build/kogito-dependencies-bom/pom.xml +++ b/kogito-build/kogito-dependencies-bom/pom.xml @@ -155,6 +155,9 @@ 1.0 33.0.0-jre 1.26.1 + + 1.4.21 @@ -451,6 +454,14 @@ ${version.jakarta.persistence-api} + + + com.thoughtworks.xstream + xstream + ${version.com.thoughtworks.xstream} + + org.junit.jupiter junit-jupiter-api From 6e47f9c02f20fa01399e5d09c86f18aa73b971d5 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> Date: Fri, 22 Nov 2024 12:38:26 +0100 Subject: [PATCH 6/6] [Fix #3789] Accept join node on compensation states (#3790) --- .../workflow/parser/handlers/StateHandler.java | 6 +++++- .../src/main/resources/compensation.sw.json | 13 ++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java b/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java index e0dbbf5ee99..740deb8a75f 100644 --- a/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java +++ b/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java @@ -184,7 +184,7 @@ private WorkflowElementIdentifier handleCompensation(RuleFlowNodeContainerFactor Transition transition = compensation.getState().getTransition(); compensation.handleTransitions(embeddedSubProcess, transition, compensation.getNode()); compensation.handleConnections(embeddedSubProcess); - return compensation.getNode().getNode().getId(); + return compensation.getOutgoingNode().getNode().getId(); } public void handleState() { @@ -335,6 +335,10 @@ private void connectEnd(RuleFlowNodeContainerFactory factory) { return node; } + public final NodeFactory getOutgoingNode() { + return outgoingNode; + } + public S getState() { return state; } diff --git a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/main/resources/compensation.sw.json b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/main/resources/compensation.sw.json index 8c35b7c4fc6..18439b8bf9a 100644 --- a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/main/resources/compensation.sw.json +++ b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/main/resources/compensation.sw.json @@ -70,7 +70,18 @@ "errorRef": "OddException", "transition": "OddHandler" } - ] + ], + "transition": "compensating_even_more" + }, + { + "name": "compensating_even_more", + "usedForCompensation" : true, + "type": "parallel", + "branches": [ + {"name": "branch1", "actions" :[]}, + {"name": "branch2", "actions" :[]} + + ] }, { "name": "OddHandler", "type":"inject",