Skip to content

Reject multi-valued to single-valued attribute flows (#435)#1097

Merged
JayVDZ merged 8 commits into
mainfrom
claude/mva-sva-mapping-ui-f2vjq7
Jul 21, 2026
Merged

Reject multi-valued to single-valued attribute flows (#435)#1097
JayVDZ merged 8 commits into
mainfrom
claude/mva-sva-mapping-ui-f2vjq7

Conversation

@JayVDZ

@JayVDZ JayVDZ commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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 MultiValuedToSingleValued RPEI), 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 attributes
  • AttributeFlowWarningAttributeFlowError: Renamed model; removed SelectedValue field (no value is selected); added to ExportEvaluationResult

Error reporting:

  • ActivityRunProfileExecutionItemErrorType: Renamed MultiValuedAttributeTruncatedMultiValuedToSingleValued; updated description
  • SyncTaskProcessorBase.cs: Updated RPEI generation to reflect the new error semantics

UI:

  • SyncRuleAttributeFlowTab.razor: Added visual warning indicators (⚠️ icon) for MVA→SVA mappings in the attribute flow list and edit dialog; added explanatory alert text in the dialog
  • 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 cases

Documentation:

  • synchronisation-rules.md: Added table showing flow behaviour for all plurality combinations; documented the MVA→SVA error case with guidance

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Testing

  • dotnet build JIM.sln succeeds with zero errors
  • dotnet test JIM.sln passes
  • New functionality has tests (unit, workflow, or integration as appropriate)
  • Manually tested in a local development environment

Test 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

  • Public documentation updated (docs/); page: docs/configuration/synchronisation-rules.md
  • Engineering reference documentation updated (engineering/)
  • No documentation needed

Checklist

  • My commit messages are descriptive and reference the relevant Issue (if any)
  • My code follows the conventions in docs/DEVELOPER_GUIDE.md
  • User-facing text uses British English (en-GB)
  • This

https://claude.ai/code/session_01Sxata36GiUuZMqxCphmQvy

claude added 8 commits July 20, 2026 19:51
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
@JayVDZ
JayVDZ merged commit 05eeed0 into main Jul 21, 2026
16 checks passed
@JayVDZ
JayVDZ deleted the claude/mva-sva-mapping-ui-f2vjq7 branch July 21, 2026 18:22
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.

Allow MVA→SVA import attribute flow with first-value selection and RPEI warning

2 participants