Skip to content

Commit

Permalink
fixed customFormController
Browse files Browse the repository at this point in the history
Issue #597
  • Loading branch information
rsoika committed Sep 9, 2024
1 parent 3b24d17 commit 13ed830
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 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 @@ -99,16 +99,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
3 changes: 2 additions & 1 deletion workflow/test/debug-de-1.0.0.bpmn
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<imixs:value><![CDATA[org.imixs.workflow.engine.plugins.IntervalPlugin]]></imixs:value>
<imixs:value><![CDATA[org.imixs.workflow.engine.plugins.EventLogPlugin]]></imixs:value>
</imixs:item>
<open-bpmn:auto-align/>
</bpmn2:extensionElements>
<bpmn2:signal id="Signal_1" name="org.imixs.ml.workflow.MLAdapter"/>
<bpmn2:signal id="Signal_2" name="org.imixs.archive.documents.OCRDocumentAdapter"/>
Expand Down Expand Up @@ -608,7 +609,7 @@ if (workitem.getItemValueString('txtcomment')=='') {
</imixs-form-section>
<imixs-form-section columns="2">
<item name="debug.user" type="custom" path="userinput" label="Responsible2:" />
<item name="debug.user" type="custom" path="userinput" label="Responsible:" />
<item name="debug.team" type="custom" path="userlistinput" label="Team:" />
<item name="invoice.ref" type="custom" path="workitemlink" label="Invoice No.:" options="($workflowgroup:Rechnungseingang)" />
<item type="custom" path="workitemlink" label="Order No.:" options="($workflowgroup:Bedarfsmeldung)" />
Expand Down

0 comments on commit 13ed830

Please sign in to comment.