fixed wf configuration flag

This commit is contained in:
Michele Artini 2024-01-05 11:32:51 +01:00
parent 60c33327fe
commit 24b2160082
2 changed files with 9 additions and 5 deletions

View File

@ -19,16 +19,19 @@ public class WfConfigurationUtils {
final Map<String, Object> confParams = allConfiguredParameters(wfTemplateParams, conf);
final long count = wfTemplateParams.stream()
final List<String> invalids = wfTemplateParams.stream()
.filter(WfParam::isRequired)
.filter(p -> StringUtils.isNotBlank(p.getDefaultValue()) || (confParams.get(p.getName()) != null))
.count();
.filter(p -> StringUtils.isBlank(p.getDefaultValue()))
.map(WfParam::getName)
.filter(p -> (confParams.get(p) == null) || StringUtils.isBlank(confParams.get(p).toString()))
.toList();
if (log.isDebugEnabled()) {
log.debug(String.format("WfConf %s not configured: there are %s required parameters without value", conf.getId(), count));
log.debug(String.format("WfConf %s not configured: there are %s required parameters without value:", conf.getId(), invalids.size()));
invalids.forEach(p -> log.debug(" - " + p));
}
return count == 0;
return invalids.isEmpty();
}
public static Map<String, Object> allConfiguredParameters(final List<WfParam> wfTemplateParams, final WfConfiguration conf) {

View File

@ -179,6 +179,7 @@ services:
- SPRING_DATASOURCE_URL=jdbc:postgresql://db-main:${PG_PORT}/${PG_WFS_DB}
- SPRING_DATASOURCE_USERNAME=${PG_USER}
- SPRING_DATASOURCE_PASSWORD=${PG_PASSWORD}
- LOGGING_LEVEL_EU_DNETLIB=DEBUG
profiles:
- wfs