Skip to main content
This workflow guides you through creating a TWU model, defining its components, and publishing it for use. This guide is for administrators and developers who need to define work structures in Veratrace. Related: Source: Feature Inventory, Source: Feature Inventory

Purpose

Create a new TWU model with entities, actions, events, and outcomes, then publish it to make it available for work operations.

Scope

This guide covers:
  • Creating a new TWU model from scratch
  • Defining model components (entities, actions, events, outcomes)
  • Saving and publishing model versions
  • Managing model lifecycle (draft, published, archived)
This guide does not cover:
  • Editing existing published models (creates new versions)
  • Archiving models
  • Using TWU models in work operations
  • Policy definition and enforcement

Preconditions

  • Access to a Veratrace instance
  • Valid AWS Cognito authentication
  • Appropriate permissions to create and publish TWU models (Administrator or Editor role)
  • Backend API running at http://localhost:8080 (development)
Source: Source: Feature Inventory

Permissions

Required roles: Administrator or Editor (inferred from mock roles)
Source: Source: Feature Inventory

Steps

TWU model create/edit form showing entities, actions, events, and outcomes sections

Step 1: Navigate to Create Page

  1. Click TWU Models in the navigation sidebar
  2. Click Create button or navigate directly to /twu-models/create
UI Route: /twu-models/create Component: AddEditTWUModelPage (create mode) Source: /Users/vincentgraham/clearline-ui/src/app/routes/routerConfig.jsx (line 102-103)

Step 2: Define Model Basics

  1. Enter Name - Model name (required)
  2. Enter Description - Model description (required)
UI Route: /twu-models/create (Entities tab) Component: ModelHeader Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/pages/AddEditTWUModelPage.jsx

Step 3: Define Entities

  1. Click Entities tab
  2. Add entity definitions
  3. Configure entity properties
UI Route: /twu-models/create (Entities tab) Component: EntitiesTab Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/pages/AddEditTWUModelPage.jsx (line 19)

Step 4: Define Actions

  1. Click Actions tab
  2. Add action definitions
  3. Configure action properties
UI Route: /twu-models/create (Actions tab) Component: ActionsTab Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/pages/AddEditTWUModelPage.jsx (line 20)

Step 5: Define Events

  1. Click Events tab
  2. Add event definitions
  3. Configure event properties
UI Route: /twu-models/create (Events tab) Component: EventsTab Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/pages/AddEditTWUModelPage.jsx (line 21)

Step 6: Define Outcomes

  1. Click Outcomes tab
  2. Add outcome definitions
  3. Configure outcome expressions
UI Route: /twu-models/create (Outcomes tab) Component: OutcomesTab Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/pages/AddEditTWUModelPage.jsx (line 22)

Step 7: Save Draft

  1. Click Save Draft button
  2. Model is saved with status DRAFT
UI Route: /twu-models/create Component: AddEditTWUModelPageActions Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/pages/AddEditTWUModelPage.jsx (line 25)

Step 8: Publish Model

  1. Click Publish button
  2. Draft version is published and becomes available for use
UI Route: /twu-models/:modelId/versions/:version/edit Component: AddEditTWUModelPageActions Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/pages/AddEditTWUModelPage.jsx (line 25)

Backend API Calls

Create TWU Model

Endpoint: POST /instances/:instanceId/twu-models Called when: User clicks “Save Draft” for the first time Request:
{
  "name": "Payment Processing",
  "description": "Model for payment processing operations",
  "entities": [...],
  "actions": [...],
  "events": [...],
  "outcomes": [...]
}
Response: Created model object with id or modelId Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/api/twuModels.js (line 72-99)

Create New Version

Endpoint: POST /instances/:instanceId/twu-models/:modelId/versions Called when: User edits a published model (creates new version) Request: Same as Create TWU Model Response: Created version object Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/api/twuModels.js (line 192-219)

Publish Draft

Endpoint: POST /instances/:instanceId/twu-models/:modelId/publish Called when: User clicks “Publish” button Request: No body (uses modelId from URL) Response: Published version object Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/api/twuModels.js (line 227-250)

Get Model Versions

Endpoint: GET /instances/:instanceId/twu-models/:modelId/versions Called when: Loading model for editing Response: Array of version objects with full payloads Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/api/twuModels.js (line 136-156)

Get Specific Version

Endpoint: GET /instances/:instanceId/twu-models/:modelId/versions/:version Called when: Loading specific version for editing Response: Version object with full data Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/api/twuModels.js (line 165-183)

Audit/Evidence Implications

Source: Source: Feature Inventory

Troubleshooting

Error: “Instance configuration not available”

Cause: Instance config not loaded or invalid Solution:
  • Verify authentication is complete
  • Check instance ID is valid
  • Refresh page and retry
Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/api/twuModels.js (line 30-32)

Error: “Failed to create TWU model”

Cause: Invalid model data or backend error Solution:
  • Verify all required fields are filled
  • Check model structure is valid
  • Review backend logs for details
Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/api/twuModels.js (line 90-96)

Error: “Failed to publish TWU model draft”

Cause: Draft validation failed or backend error Solution:
  • Verify draft is complete (entities, actions, events, outcomes defined)
  • Check for validation errors
  • Review backend logs
Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/api/twuModels.js (line 241-247)

Dirty State Warning

Cause: Unsaved changes detected Solution:
  • Save draft before navigating away
  • Use “Leave Page” confirmation to discard changes
Source: /Users/vincentgraham/clearline-ui/src/features/twuModel/pages/AddEditTWUModelPage.jsx (line 16)