diff --git a/imixs-office-workflow-util/src/main/java/org/imixs/workflow/office/forms/CustomFormController.java b/imixs-office-workflow-util/src/main/java/org/imixs/workflow/office/forms/CustomFormController.java index 89ed3711..c473987c 100644 --- a/imixs-office-workflow-util/src/main/java/org/imixs/workflow/office/forms/CustomFormController.java +++ b/imixs-office-workflow-util/src/main/java/org/imixs/workflow/office/forms/CustomFormController.java @@ -135,11 +135,7 @@ public void onWorkflowEvent(@Observes WorkflowEvent workflowEvent) throws ModelE */ public void computeFieldDefinition(ItemCollection workitem) throws ModelException { logger.fine("---> computeFieldDefinition"); - String content = workitem.getItemValueString("txtWorkflowEditorCustomForm"); - if (content.isEmpty()) { - // no custom form definition found, try to load a new one.... - content = customFormService.updateCustomFieldDefinition(workitem); - } + String content = customFormService.updateCustomFieldDefinition(workitem); sections = new ArrayList(); if (!content.isEmpty()) { // start parsing.... diff --git a/imixs-office-workflow-util/src/main/java/org/imixs/workflow/office/forms/CustomFormService.java b/imixs-office-workflow-util/src/main/java/org/imixs/workflow/office/forms/CustomFormService.java index 1f27355b..dd05dc2a 100644 --- a/imixs-office-workflow-util/src/main/java/org/imixs/workflow/office/forms/CustomFormService.java +++ b/imixs-office-workflow-util/src/main/java/org/imixs/workflow/office/forms/CustomFormService.java @@ -99,7 +99,11 @@ public void onWorkflowEvent(@Observes ProcessingEvent processingEvent) throws Mo /** * This method updates the custom Field Definition based on a given workitem. * The method first looks if the model contains a custom definition and stores - * the data into the field txtWorkflowEditorCustomForm + * the data into the field txtWorkflowEditorCustomForm. + *

+ * In case the model does not provide a custom Field Definition but the workitem + * has stored one the method returns the existing one and did not update the + * item 'txtWorkflowEditorCustomForm' * * @return * @throws ModelException @@ -107,8 +111,10 @@ public void onWorkflowEvent(@Observes ProcessingEvent processingEvent) throws Mo public String updateCustomFieldDefinition(ItemCollection workitem) throws ModelException { logger.fine("---> updateCustomFieldDefinition"); String content = fetchFormDefinitionFromModel(workitem); - if (!content.isEmpty()) { - // store the new content + if (content.isEmpty()) { + // take the existing one to be returned... + content = workitem.getItemValueString("txtWorkflowEditorCustomForm"); + } else { workitem.replaceItemValue("txtWorkflowEditorCustomForm", content); } return content; diff --git a/workflow/test/debug-de-1.0.0.bpmn b/workflow/test/debug-de-1.0.0.bpmn index ae8b3567..2a8ad6ef 100644 --- a/workflow/test/debug-de-1.0.0.bpmn +++ b/workflow/test/debug-de-1.0.0.bpmn @@ -36,6 +36,7 @@ + @@ -608,7 +609,7 @@ if (workitem.getItemValueString('txtcomment')=='') { - +