From 59a3fd31c11044fefc39819569d60eb4f10e7845 Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Tue, 24 Sep 2024 08:18:00 +0200 Subject: [PATCH] improvements Issue #157 --- .../elements/MessageEventDefinitionExtension.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/open-bpmn.glsp-server/src/main/java/org/openbpmn/extensions/elements/MessageEventDefinitionExtension.java b/open-bpmn.glsp-server/src/main/java/org/openbpmn/extensions/elements/MessageEventDefinitionExtension.java index bac5585f..443326e0 100644 --- a/open-bpmn.glsp-server/src/main/java/org/openbpmn/extensions/elements/MessageEventDefinitionExtension.java +++ b/open-bpmn.glsp-server/src/main/java/org/openbpmn/extensions/elements/MessageEventDefinitionExtension.java @@ -164,14 +164,20 @@ public void buildPropertiesForm(final BPMNElement bpmnElement, final DataBuilder public boolean updatePropertiesData(final JsonObject json, final String category, final BPMNElement bpmnElement, final GModelElement gNodeElement) { + boolean updateClient = false; // we are only interested in category messages if ("Message Objects".equals(category)) { Event bpmnEvent = (Event) bpmnElement; + Set oldDefinitionList = bpmnEvent.getEventDefinitionsByType("messageEventDefinition"); + JsonArray dataList = json.getJsonArray("messageRefs"); // synchronize the definition list of the event element Set messageEventDefinitions = synchronizeEventDefinitions("messageEventDefinition", bpmnEvent, dataList); + if (oldDefinitionList.size() != messageEventDefinitions.size()) { + updateClient = true; + } // now we can update the values Iterator iter = messageEventDefinitions.iterator(); int i = 0; @@ -184,8 +190,15 @@ public boolean updatePropertiesData(final JsonObject json, final String category i++; // update completed } + + } + + if (updateClient) { + // modelState.reset(); + modelState.refreshGModelState(); + } - return false; + return updateClient; } }