Premium

Configurable event state machines

Give calendar events named states and explicit transitions instead of relying on loosely related flags. Guards and optional approval flows determine whether a proposed transition is accepted.

Configurable event state machines — Screenshot of actual package API results with sample data. The read-only result table is application-owned; this feature does not provide this screen as built-in UI. Preview build: @wts-calendar/core@1.1.0 (unpublished).
Screenshot of actual package API results with sample data. The read-only result table is application-owned; this feature does not provide this screen as built-in UI. Preview build: @wts-calendar/core@1.1.0 (unpublished).

What you configure

stateMachines
Define machine IDs, initial states, allowed states, and named transitions.
defaultStateMachineId
Choose the default machine for workflow events.
extendedProps.workflow.machineId
Select a different machine for an individual event when needed.

Integration code example

  1. Model the states and transitions your application actually permits.
  2. Add transition guards, permissions, and approval flows where required.
  3. Submit transitions through the workflow and render its returned event snapshots.

Copy this TypeScript into your application, not the browser console. Replace YOUR_WTS_LICENSE_KEY with an entitlement issued for your deployment origin. A WTS license is not a Google, Microsoft or CalDAV credential. These examples are documentation only and never execute on this page.

Install command
npm install @wts-calendar/core
TypeScript integration
import { verifyCalendarLicense } from '@wts-calendar/core';
import { EnterpriseCalendarWorkflow } from '@wts-calendar/core/enterprise-workflow';

const license = await verifyCalendarLicense('YOUR_WTS_LICENSE_KEY');
const workflow = new EnterpriseCalendarWorkflow({
  license,
  actor: { id: 'editor-1', roles: ['editor'] },
  online: false,
  autoFlush: false,
  events: [
    {
      id: 'release',
      title: 'Release window',
      start: '2026-09-07T09:00:00Z',
      end: '2026-09-07T10:00:00Z',
    },
  ],
  defaultPermission: 'deny',
  permissionPolicies: [
    {
      id: 'editor-transitions',
      effect: 'allow',
      actions: ['transition', 'flush'],
      roles: ['editor'],
    },
  ],
  defaultStateMachineId: 'release-flow',
  stateMachines: [
    {
      id: 'release-flow',
      initialState: 'draft',
      states: ['draft', 'review', 'approved'],
      transitions: [
        { name: 'submit', from: 'draft', to: 'review' },
        { name: 'approve', from: 'review', to: 'approved' },
      ],
    },
  ],
});

export async function transition(name: 'submit' | 'approve') {
  await workflow.submit({ type: 'transition', eventId: 'release', transition: name });
  workflow.setOnline(true);
  await workflow.flush();
  return workflow.getEvent('release')?.state;
}

Application responsibilities

This sample is runtime-only and initially offline. No database or WTS backend is required. Without your own backend adapter, flush commits only in memory and reload loses the state.

Actor IDs and roles are sample data, not authentication. A shared backend must authenticate users and independently enforce permissions, approval stages and event versions.

This minimal machine lets an editor exercise both transitions. Add role-aware guards and approval flows to enforce your real review policy. Handle rejected transitions in your UI.

Behavior and lifecycle

  • Transition guards run before a mutation is accepted.
  • Workflow records expose current state and version; optimistic events also mirror workflow metadata.

Limits and responsibilities

  • The engine does not implicitly mutate an existing calendar instance; subscribe and apply snapshots yourself.
  • Server-side transition validation is required when your backend is authoritative.
Premium

Enable this capability

Optional module
@wts-calendar/core/enterprise-workflow
Signed entitlement
enterprise-workflow

Request the required features and deployment origins by email. Pricing and terms are confirmed privately. A WTS license is separate from provider credentials; do not send passwords or production access tokens.

Email for a license key →

This public guide does not execute Premium modules or collect license tokens.