Add FBFlow>>convertNode:toClass: to swap a node's class in place - #80
Merged
Conversation
Adds a generic way to migrate a persisted node to a different, structurally compatible FBNode subclass without losing its place in the flow graph: FBNode>>convertTo: builds the replacement instance and preserves id, name, properties, an explicit behaviorClass override (only if one was actually set), flow, and incoming/outgoing transitions (repointed to the new node); FBFlow>>convertNode:toClass: then swaps the nodesMap entry (and start, if applicable) so the same id now resolves to the new node. Needed as the building block for migrating persisted FBExclusiveGateway nodes to FBMultiChoiceGateway.
testTaskIsAbstractOnlyForTheBaseClass hardcoded a reference to AGSendEmailTask to prove a concrete FBTask subclass with no isAbstract override correctly inherits isAbstract=false. AGSendEmailTask belongs to ApptiveBase-Core, which FluxBase-Core does not depend on, so the test only passed by accident in the shared combined test image and fails wherever FluxBase-Core is tested standalone (nil doesNotUnderstand #isAbstract). Added FBConcreteTestTask (FluxBase-Core-Tests), a plain FBTask subclass with no overrides at all, and pointed the test at it instead.
FBConcreteTestTask (added to fix FBNodeTest's AGSendEmailTask cross-package dependency) is non-abstract by design, which means it's picked up by FBNode class>>exposedNodeClasses -- and FBMergeGatewayTest's pre-existing invariant test (every exposed node class must have a typeName) correctly flagged that it had none.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a generic way to migrate a persisted node to a different, structurally compatible FBNode subclass without losing its place in the flow graph: FBNode>>convertTo: builds the replacement instance and preserves id, name, properties, an explicit behaviorClass override (only if one was actually set), flow, and incoming/outgoing transitions (repointed to the new node); FBFlow>>convertNode:toClass: then swaps the nodesMap entry (and start, if applicable) so the same id now resolves to the new node.
Needed as the building block for migrating persisted FBExclusiveGateway nodes to FBMultiChoiceGateway.