From 698d1c43f223bb6323ed8df974d45a8d648e93c1 Mon Sep 17 00:00:00 2001 From: Chris Dumas Date: Thu, 5 Nov 2026 23:39:28 +0000 Subject: [PATCH] Add simulated database integration relationships --- README.md | 2 ++ src/App.vue | 4 ++-- src/model.test.ts | 14 ++++++++++++-- src/model.ts | 27 +++++++++++++++++++++++++-- 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 943ac0d..a8c288f 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ The initial landscape contains Website, API, ERP, CRM and Email Platform plus tw - Use typed Data Flow, Deployment, Dependency and Source Repository relationships. Development playback includes the simulated Bitbucket commit → Azure DevOps build → website deployment journey. - Model physical operations alongside software with Physical Location and Business Operation categories, plus Physical Goods and Human Task relationships. The Warehouse preset includes receiving, storage, picking, dispatch and returns with clearly labelled physical-goods ports and fictional shipment payloads. - Run the mixed Physical goods receipt demo: SAP purchase order → Supplier shipment → Warehouse → Warehouse Operative decision → Warehouse Management System → SAP confirmation. Physical locations remain independent from their software systems; all transfers are simulated and inspectable. +- Model persistent database integrations separately from activity: Direct Database Access, Scheduled Import, Replication / Sync and File Transfer. Configure access mode, trigger/frequency, source tables/views/queries, destination, authoritative source and an optional simulated mapping. Live query requests and returned database rows are separate connections; scheduled imports identify downstream copies such as Sitecore items. +- Compare the example Sitecore live-query and scheduled-import scenarios for the fictional Product / Literature / Webinar Management application and MSSQL database. Database payloads are sample rows/JSON only; no database connection or inventory/accounting engine is implemented. - Place reusable Website, CRM, ERP, Email Platform, Analytics and API presets, selecting only the capabilities needed for each instance. - Browse the layered preset library from the Presets tab: searchable system/product catalog entries, shared capabilities, deployment layouts and starter kits. Entries include tags, version metadata and official documentation sources; favourites are stored locally. - Inspect labelled capability ports and fictional action payloads, expand node actions, and save customised systems as private browser-local presets. diff --git a/src/App.vue b/src/App.vue index 4ea4287..1d08bcf 100644 --- a/src/App.vue +++ b/src/App.vue @@ -75,7 +75,7 @@ function persistPresets() { localStorage.setItem(PRESET_STORAGE_KEY, JSON.string function togglePresetFavourite(id: string) { favouritePresetIds.value = favouritePresetIds.value.includes(id) ? favouritePresetIds.value.filter((item) => item !== id) : [...favouritePresetIds.value, id]; localStorage.setItem('dumas-system-favourites-v1', JSON.stringify(favouritePresetIds.value)) } function selectSystem(id: string) { selectedSystemId.value = id; selectedConnectionId.value = ''; selectedEnvironmentId.value = landscape.value.systems.find((item) => item.id === id)?.environments?.[0]?.id || '' } function selectContainer(id: string) { selectedContainerId.value = id; selectedSystemId.value = ''; selectedConnectionId.value = '' } -function selectConnection(id: string) { selectedConnectionId.value = id; selectedSystemId.value = ''; const connection = landscape.value.connections.find((item) => item.id === id); if (connection) { connection.transformation ||= { incoming: connection.payload, outgoing: connection.payload, note: '' }; connection.protocol ||= 'HTTPS'; connection.dataType ||= 'JSON'; connection.deliveryMethod ||= 'immediate'; connection.exchangeType ||= 'event-transfer'; connection.responsePayload ||= '{}'; connection.responseStatus ||= 200; connection.showCableLabel ??= true } } +function selectConnection(id: string) { selectedConnectionId.value = id; selectedSystemId.value = ''; const connection = landscape.value.connections.find((item) => item.id === id); if (connection) { connection.transformation ||= { incoming: connection.payload, outgoing: connection.payload, note: '' }; connection.protocol ||= 'HTTPS'; connection.dataType ||= 'JSON'; connection.deliveryMethod ||= 'immediate'; connection.exchangeType ||= 'event-transfer'; connection.responsePayload ||= '{}'; connection.responseStatus ||= 200; connection.showCableLabel ??= true; connection.integration ||= { mechanism: 'direct-database-access', access: 'unknown' } } } function addSystem() { const id = uid('system'); landscape.value.systems.push({ id, name: 'New system', description: 'Describe this system.', category: 'service', color: '#6d7cff', position: [160, 160], containerId: landscape.value.containers[0]?.id, tags: ['Test'], capabilities: [] }); selectSystem(id); persist(); rebuildGraph() } @@ -308,6 +308,6 @@ onUnmounted(stopAnimation)
Middleware pipeline traceSimulated restricted mappings
{{ trace.name }}{{ trace.type.toUpperCase() }} · {{ trace.explanation }}
{{ trace.input }}
→
{{ trace.output }}

Changed: {{ trace.changedFields.join(', ') }}

ACTION PIPELINES

Middleware mapping editor

Optional restricted pipelines are saved inside each action definition. No arbitrary JavaScript is executed.

{{ action.name }}

Add Receive, Validate, Transform, Route and Send stages to this action.

Mapping ops: copy, rename, fixed, default, type-conversion, object-construction and array-item-mapping. Use $ref:key in a fixed value for a reference lookup.
LAYERED PRESET LIBRARYSearch → choose → review → insertVersioned fictional definitions with official documentation sources.
Systems{{ filteredLibraryPresets.length }} results · favourites are local
{{ preset.name }}

{{ preset.description }}

{{ tag }}
{{ preset.capabilities.length }} shared capabilities · v{{ preset.version || 1 }}
Official docs ↗
Shared capabilities{{ filteredCapabilityPresets.length }} reusable definitions
{{ preset.name }}

{{ preset.description }}

{{ tag }}
{{ preset.capability.inputs.length }} inputs · {{ preset.capability.outputs.length }} outputs · editable after placement
Deployment templates{{ filteredTemplates.length }} editable layouts
{{ template.name }}

{{ template.description }}

{{ tag }}
Starter kits{{ filteredKits.length }} connected journeys
{{ kit.name }}

{{ kit.description }}

{{ tag }}
-
PHYSICAL / HUMAN RELATIONSHIP

Shipment payloads should describe material, quantity, unit, batch and shipment ID.

Human-task payloads represent a simulated assignment or decision; no person or live workflow is involved.

CONNECTION LEGEND Information / Data Physical Goods Human Task Deployment
+
PHYSICAL / HUMAN RELATIONSHIP

Shipment payloads should describe material, quantity, unit, batch and shipment ID.

Human-task payloads represent a simulated assignment or decision; no person or live workflow is involved.

PERSISTENT INTEGRATION
CONNECTION LEGEND Information / Data Physical Goods Human Task Deployment
diff --git a/src/model.test.ts b/src/model.test.ts index c688b5a..a050ba7 100644 --- a/src/model.test.ts +++ b/src/model.test.ts @@ -4,8 +4,8 @@ import { CAPABILITY_PRESETS, CATALOG_SYSTEM_PRESETS, DEPLOYMENT_TEMPLATES, START describe('landscape model', () => { it('provides the editable demo landscape', () => { const landscape = demoLandscape() - expect(landscape.systems).toHaveLength(15) - expect(landscape.scenarios.map((scenario) => scenario.name)).toEqual(expect.arrayContaining(['Place order', 'Register customer', 'Contact enquiry', 'Sample request', 'Commercial order', 'Order retry and recovery', 'Commit, build and deploy', 'Website → Middleware → ERP order', 'Physical goods receipt'])) + expect(landscape.systems).toHaveLength(17) + expect(landscape.scenarios.map((scenario) => scenario.name)).toEqual(expect.arrayContaining(['Place order', 'Register customer', 'Contact enquiry', 'Sample request', 'Commercial order', 'Order retry and recovery', 'Commit, build and deploy', 'Website → Middleware → ERP order', 'Physical goods receipt', 'Sitecore live database query', 'Sitecore scheduled import'])) expect(landscape.scenarios[0].steps[2].connectionIds).toHaveLength(2) expect(getPreset('bitbucket')?.category).toBe('development-tool') expect(landscape.connections.find((connection) => connection.id === 'azure-devops-website')?.connectionType).toBe('deployment') @@ -84,4 +84,14 @@ describe('landscape model', () => { const imported = validateLandscape(JSON.parse(JSON.stringify(demoLandscape()))) expect(imported.connections.find((connection) => connection.id === 'supplier-warehouse-goods')?.dataType).toBe('Physical goods') }) + it('keeps database requests separate from returned rows and records integration metadata', () => { + const landscape = demoLandscape() + const request = landscape.connections.find((connection) => connection.id === 'sitecore-mssql-query')! + const result = landscape.connections.find((connection) => connection.id === 'mssql-sitecore-result')! + expect(request.integration?.access).toBe('read') + expect(request.payload).toContain('SELECT') + expect(result.payload).toContain('rows') + expect(request.integration?.authoritativeSource).toBe('MSSQL') + expect(landscape.scenarios.find((scenario) => scenario.id === 'sitecore-scheduled-import')?.steps[0].connectionIds).toEqual(['mssql-sitecore-import']) + }) }) diff --git a/src/model.ts b/src/model.ts index a9998d3..96eed57 100644 --- a/src/model.ts +++ b/src/model.ts @@ -1,5 +1,7 @@ export type SystemCategory = 'application' | 'saas-service' | 'cloud-service' | 'development-tool' | 'data-store' | 'service' | 'data' | 'human' | 'external' | 'physical-location' | 'business-operation' export type ConnectionType = 'data-flow' | 'deployment' | 'dependency' | 'source-repository' | 'physical-goods' | 'human-task' +export type IntegrationMechanism = 'direct-database-access' | 'scheduled-import' | 'replication-sync' | 'file-transfer' +export type DatabaseAccess = 'read' | 'write' | 'read-write' | 'unknown' export interface PortModel { id: string; name: string; description: string } export interface ActionModel { id: string; name: string; description: string; payload: string } @@ -73,6 +75,7 @@ export interface ConnectionModel { responsePayload?: string responseStatus?: number connectionType?: ConnectionType + integration?: { mechanism: IntegrationMechanism; access: DatabaseAccess; trigger?: string; frequency?: string; sourceObjects?: string[]; destination?: string; authoritativeSource?: string; transformation?: string } } export interface ScenarioStep { @@ -236,6 +239,7 @@ export const CATALOG_SYSTEM_PRESETS: SystemPreset[] = [ catalogSystem('sap-s4hana', 'SAP S/4HANA', 'Simulated enterprise resource planning system.', 'application', '#0faaff', ['relational-data', 'messaging', 'monitoring'], ['ERP', 'business application'], 'https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE'), catalogSystem('supplier', 'Supplier', 'Business operation representing a fictional materials supplier.', 'business-operation', '#d89555', ['validation', 'messaging'], ['physical', 'procurement', 'business operation'], 'https://www.gs1.org/standards/edi'), catalogSystem('warehouse-management-system', 'Warehouse Management System', 'Simulated software system linked to a physical warehouse.', 'application', '#7b9fe8', ['messaging', 'relational-data', 'monitoring'], ['warehouse', 'application', 'operations'], 'https://learn.microsoft.com/en-us/dynamics365/supply-chain/warehousing/'), + catalogSystem('product-literature-webinar', 'Product / Literature / Webinar Management', 'Application managing fictional product, literature and webinar content.', 'application', '#8f7cf2', ['publishing', 'relational-data', 'analytics'], ['content', 'application', 'database'], 'https://doc.sitecore.com/'), ] export const SYSTEM_PRESETS: SystemPreset[] = [...CORE_SYSTEM_PRESETS, ...CATALOG_SYSTEM_PRESETS.filter((candidate) => !CORE_SYSTEM_PRESETS.some((existing) => existing.id === candidate.id))] export const DEPLOYMENT_TEMPLATES: DeploymentTemplate[] = [ @@ -291,7 +295,9 @@ export const demoLandscape = (): LandscapeModel => ({ { id: 'supplier', name: 'Supplier', description: 'Business operation supplying fictional raw materials.', category: 'business-operation', color: '#d89555', position: [360, 980], tags: ['Production', 'Physical'], presetId: 'supplier', capabilities: cloneCapabilities(getPreset('supplier')!.capabilities) }, { id: 'warehouse', name: 'Warehouse', description: 'Physical location receiving and storing fictional goods.', category: 'physical-location', color: '#c58b52', position: [650, 980], tags: ['Production', 'Physical'], presetId: 'warehouse', capabilities: cloneCapabilities(getPreset('warehouse')!.capabilities) }, { id: 'warehouse-operative', name: 'Warehouse Operative', description: 'Human role confirming physical goods receipt.', category: 'human', color: '#f06ca9', position: [930, 980], tags: ['Production', 'Physical', 'Human Task'], presetId: 'people-team', capabilities: cloneCapabilities(getPreset('people-team')!.capabilities) }, - { id: 'wms', name: 'Warehouse Management System', description: 'Software linked to the warehouse, sending goods-received information to SAP.', category: 'application', color: '#7b9fe8', position: [1200, 980], tags: ['Production', 'Physical', 'Business Function'], presetId: 'warehouse-management-system', capabilities: cloneCapabilities(getPreset('warehouse-management-system')!.capabilities) } + { id: 'wms', name: 'Warehouse Management System', description: 'Software linked to the warehouse, sending goods-received information to SAP.', category: 'application', color: '#7b9fe8', position: [1200, 980], tags: ['Production', 'Physical', 'Business Function'], presetId: 'warehouse-management-system', capabilities: cloneCapabilities(getPreset('warehouse-management-system')!.capabilities) }, + { id: 'product-management', name: 'Product / Literature / Webinar Management', description: 'Application writing product and content records to MSSQL.', category: 'application', color: '#8f7cf2', position: [80, 1260], tags: ['Production', 'Content', 'Business Function'], presetId: 'product-literature-webinar', capabilities: cloneCapabilities(getPreset('product-literature-webinar')!.capabilities) }, + { id: 'mssql', name: 'MSSQL', description: 'Authoritative fictional database for content and product records.', category: 'data-store', color: '#a91d22', position: [430, 1260], tags: ['Production', 'Database', 'Authoritative source'], presetId: 'sql-server', capabilities: cloneCapabilities(getPreset('sql-server')!.capabilities) } ], connections: [ { id: 'website-api', sourceId: 'website', targetId: 'api', label: 'Order request', description: 'Website submits a new order to the API.', payload: '{"orderId":"ord_1042","total":129.5}' }, @@ -319,7 +325,11 @@ export const demoLandscape = (): LandscapeModel => ({ { id: 'supplier-warehouse-goods', sourceId: 'supplier', targetId: 'warehouse', label: 'Raw materials shipment', description: 'Supplier sends physical raw materials to the warehouse.', payload: '{"material":"steel-coils","quantity":12,"unit":"pallet","batch":"B-204","shipmentId":"SHP-4401"}', connectionType: 'physical-goods', exchangeType: 'event-transfer', dataType: 'Physical goods', deliveryMethod: 'scheduled', showCableLabel: true }, { id: 'warehouse-operative-confirmation', sourceId: 'warehouse', targetId: 'warehouse-operative', label: 'Receipt confirmation task', description: 'Warehouse asks a human operative to confirm receipt.', payload: '{"shipmentId":"SHP-4401","material":"steel-coils","quantity":12,"unit":"pallet","task":"confirm receipt"}', connectionType: 'human-task', exchangeType: 'event-transfer', dataType: 'Human task', deliveryMethod: 'manual', showCableLabel: true }, { id: 'operative-wms-receipt', sourceId: 'warehouse-operative', targetId: 'wms', label: 'Goods received', description: 'Operative confirms the physical receipt to the warehouse system.', payload: '{"shipmentId":"SHP-4401","status":"received","confirmedBy":"warehouse-operative"}', connectionType: 'human-task', exchangeType: 'event-transfer', dataType: 'JSON', deliveryMethod: 'manual', showCableLabel: true }, - { id: 'wms-sap-receipt', sourceId: 'wms', targetId: 'sap', label: 'Goods-received confirmation', description: 'WMS sends a receipt message back to SAP.', payload: '{"purchaseOrderId":"PO-2048","shipmentId":"SHP-4401","status":"received","quantity":12,"unit":"pallet"}', connectionType: 'data-flow', exchangeType: 'event-transfer', dataType: 'JSON', deliveryMethod: 'immediate', showCableLabel: true } + { id: 'wms-sap-receipt', sourceId: 'wms', targetId: 'sap', label: 'Goods-received confirmation', description: 'WMS sends a receipt message back to SAP.', payload: '{"purchaseOrderId":"PO-2048","shipmentId":"SHP-4401","status":"received","quantity":12,"unit":"pallet"}', connectionType: 'data-flow', exchangeType: 'event-transfer', dataType: 'JSON', deliveryMethod: 'immediate', showCableLabel: true }, + { id: 'product-mssql-write', sourceId: 'product-management', targetId: 'mssql', label: 'Write product and content data', description: 'The management application writes authoritative product, literature and webinar records.', payload: '{"table":"Products","rows":[{"productId":"prod_42","title":"Blue range"}]}', connectionType: 'data-flow', exchangeType: 'event-transfer', dataType: 'JSON', deliveryMethod: 'immediate', showCableLabel: true, integration: { mechanism: 'direct-database-access', access: 'write', trigger: 'Application save', sourceObjects: ['Products', 'Literature', 'Webinars'], destination: 'MSSQL tables', authoritativeSource: 'MSSQL' } }, + { id: 'sitecore-mssql-query', sourceId: 'sitecore', targetId: 'mssql', label: 'Live query request', description: 'Sitecore requests selected content from MSSQL.', payload: '{"query":"SELECT productId,title FROM Products WHERE published=1","parameters":{"locale":"en-GB"}}', connectionType: 'data-flow', exchangeType: 'request-response', dataType: 'SQL query', deliveryMethod: 'immediate', showCableLabel: true, integration: { mechanism: 'direct-database-access', access: 'read', trigger: 'Sitecore page request', sourceObjects: ['Products', 'Literature'], destination: 'Sitecore items', authoritativeSource: 'MSSQL', transformation: 'Map selected rows to Sitecore item fields.' }, responsePayload: '{"rows":[{"productId":"prod_42","title":"Blue range"}],"rowCount":1}', responseStatus: 200 }, + { id: 'mssql-sitecore-result', sourceId: 'mssql', targetId: 'sitecore', label: 'Live query result', description: 'MSSQL returns selected rows to Sitecore.', payload: '{"rows":[{"productId":"prod_42","title":"Blue range"}],"rowCount":1}', connectionType: 'data-flow', exchangeType: 'event-transfer', dataType: 'SQL result rows', deliveryMethod: 'immediate', showCableLabel: true, integration: { mechanism: 'direct-database-access', access: 'read', sourceObjects: ['Products', 'Literature'], destination: 'Sitecore items', authoritativeSource: 'MSSQL', transformation: 'Map rows to Sitecore item fields.' } }, + { id: 'mssql-sitecore-import', sourceId: 'mssql', targetId: 'sitecore', label: 'Scheduled content import', description: 'A scheduled job copies selected authoritative rows into Sitecore items.', payload: '{"rows":[{"productId":"prod_42","title":"Blue range"}],"importedAt":"2026-11-05T09:00:00Z"}', connectionType: 'data-flow', exchangeType: 'event-transfer', dataType: 'JSON rows', deliveryMethod: 'scheduled', showCableLabel: true, integration: { mechanism: 'scheduled-import', access: 'read', trigger: 'Scheduler', frequency: 'Every 15 minutes', sourceObjects: ['Products', 'Literature', 'Webinars'], destination: 'Sitecore items', authoritativeSource: 'MSSQL', transformation: 'Copy published rows; map productId to item ID.' } } ], scenarios: [ { @@ -398,6 +408,19 @@ export const demoLandscape = (): LandscapeModel => ({ { id: 'physical-confirmation', connectionIds: [], explanation: 'A warehouse operative inspects the shipment and confirms receipt.', payload: '{"shipmentId":"SHP-4401","status":"awaiting_confirmation"}', delayMs: 700, humanDecision: { roleSystemId: 'warehouse-operative', task: 'Confirm whether the physical shipment arrived with the expected material and quantity.', receivedData: '{"material":"steel-coils","quantity":12,"unit":"pallet","batch":"B-204","shipmentId":"SHP-4401"}', editableFields: { note: 'Counted and visually checked at dock 4.' }, actions: [{ id: 'confirm-receipt', name: 'Confirm receipt', description: 'Send the human confirmation to the warehouse system.', payload: '{"shipmentId":"SHP-4401","status":"received","confirmedBy":"warehouse-operative"}', connectionId: 'operative-wms-receipt' }, { id: 'reject-receipt', name: 'Reject shipment', description: 'Record a simulated discrepancy for investigation.', payload: '{"shipmentId":"SHP-4401","status":"discrepancy","reason":"quantity_check"}', connectionId: 'operative-wms-receipt' }] } }, { id: 'physical-sap-update', connectionIds: ['wms-sap-receipt'], explanation: 'The warehouse management system sends the goods-received confirmation to SAP.', payload: '{"purchaseOrderId":"PO-2048","shipmentId":"SHP-4401","status":"received","quantity":12,"unit":"pallet"}', delayMs: 900, outcome: 'success' } ] + }, + { + id: 'sitecore-live-query', name: 'Sitecore live database query', description: 'Sitecore requests selected data from MSSQL and receives returned rows.', startSystemId: 'sitecore', startActionId: 'create-order', + steps: [ + { id: 'live-query-request', connectionIds: ['sitecore-mssql-query'], explanation: 'Sitecore sends a read request to MSSQL; this is a request payload, not the returned data.', payload: '{"query":"SELECT productId,title FROM Products WHERE published=1","parameters":{"locale":"en-GB"}}', delayMs: 800, outcome: 'success' }, + { id: 'live-query-result', connectionIds: ['mssql-sitecore-result'], explanation: 'MSSQL returns sample rows to Sitecore, which may map them to content items.', payload: '{"rows":[{"productId":"prod_42","title":"Blue range"}],"rowCount":1}', delayMs: 900, outcome: 'success' } + ] + }, + { + id: 'sitecore-scheduled-import', name: 'Sitecore scheduled import', description: 'A scheduled import copies authoritative MSSQL data into Sitecore items.', startSystemId: 'mssql', + steps: [ + { id: 'scheduled-import', connectionIds: ['mssql-sitecore-import'], explanation: 'The scheduler reads authoritative MSSQL rows and copies them into Sitecore items.', payload: '{"rows":[{"productId":"prod_42","title":"Blue range"}],"importedAt":"2026-11-05T09:00:00Z"}', delayMs: 1200, outcome: 'success' } + ] } ] })