summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/process/ProcessEngineImpl.java25
1 files changed, 24 insertions, 1 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 ce4aa15b..b6b42850 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
@@ -87,10 +87,13 @@ public class ProcessEngineImpl implements ProcessEngine {
@Override
public String registerProcessDefinition(InputStream processDefinitionInputStream) throws ProcessDefinitionParserException{
ProcessDefinition pd = pdp.parse(processDefinitionInputStream);
+
+ postValidationOfProcessDefintion(pd);
+
registerProcessDefinition(pd);
return pd.getId();
}
-
+
/**
* Sets the process definitions.
*
@@ -445,4 +448,24 @@ public class ProcessEngineImpl implements ProcessEngine {
}
+ /**
+ * Perform some post-validation operations on process definition
+ *
+ * Like: check if all tasks that are defined are available on context
+ *
+ * @param pd
+ * @throws ProcessDefinitionParserException
+ */
+ private void postValidationOfProcessDefintion(ProcessDefinition pd) throws ProcessDefinitionParserException{
+ try {
+ for(TaskInfo task : pd.getTaskInfos().values()) {
+ createTaskInstance(task);
+ }
+
+ } catch (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);
+
+ }
+ }
}