Skip to content

Add FBFlow>>convertNode:toClass: to swap a node's class in place - #80

Merged
noha merged 4 commits into
mainfrom
add-node-class-conversion
Jul 20, 2026
Merged

Add FBFlow>>convertNode:toClass: to swap a node's class in place#80
noha merged 4 commits into
mainfrom
add-node-class-conversion

Conversation

@noha

@noha noha commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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.

noha and others added 4 commits July 20, 2026 00:03
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.
@noha
noha merged commit b191785 into main Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant