diff options
author | Thomas <thomas.lenz@egiz.gv.at> | 2019-10-18 10:32:10 +0200 |
---|---|---|
committer | Thomas <thomas.lenz@egiz.gv.at> | 2019-10-18 10:32:10 +0200 |
commit | ef6b8445fd344501bc767c4d73d3ce9de4a8b9ee (patch) | |
tree | 2387dc55e1bf64554d10b875b7d970f7ecfe4e2b /eaaf_core/src/main | |
parent | 984da0a51743f2a8159548d5b626353022868677 (diff) | |
download | EAAF-Components-ef6b8445fd344501bc767c4d73d3ce9de4a8b9ee.tar.gz EAAF-Components-ef6b8445fd344501bc767c4d73d3ce9de4a8b9ee.tar.bz2 EAAF-Components-ef6b8445fd344501bc767c4d73d3ce9de4a8b9ee.zip |
add post-validation steps into process-definition loader
Diffstat (limited to 'eaaf_core/src/main')
-rw-r--r-- | eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/process/ProcessEngineImpl.java | 25 |
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); + + } + } } |