Skip to content

Commit

Permalink
Remove unnecessary logic for historyTimeToLive in CwsConsoleService
Browse files Browse the repository at this point in the history
  • Loading branch information
wcgunter committed Nov 27, 2023
1 parent c46bcad commit be2fd8e
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions cws-service/src/main/java/jpl/cws/service/CwsConsoleService.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,6 @@ public String deployProcessDefinition(String bpmnXml, BpmnModelInstance model, S
deployedProcDef.getKey(), deployedProcDef.getDeploymentId());
}

String historyTimeToLive = getHistoryTimeToLive(bpmnXml);
log.info("New process definition has historyTimeToLive of: " + historyTimeToLive);
if (historyTimeToLive == null) {
log.info("Setting historyTimeToLive to default value: " + historyDaysToLive);
historyTimeToLive = historyDaysToLive;
}

repositoryService.updateProcessDefinitionHistoryTimeToLive(deployedProcDef.getId(), Integer.parseInt(historyTimeToLive));

// Notify workers that there has been a change
// to the set of deployed process definitions
//
Expand Down Expand Up @@ -370,22 +361,6 @@ private boolean containsProcessStartAsync(BpmnModelInstance model) {
return acc;
}

private String getHistoryTimeToLive(String xml) {
if (!xml.contains("camunda:historyTimeToLive")) {
return null;
} else {
String value = xml.substring(xml.indexOf("camunda:historyTimeToLive=") + 27);
value = value.substring(0, value.indexOf('"'));
if (value.startsWith("P")) {
value = value.substring(1, value.length());
}
if (value.endsWith("D") || value.endsWith("M") || value.endsWith("Y")) {
value = value.substring(0, value.length()-1);
}
return value;
}
}

private boolean hasName(BpmnModelInstance model) {
ModelElementType processType = model.getModel().getType(Process.class);
Collection<ModelElementInstance> processInstances = model.getModelElementsByType(processType);
Expand Down

0 comments on commit be2fd8e

Please sign in to comment.