mirror of https://github.com/apache/nifi.git
NIFI-7622 Use param context name from inside nested versioned PG when importing
This closes #4401. Signed-off-by: Andy LoPresto <alopresto@apache.org>
This commit is contained in:
parent
d846a74730
commit
5cb8d24689
|
@ -4211,7 +4211,7 @@ public final class StandardProcessGroup implements ProcessGroup {
|
|||
return childSnapshot.getParameterContexts();
|
||||
} catch (final NiFiRegistryException e) {
|
||||
throw new IllegalArgumentException("The Flow Registry with ID " + registryId + " reports that no Flow exists with Bucket "
|
||||
+ bucketId + ", Flow " + flowId + ", Version " + flowVersion);
|
||||
+ bucketId + ", Flow " + flowId + ", Version " + flowVersion, e);
|
||||
} catch (final IOException ioe) {
|
||||
throw new IllegalStateException(
|
||||
"Failed to communicate with Flow Registry when attempting to retrieve a versioned flow");
|
||||
|
@ -4273,6 +4273,13 @@ public final class StandardProcessGroup implements ProcessGroup {
|
|||
// Create a new Parameter Context based on the parameters provided
|
||||
final VersionedParameterContext versionedParameterContext = versionedParameterContexts.get(proposedParameterContextName);
|
||||
|
||||
// Protect against NPE in the event somehow the proposed name is not in the set of contexts
|
||||
if (versionedParameterContext == null) {
|
||||
final String paramContextNames = StringUtils.join(versionedParameterContexts.keySet());
|
||||
throw new IllegalStateException("Proposed parameter context name '" + proposedParameterContextName
|
||||
+ "' does not exist in set of available parameter contexts [" + paramContextNames + "]");
|
||||
}
|
||||
|
||||
final ParameterContext contextByName = getParameterContextByName(versionedParameterContext.getName());
|
||||
final ParameterContext selectedParameterContext;
|
||||
if (contextByName == null) {
|
||||
|
|
|
@ -258,6 +258,7 @@ public class RestBasedFlowRegistry implements FlowRegistry {
|
|||
group.setProcessors(contents.getProcessors());
|
||||
group.setRemoteProcessGroups(contents.getRemoteProcessGroups());
|
||||
group.setVariables(contents.getVariables());
|
||||
group.setParameterContextName(contents.getParameterContextName());
|
||||
group.setFlowFileConcurrency(contents.getFlowFileConcurrency());
|
||||
group.setFlowFileOutboundPolicy(contents.getFlowFileOutboundPolicy());
|
||||
coordinates.setLatest(snapshot.isLatest());
|
||||
|
|
Loading…
Reference in New Issue