diff --git a/README.md b/README.md index 8890289..78031cd 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ The initial landscape contains Website, API, ERP, CRM and Email Platform plus tw - **Place order:** Website → API → ERP, followed by parallel CRM and Email Platform updates. - **Register customer:** Website → API → CRM → Email Platform. +- **Monday demo journeys:** Contact enquiry, Sample request, Commercial order, and Order retry and recovery. ## Features @@ -24,6 +25,7 @@ The initial landscape contains Website, API, ERP, CRM and Email Platform plus tw - Adjust playback speed and inspect the active payload. - Persist the complete landscape, including node positions, in browser local storage. - Export and import the landscape as JSON. Invalid imports and deleted connection references are rejected with actionable errors. +- Use the Monday Demo guide at the bottom of the app to walk through playback, data inspection and failure recovery. ```bash npm test @@ -32,4 +34,4 @@ npm run build ## Limitations -This is intentionally a local simulation prototype. It has no authentication, collaboration, server persistence, external API calls, real payload delivery, or production-grade graph editing. Playback state is transient and is not included in saved JSON. LiteGraph supplies canvas rendering and cable interaction; scenario semantics are managed by the Vue application. +This is intentionally a local simulation prototype. It has no authentication, collaboration, server persistence, external API calls, real payload delivery, or production-grade graph editing. Playback state is transient and is not included in saved JSON. LiteGraph supplies canvas rendering and cable interaction; scenario semantics are managed by the Vue application. The minimap is diagnostic rather than a full viewport navigator, and transformation highlighting currently compares top-level JSON fields. diff --git a/src/App.vue b/src/App.vue index f54fb08..547afca 100644 --- a/src/App.vue +++ b/src/App.vue @@ -231,5 +231,6 @@ onUnmounted(stopAnimation)
CONNECTION PROPERTIES
EASY SCENARIO BUILDERStart with an action, then build the journey

Connections remain reusable destinations; parallel branches share one step.

{{ index + 1 }}{{ step.explanation }}
+
MONDAY DEMO / START HERETry a journey in three clicks
  1. Open Scenarios and choose Contact enquiry, Sample request or Commercial order.
  2. Press ▶ in the journey list, then use pause, next or speed controls.
  3. Try Order retry and recovery to see a rejection, automatic retry and recovery message. Select a system to inspect its data history.
diff --git a/src/demo.css b/src/demo.css new file mode 100644 index 0000000..941a228 --- /dev/null +++ b/src/demo.css @@ -0,0 +1 @@ +.demo-guide{padding:12px 16px;color:#c9d3e5}.demo-guide strong{display:block;margin-top:4px}.demo-guide ol{display:flex;gap:24px;margin:9px 0 0;padding-left:18px;color:#8996af;font-size:11px}.demo-guide li{flex:1}.demo-guide b{color:#dce4f4}@media(max-width:800px){.demo-guide ol{display:block}.demo-guide li{margin:5px 0}} diff --git a/src/main.ts b/src/main.ts index 4814689..ebdf610 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,6 +8,7 @@ import './failure.css' import './connection.css' import './navigation.css' import './scenario-builder.css' +import './demo.css' import './style.css' createApp(App).mount('#app') diff --git a/src/model.test.ts b/src/model.test.ts index de4d915..c076b0b 100644 --- a/src/model.test.ts +++ b/src/model.test.ts @@ -5,7 +5,7 @@ describe('landscape model', () => { it('provides the editable demo landscape', () => { const landscape = demoLandscape() expect(landscape.systems).toHaveLength(5) - expect(landscape.scenarios.map((scenario) => scenario.name)).toEqual(['Place order', 'Register customer']) + expect(landscape.scenarios.map((scenario) => scenario.name)).toEqual(expect.arrayContaining(['Place order', 'Register customer', 'Contact enquiry', 'Sample request', 'Commercial order', 'Order retry and recovery'])) expect(landscape.scenarios[0].steps[2].connectionIds).toHaveLength(2) }) it('round-trips a valid landscape and preserves positions', () => { @@ -23,4 +23,10 @@ describe('landscape model', () => { instance.capabilities[0].actions[0].payload = '{"changed":true}' expect(preset.capabilities.find((capability) => capability.id === 'analytics')?.actions[0].payload).not.toBe('{"changed":true}') }) + it('includes a bounded failure and retry demo', () => { + const scenario = demoLandscape().scenarios.find((item) => item.id === 'order-retry')! + const failed = scenario.steps.find((step) => step.outcome === 'rejected')! + expect(failed.retryStepId).toBe('retry-3') + expect(failed.recoveryStepId).toBe('retry-4') + }) }) diff --git a/src/model.ts b/src/model.ts index aac8d84..1ef4ad3 100644 --- a/src/model.ts +++ b/src/model.ts @@ -98,7 +98,13 @@ export const demoLandscape = (): LandscapeModel => ({ { id: 'api-email', sourceId: 'api', targetId: 'email', label: 'Send confirmation', description: 'API asks the email platform to send a confirmation.', payload: '{"template":"order-confirmation","to":"alex@example.com"}' }, { id: 'website-api-register', sourceId: 'website', targetId: 'api', label: 'Registration', description: 'Website submits a new customer registration.', payload: '{"email":"alex@example.com"}' }, { id: 'api-crm-register', sourceId: 'api', targetId: 'crm', label: 'Create customer', description: 'API creates the customer profile.', payload: '{"customerId":"cus_89","status":"active"}' }, - { id: 'crm-email', sourceId: 'crm', targetId: 'email', label: 'Welcome email', description: 'CRM triggers the welcome message.', payload: '{"template":"welcome","customerId":"cus_89"}' } + { id: 'crm-email', sourceId: 'crm', targetId: 'email', label: 'Welcome email', description: 'CRM triggers the welcome message.', payload: '{"template":"welcome","customerId":"cus_89"}' }, + { id: 'website-api-contact', sourceId: 'website', targetId: 'api', label: 'Contact enquiry', description: 'Website sends a contact enquiry to the API.', payload: '{"requestId":"req_1001","topic":"sample enquiry"}', protocol: 'HTTPS', dataType: 'JSON', deliveryMethod: 'immediate', showCableLabel: true }, + { id: 'api-crm-contact', sourceId: 'api', targetId: 'crm', label: 'Store enquiry', description: 'API stores a contact enquiry in the CRM.', payload: '{"requestId":"req_1001","status":"open"}', protocol: 'HTTPS', dataType: 'JSON', deliveryMethod: 'immediate', showCableLabel: true }, + { id: 'website-api-sample', sourceId: 'website', targetId: 'api', label: 'Sample request', description: 'Website sends a product sample request.', payload: '{"orderId":"smp_1042","sku":"sample-blue"}', protocol: 'HTTPS', dataType: 'JSON', deliveryMethod: 'immediate', showCableLabel: true }, + { id: 'api-erp-sample', sourceId: 'api', targetId: 'erp', label: 'Reserve sample', description: 'API asks ERP to reserve sample stock.', payload: '{"sku":"sample-blue","quantity":1}', protocol: 'HTTPS', dataType: 'JSON', deliveryMethod: 'scheduled', showCableLabel: true }, + { id: 'website-api-commercial', sourceId: 'website', targetId: 'api', label: 'Commercial order', description: 'Website submits a commercial order.', payload: '{"orderId":"ord_2048","total":249.0}', protocol: 'HTTPS', dataType: 'JSON', deliveryMethod: 'immediate', showCableLabel: true }, + { id: 'api-erp-commercial', sourceId: 'api', targetId: 'erp', label: 'Fulfil commercial order', description: 'API creates the commercial order in ERP.', payload: '{"orderId":"ord_2048","status":"new"}', protocol: 'HTTPS', dataType: 'JSON', deliveryMethod: 'immediate', showCableLabel: true } ], scenarios: [ { @@ -116,6 +122,36 @@ export const demoLandscape = (): LandscapeModel => ({ { id: 'register-2', connectionIds: ['api-crm-register'], explanation: 'The API creates the CRM customer record.', payload: '{"status":"active"}', delayMs: 1000 }, { id: 'register-3', connectionIds: ['crm-email'], explanation: 'The CRM triggers a welcome email.', payload: '{"template":"welcome"}', delayMs: 1000 } ] + }, + { + id: 'contact-enquiry', name: 'Contact enquiry', description: 'Route a visitor question into the CRM for follow-up.', startSystemId: 'website', startActionId: 'submit-contact', + steps: [ + { id: 'contact-1', connectionIds: ['website-api-contact'], explanation: 'A visitor submits a contact enquiry.', payload: '{"requestId":"req_1001","topic":"sample enquiry"}', delayMs: 700, outcome: 'success' }, + { id: 'contact-2', connectionIds: ['api-crm-contact'], explanation: 'The API stores the enquiry for a team member.', payload: '{"requestId":"req_1001","status":"open"}', delayMs: 900, outcome: 'success' } + ] + }, + { + id: 'sample-request', name: 'Sample request', description: 'Reserve a sample and demonstrate scheduled fulfilment.', startSystemId: 'website', startActionId: 'place-sample', + steps: [ + { id: 'sample-1', connectionIds: ['website-api-sample'], explanation: 'A visitor requests a product sample.', payload: '{"orderId":"smp_1042","sku":"sample-blue"}', delayMs: 700, outcome: 'success' }, + { id: 'sample-2', connectionIds: ['api-erp-sample'], explanation: 'The API schedules a stock reservation with the ERP.', payload: '{"sku":"sample-blue","quantity":1}', delayMs: 1100, outcome: 'success' } + ] + }, + { + id: 'commercial-order', name: 'Commercial order', description: 'Submit and fulfil a normal customer purchase.', startSystemId: 'website', startActionId: 'place-order', + steps: [ + { id: 'commercial-1', connectionIds: ['website-api-commercial'], explanation: 'The customer submits a commercial order.', payload: '{"orderId":"ord_2048","total":249.0}', delayMs: 700, outcome: 'success' }, + { id: 'commercial-2', connectionIds: ['api-erp-commercial'], explanation: 'The API creates the order for fulfilment.', payload: '{"orderId":"ord_2048","status":"new"}', delayMs: 1000, outcome: 'success' } + ] + }, + { + id: 'order-retry', name: 'Order retry and recovery', description: 'Show an ERP rejection, one retry and recovery.', startSystemId: 'website', startActionId: 'place-order', + steps: [ + { id: 'retry-1', connectionIds: ['website-api-commercial'], explanation: 'The website sends the order to the API.', payload: '{"orderId":"ord_3001","total":89.0}', delayMs: 650, outcome: 'success' }, + { id: 'retry-2', connectionIds: ['api-erp-commercial'], explanation: 'ERP rejects the first fulfilment request because stock is being reconciled.', payload: '{"orderId":"ord_3001","status":"rejected","reason":"stock_reconciliation"}', delayMs: 1000, outcome: 'rejected', retryStepId: 'retry-3', recoveryStepId: 'retry-4' }, + { id: 'retry-3', connectionIds: ['api-erp-commercial'], explanation: 'The API retries the fulfilment request after refreshing stock.', payload: '{"orderId":"ord_3001","status":"retry"}', delayMs: 900, outcome: 'success' }, + { id: 'retry-4', connectionIds: ['api-email'], explanation: 'The API sends a recovery confirmation to the customer.', payload: '{"template":"order-retry-recovered","orderId":"ord_3001"}', delayMs: 700, outcome: 'success' } + ] } ] })