Skip to content

Commit

Permalink
fix(update): Application update must also replace application links. (#…
Browse files Browse the repository at this point in the history
…386)

Now that Application Links are compatible with platform mode,
we must also delete them silently when updating, just like legacy apps.

Relates to [BPM-274](https://bonitasoft.atlassian.net/browse/BPM-274)
  • Loading branch information
vhemery authored Sep 19, 2024
1 parent a792958 commit f83d981
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,18 @@ List<String> readApplicationTokensFromFile(File application) {
List<String> tokens = new ArrayList<>();
final XmlDocumentParser documentParser = new XmlDocumentParser();
Document doc = documentParser.parse(application);
// find legacy applications
NodeList nodeList = documentParser.queryNodeList(doc, "/applications/application/@token");
for (int i = 0; i < nodeList.getLength(); i++) {
Node item = nodeList.item(i);
tokens.add(item.getNodeValue());
}
// find application links
nodeList = documentParser.queryNodeList(doc, "/applications/applicationLink/@token");
for (int i = 0; i < nodeList.getLength(); i++) {
Node item = nodeList.item(i);
tokens.add(item.getNodeValue());
}
return tokens;
}

Expand Down

0 comments on commit f83d981

Please sign in to comment.