mirror of
https://github.com/apache/nifi.git
synced 2025-02-08 19:14:57 +00:00
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();
|
return childSnapshot.getParameterContexts();
|
||||||
} catch (final NiFiRegistryException e) {
|
} catch (final NiFiRegistryException e) {
|
||||||
throw new IllegalArgumentException("The Flow Registry with ID " + registryId + " reports that no Flow exists with Bucket "
|
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) {
|
} catch (final IOException ioe) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"Failed to communicate with Flow Registry when attempting to retrieve a versioned flow");
|
"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
|
// Create a new Parameter Context based on the parameters provided
|
||||||
final VersionedParameterContext versionedParameterContext = versionedParameterContexts.get(proposedParameterContextName);
|
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 contextByName = getParameterContextByName(versionedParameterContext.getName());
|
||||||
final ParameterContext selectedParameterContext;
|
final ParameterContext selectedParameterContext;
|
||||||
if (contextByName == null) {
|
if (contextByName == null) {
|
||||||
|
@ -258,6 +258,7 @@ public class RestBasedFlowRegistry implements FlowRegistry {
|
|||||||
group.setProcessors(contents.getProcessors());
|
group.setProcessors(contents.getProcessors());
|
||||||
group.setRemoteProcessGroups(contents.getRemoteProcessGroups());
|
group.setRemoteProcessGroups(contents.getRemoteProcessGroups());
|
||||||
group.setVariables(contents.getVariables());
|
group.setVariables(contents.getVariables());
|
||||||
|
group.setParameterContextName(contents.getParameterContextName());
|
||||||
group.setFlowFileConcurrency(contents.getFlowFileConcurrency());
|
group.setFlowFileConcurrency(contents.getFlowFileConcurrency());
|
||||||
group.setFlowFileOutboundPolicy(contents.getFlowFileOutboundPolicy());
|
group.setFlowFileOutboundPolicy(contents.getFlowFileOutboundPolicy());
|
||||||
coordinates.setLatest(snapshot.isLatest());
|
coordinates.setLatest(snapshot.isLatest());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user