summaryrefslogtreecommitdiff
path: root/eaaf_core/src/main
diff options
context:
space:
mode:
authorThomas <>2022-01-09 16:54:19 +0100
committerThomas <>2022-01-09 16:54:19 +0100
commitb5980663a63b3c128a8714fe7c13339eaa0a2955 (patch)
tree1925491265aa19dcdb221be6ae05fdb4d700e533 /eaaf_core/src/main
parente3639ef805f1e525415c43cbda80ed71cc43a70c (diff)
downloadEAAF-Components-b5980663a63b3c128a8714fe7c13339eaa0a2955.tar.gz
EAAF-Components-b5980663a63b3c128a8714fe7c13339eaa0a2955.tar.bz2
EAAF-Components-b5980663a63b3c128a8714fe7c13339eaa0a2955.zip
fix(core): change validation of loaded process-definitions to fix problem of circular-dependencies loading
Diffstat (limited to 'eaaf_core/src/main')
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/process/ProcessEngineImpl.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/process/ProcessEngineImpl.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/process/ProcessEngineImpl.java
index 6e83a201..6080445d 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/process/ProcessEngineImpl.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/process/ProcessEngineImpl.java
@@ -22,8 +22,11 @@ package at.gv.egiz.eaaf.core.impl.idp.process;
import java.io.InputStream;
import java.io.Serializable;
import java.text.MessageFormat;
+import java.util.Arrays;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.collections4.IterableUtils;
@@ -521,18 +524,15 @@ public class ProcessEngineImpl implements ProcessEngine {
* @throws ProcessDefinitionParserException In case of a parser error
*/
private void postValidationOfProcessDefintion(final ProcessDefinition pd)
- throws ProcessDefinitionParserException {
- try {
- for (final TaskInfo task : pd.getTaskInfos().values()) {
- createTaskInstance(task);
- }
-
- } catch (final ProcessExecutionException e) {
- log.error("Post-validation of process definition: {} find an error: {}", pd.getId(),
- e.getMessage());
- throw new ProcessDefinitionParserException(
- "Post-validation find an error in process definition:" + pd.getId(), e);
-
+ throws ProcessDefinitionParserException {
+ List<String> beanNames = Arrays.asList(context.getBeanDefinitionNames());
+ Optional<TaskInfo> missing = pd.getTaskInfos().values().stream()
+ .filter(el -> !beanNames.contains(el.getTaskImplementingClass()))
+ .findFirst();
+ if (missing.isPresent()) {
+ log.error("Post-validation of process definition: {} find an error. Missing bean with name: {}",
+ pd.getId(), missing.get().getTaskImplementingClass());
+
}
}
}