Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
Issue #607
  • Loading branch information
rsoika committed Sep 14, 2024
1 parent 64480e5 commit dcf6494
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<CustomFormSection>();
if (!content.isEmpty()) {
// start parsing....
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,22 @@ 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.
* <p>
* 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
*/
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;
Expand Down

0 comments on commit dcf6494

Please sign in to comment.