Skip to content

Commit

Permalink
TaskTemplate params bug resolved (#5503)
Browse files Browse the repository at this point in the history
  • Loading branch information
cppwfs authored Oct 10, 2023
1 parent c8bb557 commit d7fc7ad
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2021 the original author or authors.
* Copyright 2015-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -303,14 +303,18 @@ public void cleanup(long id, String schemaTarget) {
@Override
public void cleanup(long id, String schemaTarget, boolean removeData) {
MultiValueMap<String, Object> values = new LinkedMultiValueMap<>();
if (StringUtils.hasText(schemaTarget)) {
values.add("schemaTarget", schemaTarget);
}

String uriTemplate = executionLink.expand(id).getHref();

if (removeData) {
values.add("action", "CLEANUP,REMOVE_DATA");
uriTemplate = uriTemplate + "?action=CLEANUP,REMOVE_DATA";
}

if (StringUtils.hasText(schemaTarget)) {
String schemaVal = (removeData) ? "&schemaTarget=" + schemaTarget : "?schemaTarget=" + schemaTarget;
uriTemplate = uriTemplate + schemaVal;
}
restTemplate.delete(uriTemplate, values);
restTemplate.delete(uriTemplate);
}

@Override
Expand Down

0 comments on commit d7fc7ad

Please sign in to comment.