Skip to content

fix(exporter): correct AOEF export for MCP-created workspaces#81

Merged
victorsoriadrp merged 2 commits into
mainfrom
fix/aoef-export-mcp-workspaces
May 7, 2026
Merged

fix(exporter): correct AOEF export for MCP-created workspaces#81
victorsoriadrp merged 2 commits into
mainfrom
fix/aoef-export-mcp-workspaces

Conversation

@victorsoriadrp

Copy link
Copy Markdown
Contributor

Summary

  • Missing model identifier: workspaces created via MCP have no model_identifier in the DB — Archi rejects the import with cvc-complex-type.4. Fall back to id-<workspace-uuid>.
  • Broken relationship references: MCP stores element UUIDs in source_element/target_element, while AOEF-imported workspaces store the ArchiMate source_id. Build a UUID→source_id map at export time and translate so references always point to the identifier used in the <elements> block.

Test plan

  • Create a workspace via MCP, export AOEF, import into Archi — should succeed without errors
  • Export an AOEF-imported workspace (e.g. Archisurance) — roundtrip should still work correctly
  • Verify relationships in Archi show correct source/target element names

…reated elements

Elements created via MCP use their UUID as the relationship source/target reference,
while AOEF-imported elements use their source_id (the original ArchiMate identifier).
Index elementsById by both id and source_id so lookups work in both cases.
Two issues when exporting workspaces created via the MCP server:

1. Missing model identifier: workspaces created via MCP have no model_identifier
   in the DB. Archi requires the attribute — fall back to 'id-<workspace-uuid>'.

2. Broken relationship references: MCP stores element UUIDs in source_element /
   target_element, while AOEF-imported workspaces store the ArchiMate source_id.
   Build a UUID->source_id map and translate before writing the XML so references
   always point to the element identifier used in the <elements> block.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 7, 2026

Copy link
Copy Markdown

Deploying archipulse with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1e51166
Status: ✅  Deploy successful!
Preview URL: https://db372dd1.archipulse.pages.dev
Branch Preview URL: https://fix-aoef-export-mcp-workspac.archipulse.pages.dev

View logs

@victorsoriadrp victorsoriadrp merged commit ae91dc4 into main May 7, 2026
2 checks passed
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