Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
Issue #157
  • Loading branch information
rsoika committed Oct 3, 2024
1 parent 59a3fd3 commit 8d3efa3
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,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 link
if ("Link".equals(category)) {
Event bpmnEvent = (Event) bpmnElement;
Set<Element> oldDefinitionList = bpmnEvent.getEventDefinitionsByType("linkEventDefinition");

JsonArray dataList = json.getJsonArray("links");

// synchronize the definition list of the event element
Set<Element> linkEventDefinitions = synchronizeEventDefinitions("linkEventDefinition", bpmnEvent,
dataList);

if (oldDefinitionList.size() != linkEventDefinitions.size()) {
updateClient = true;
}
// just update the values one by one by referring to the signalRef id by
// comparing the name
Iterator<Element> iter = linkEventDefinitions.iterator();
Expand All @@ -155,7 +160,11 @@ public boolean updatePropertiesData(final JsonObject json, final String category
}
}

return false;
if (updateClient) {
// modelState.reset();
modelState.refreshGModelState();
}
return updateClient;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 signals
if ("Signals".equals(category)) {

Event bpmnEvent = (Event) bpmnElement;
Set<Element> oldDefinitionList = bpmnEvent.getEventDefinitionsByType("signalEventDefinition");

JsonArray dataList = json.getJsonArray("signals");
// synchronize the definition list of the event element
Set<Element> signalEventDefinitions = synchronizeEventDefinitions("signalEventDefinition", bpmnEvent,
dataList);
if (oldDefinitionList.size() != signalEventDefinitions.size()) {
updateClient = true;
}
// now we can update the values
Iterator<Element> iter = signalEventDefinitions.iterator();
int i = 0;
Expand All @@ -185,7 +191,11 @@ public boolean updatePropertiesData(final JsonObject json, final String category
// update completed
}
}
return false;
if (updateClient) {
// modelState.reset();
modelState.refreshGModelState();
}
return updateClient;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,21 @@ 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 'Timer Definitions'
if ("Timer Definitions".equals(category)) {

Event bpmnEvent = (Event) bpmnElement;
Set<Element> oldDefinitionList = bpmnEvent.getEventDefinitionsByType("timerEventDefinition");

JsonArray dataList = json.getJsonArray("timers");

// synchronize the definition list of the event element
Set<Element> timerEventDefinitions = synchronizeEventDefinitions("timerEventDefinition", bpmnEvent,
dataList);
if (oldDefinitionList.size() != timerEventDefinitions.size()) {
updateClient = true;
}

// now we can update the values one by one
// NOTE: the id can change within the definitionList if an element was deleted
Expand Down Expand Up @@ -239,6 +245,10 @@ public boolean updatePropertiesData(final JsonObject json, final String category
// update completed
}
}
return false;
if (updateClient) {
// modelState.reset();
modelState.refreshGModelState();
}
return updateClient;
}
}

0 comments on commit 8d3efa3

Please sign in to comment.