Closed evomimic closed 1 month ago
To be complete, we should test that AFTER commit the source holon does NOT have relationships populated for the related holons that were removed. But this requires the get_related_holons
dance is which not available until Issue #84 is completed.
tryorama tests left for another issue.. as mutiple api changes .. restructure needed
Summary
This enhancement adds the "_remove_related_holons_" dance to the Uniform API. This dance is a CommandMethod that stages (but does not commit) removal of one or more holons (specified by their HolonReferences) from the specified
relationship_name
for the specified source holon. As a result of this dance, theeditable_collection
within the RelationshipTarget for the specified relationship should be modified to reflect the removal of the specified holons.Dependencies
None
Current State of Native Functionality:
Proposal
For reference, I've included a diagram illustrating the Uniform API architecture.
Enhance Native Functionality
_In the stagedreference.rs file:
_HINT: Use the implementation of
add_related_holons
as a template._editable_collection
for the RelationshipTarget in the source staged_holon'srelationship_map
corresponding to the specifiedrelationship_name
.InvalidRelationship
error if the source holon's relationship_map does not contain an entry for the specifiedrelationship_name
. If the source holon doesn't have a descriptor, useUnknown
for the HolonTypeholons
and, if a matching reference is found in the collection, remove it from the collection. If not found, just skip it.Dance Enhancements
_In the holon_dance_adapter.rs file:_
build_remove_related_holons_dance_request
functionremove_related_holons_dance
dance functionThis dance uses the commit_manager's
to_staged_reference
method to get a StagedReference to the source holon. Then invokes the (new)remove_related_holons
method on that staged_reference.In the dancer.rs file:
_In the dance_response.rs file:_
InvalidRelationship
HolonError to theBadRequest
response code.Sweetest Testing Enhancements
_implement a new test_remove_related_holons.rs file:_
_In the test_data_types.rs file:_
DanceTestStep
enum definitionadd_remove_related_holons_step
function:_In the dance_fixture.rs file:_
simple_add_related_holons_fixture
so that it also testsremove_related_holons
commit
,relationship_name
, expect aBadRequest
response code with anInvalidRelationship
error._In the dance_tests.rs file:_
DanceTestStep::RemoveRelatedHolons
step that dispatches theexecute_remove_related_holons
functionTryorama Tests
remove_related_holons
dance.Definition of Done:
simple_add_related_holons_fixture
as noted above, sweetest case passes