bobpaulin commented on code in PR #11872:
URL: https://github.com/apache/nifi/pull/11872#discussion_r4622370884


##########
nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/flow/mapping/VersionedComponentFlowMapper.java:
##########
@@ -1117,18 +1124,32 @@ public VersionedConnector mapConnector(final 
ConnectorNode connectorNode, final
         versionedConnector.setName(connectorNode.getName());
         
versionedConnector.setScheduledState(mapConnectorState(connectorNode.getDesiredState()));

Review Comment:
   [Claude Opus 5.5] Done. The switch now lists every ConnectorState with no 
default. While an update is in progress (PREPARING_FOR_UPDATE, UPDATING or 
UPDATED), we save the state the Connector returns to once the update completes. 
StandardConnectorNode records the desired state when an update begins and 
exposes it through a new abstract method, 
ConnectorNode#getPreUpdateDesiredState(). A Connector that was running before 
the update is saved as RUNNING, and anything else is saved as ENABLED. The 
method returns null if no update has begun, which is also saved as ENABLED. 
UPDATE_FAILED saves ENABLED, because a failed update leaves the Connector 
stopped until someone fixes it and starts it again. 
TestVersionedComponentFlowMapper has a parameterized test that maps a Connector 
in every state, so a new state without a mapping will fail it. A second test 
covers the null case.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to