diff --git a/model/src/main/java/org/alfresco/transform/registry/CombinedTransformConfig.java b/model/src/main/java/org/alfresco/transform/registry/CombinedTransformConfig.java index 858a948cb..adecc6e72 100644 --- a/model/src/main/java/org/alfresco/transform/registry/CombinedTransformConfig.java +++ b/model/src/main/java/org/alfresco/transform/registry/CombinedTransformConfig.java @@ -40,12 +40,12 @@ import java.util.Map; import java.util.Set; import java.util.StringJoiner; -import java.util.TreeSet; import java.util.function.Function; import java.util.stream.Collectors; import static java.util.stream.Collectors.toSet; import static org.alfresco.transform.config.CoreVersionDecorator.setCoreVersionOnMultiStepTransformers; +import static org.alfresco.transform.registry.TransformRegistryHelper.TRANSFORM_OPTIONS_KEY_PATTERN; /** * This class combines one or more T-Engine config and local files and registers them as if they were all in one file. @@ -104,7 +104,8 @@ public void addTransformConfig(TransformConfig transformConfig, String readFrom, overrideSupported(transformConfig.getOverrideSupported(), readFrom, registry); // Add transform options and transformers from the new transformConfig - transformConfig.getTransformOptions().forEach(combinedTransformOptions::put); + transformConfig.getTransformOptions().forEach( + (optionsName, options) -> combinedTransformOptions.put(String.format(TRANSFORM_OPTIONS_KEY_PATTERN, readFrom, optionsName), options)); transformConfig.getTransformers().forEach(t -> combinedTransformers.add(new Origin<>(t, baseUrl, readFrom))); } @@ -411,7 +412,7 @@ private int removeInvalidTransformer(int i, List> combinedTr for (String transformOptionsLabel : transformer.getTransformOptions()) { - if (!combinedTransformOptions.containsKey(transformOptionsLabel)) + if (!combinedTransformOptions.containsKey(String.format(TRANSFORM_OPTIONS_KEY_PATTERN, readFrom, transformOptionsLabel))) { throw new IllegalStateException("Transformer " + transformerName(name) + " references \"" + transformOptionsLabel + diff --git a/model/src/main/java/org/alfresco/transform/registry/TransformRegistryHelper.java b/model/src/main/java/org/alfresco/transform/registry/TransformRegistryHelper.java index 180c5fb02..947c68eb9 100644 --- a/model/src/main/java/org/alfresco/transform/registry/TransformRegistryHelper.java +++ b/model/src/main/java/org/alfresco/transform/registry/TransformRegistryHelper.java @@ -44,6 +44,8 @@ class TransformRegistryHelper { + public static final String TRANSFORM_OPTIONS_KEY_PATTERN = "%s-%s"; + private TransformRegistryHelper() { } @@ -60,7 +62,7 @@ static Set lookupTransformOptions(final Set transformOp final Set options = new HashSet<>(); for (String name : transformOptionNames) { - final Set oneSetOfTransformOptions = transformOptions.get(name); + final Set oneSetOfTransformOptions = transformOptions.get(String.format(TRANSFORM_OPTIONS_KEY_PATTERN, readFrom, name)); if (oneSetOfTransformOptions == null) { logError.accept("transformOptions in " + readFrom + " with the name " + name +