Reject multi-valued to single-valued attribute flows (#435)#1097
Merged
Conversation
Previously an import Attribute Flow from a multi-valued source to a single-valued Metaverse attribute silently truncated to the first (arbitrarily-ordered) value and raised an informational warning. The selection was non-deterministic, so which value won could change between synchronisations. It now raises a per-attribute error instead: when a multi-valued source holds more than one distinct value for a single-valued target, no value is flowed for that attribute and a MultiValuedToSingleValued RPEI error is recorded; the object's other attributes still synchronise. A single value (including duplicates that de-duplicate to one, and text variants that collapse to one under value processing) flows normally. - Rename AttributeFlowWarning to AttributeFlowError (drop SelectedValue) - Replace MultiValuedAttributeTruncated error type with MultiValuedToSingleValued - Trigger on effective, de-duplicated value count for text; reference attributes remain out of scope (inherently multi-valued) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sxata36GiUuZMqxCphmQvy
Export evaluation previously inspected only the source Metaverse attribute's plurality, never the target's, so a multi-valued source mapped to a single-valued Connected System attribute emitted one Add change per value against a target that can hold only one. The failure surfaced later at the connector (an LDAP constraint violation, or silent data loss), and an arbitrary export could never be reconciled on the next import. Export now checks the target's plurality: when a multi-valued source holds more than one value for a single-valued target, no Pending Export change is generated for that attribute and a MultiValuedToSingleValued RPEI error is raised; the object's other attributes still export. A single value exports normally. - Thread an AttributeFlowError collector from CreateAttributeValueChanges up through the no-net-change evaluation path onto ExportEvaluationResult - Raise export error RPEIs in the sync task processor, mirroring import - Update two ghost/reconciler reference tests that mapped a multi-valued member source to a single-valued target to use a valid multi-valued target (their intent is ghost-row / FK-scalar handling, not MVA->SVA) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sxata36GiUuZMqxCphmQvy
…lued (#435) The Edit Attribute Flow dialog gave no indication that mapping a Multi-Valued source to a Single-Valued target has runtime consequences (the target's plurality was not even visible once selected). - Show an outlined warning alert in the dialog, for both import and export, when an Attribute mapping is Multi-Valued to Single-Valued, explaining that objects with more than one value will error and how to avoid it (target a Multi-Valued attribute or use an Expression) - Flag such mappings at a glance with a warning icon and tooltip in both the table and card views of the Attribute Flow list Import excludes Reference sources (the runtime guard does not apply to them); export covers every data type, matching runtime behaviour. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sxata36GiUuZMqxCphmQvy
Document the full source/target plurality matrix and the new Multi-Valued to Single-Valued behaviour (errors when an object has more than one value; single value flows; design-time warning) in the Synchronisation Rules guide, and add a changelog entry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sxata36GiUuZMqxCphmQvy
…bute Flow dialog (#435) The source/target Metaverse Attribute dropdowns showed only the name once selected (for example "Account Name"), hiding whether the attribute is Single-Valued or Multi-Valued, while the Connected System attribute dropdowns already showed it. Both now show the data type and plurality ("Account Name (Text : Single Valued)"), so the mismatch behind a Multi-Valued to Single-Valued warning is visible directly on the fields. Also rename the dialog's detection helper to make clear it covers both adding and editing a mapping (they share the one dialog). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sxata36GiUuZMqxCphmQvy
… too (#435) The previous commit routed only the export-source Metaverse select through MetaverseAttributeLabel; the import target select still used the old name-only ToStringFunc, so once an import target was chosen it showed just "Account Name" without its plurality. Runtime verification against the running app caught this. Both Metaverse selects now show data type and plurality (for example "Account Name (Text : Single Valued)"). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sxata36GiUuZMqxCphmQvy
…435) The dialog warning wrapped the source and target attribute names in single quotes. Render them as inline code (the jim-code-inline style used elsewhere, e.g. AttributePriorityList) instead, matching the app's convention. Names are HTML-encoded as they are Connected System / Metaverse schema data. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sxata36GiUuZMqxCphmQvy
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.
Description
Closes #435
Changes the handling of multi-valued source attributes flowing to single-valued target attributes. Previously, JIM would silently truncate to the first value and record a warning. Now it rejects the flow entirely when more than one value is present, records an error (surfaced as a
MultiValuedToSingleValuedRPEI), and allows the object's other attributes to synchronise normally.Rationale: A single-valued attribute can hold only one value. JIM should not arbitrarily select one value from many; instead, it should fail loudly and let the administrator resolve the mapping design. Single values (or de-duplicated values after text normalisation) still flow normally with no error.
Changes
Core logic:
SyncEngine.AttributeFlow.cs: Replaced truncation logic with a guard that rejects flows with >1 effective value to single-valued targets (Reference attributes excluded; text values de-duplicated after inbound processing)ExportEvaluationServer.cs: Added the same guard to export evaluation; flows multi-valued Metaverse attributes to single-valued Connected System attributesAttributeFlowWarning→AttributeFlowError: Renamed model; removedSelectedValuefield (no value is selected); added toExportEvaluationResultError reporting:
ActivityRunProfileExecutionItemErrorType: RenamedMultiValuedAttributeTruncated→MultiValuedToSingleValued; updated descriptionSyncTaskProcessorBase.cs: Updated RPEI generation to reflect the new error semanticsUI:
SyncRuleAttributeFlowTab.razor: Added visual warning indicators (MetaverseAttributeLabel(): New helper to show attribute plurality in source/target selects (e.g. "Account Name (Text : Single Valued)")Tests:
ExportMultiValuedToSingleValuedTests.cs: New test suite covering export evaluation (multi-value rejection, single-value pass-through, MVA→MVA unaffected)SyncEngineAttributeFlowTests.cs: Updated inbound flow tests to expect no flow and an error instead of truncation; added tests for de-duplication and case-normalisation edge casesDocumentation:
synchronisation-rules.md: Added table showing flow behaviour for all plurality combinations; documented the MVA→SVA error case with guidanceType of change
Testing
dotnet build JIM.slnsucceeds with zero errorsdotnet test JIM.slnpassesTest coverage:
ExportMultiValuedToSingleValuedTests: 3 new unit tests covering export evaluation (multi-value rejection, single-value pass-through, MVA→MVA unaffected)SyncEngineAttributeFlowTests: 6 updated tests for inbound flow (text, number, GUID, binary MVA→SVA rejection; single-value pass-through; de-duplication and case-normalisation edge cases)All existing tests pass; no regressions.
Documentation
docs/); page:docs/configuration/synchronisation-rules.mdengineering/)Checklist
docs/DEVELOPER_GUIDE.mdhttps://claude.ai/code/session_01Sxata36GiUuZMqxCphmQvy