Skip to content

Commit

Permalink
Fix invalid label use.
Browse files Browse the repository at this point in the history
  • Loading branch information
corneil committed Sep 15, 2023
1 parent 6f6a096 commit 41e9dfa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.springframework.cloud.deployer.spi.core.AppDeploymentRequest;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

/**
* Default implementation of the {@link DefaultTaskExecutionInfoService} interface.
Expand Down Expand Up @@ -268,15 +269,19 @@ private void extractNames(TaskNode taskNode, Set<String> result) {
logger.debug("subTask:{}:{}:{}:{}", subTask.getName(), subTask.getTaskName(), subTask.getLabel(), subTask);
TaskDefinition subTaskDefinition = taskDefinitionRepository.findByTaskName(subTask.getName());
if (subTaskDefinition != null) {
result.add(subTaskDefinition.getRegisteredAppName() + "," + subTask.getLabel());
if(StringUtils.hasText(subTask.getLabel())) {
result.add(subTaskDefinition.getRegisteredAppName() + "," + subTask.getLabel());
} else {
result.add(subTaskDefinition.getRegisteredAppName());
}
TaskParser subTaskParser = new TaskParser(subTaskDefinition.getTaskName(), subTaskDefinition.getDslText(), true, true);
TaskNode subTaskNode = subTaskParser.parse();
if (subTaskNode != null && subTaskNode.getTaskApp() != null) {
for (TaskApp subSubTask : subTaskNode.getTaskApps()) {
logger.debug("subSubTask:{}:{}:{}:{}", subSubTask.getName(), subSubTask.getTaskName(), subSubTask.getLabel(), subSubTask);
TaskDefinition subSubTaskDefinition = taskDefinitionRepository.findByTaskName(subSubTask.getName());
if (subSubTaskDefinition != null) {
if (!subTask.getLabel().contains("$")) {
if (subSubTask.getLabel() != null && !subTask.getLabel().contains("$")) {
result.add(subSubTaskDefinition.getRegisteredAppName() + "," + subSubTask.getLabel());
} else {
result.add(subSubTaskDefinition.getRegisteredAppName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
import org.springframework.hateoas.server.RepresentationModelAssembler;

/**
* Analogous to {@link ResourceAssembler} but for resource collections.
* Analogous to {@link RepresentationModelAssembler} but for resource collections.
*
* @author Greg Turnquist
*/
public interface ResourcesAssembler<T, D extends RepresentationModel> {
public interface ResourcesAssembler<T, D extends RepresentationModel<D>> {

/**
* Converts all given entities into resources and wraps the collection as a resource as well.
*
* @see RepresentationModelAssembler#toModel(Object)
* @param entities must not be {@literal null}.
* @return {@link Resources} containing {@link EntityModel} of {@code T}.
* @return {@link CollectionModel} containing {@link RepresentationModel} of {@code T}.
*/
CollectionModel<D> toCollectionModel(Iterable<? extends T> entities);
}

0 comments on commit 41e9dfa

Please sign in to comment.