Skip to content

feat(windchill): add document webhook triggers - #6637

Open
BillLeoutsakosvl346 wants to merge 10 commits into
stagingfrom
feat/windchill-triggers
Open

feat(windchill): add document webhook triggers#6637
BillLeoutsakosvl346 wants to merge 10 commits into
stagingfrom
feat/windchill-triggers

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

  • add provider-managed Windchill document triggers for attribute, identity, lifecycle-state, and custom events
  • support document, folder, and container subscription scopes through the WRS 2.7 EventMgmt API
  • register and clean up subscriptions using existing Windchill authentication, CSRF, request, and error-handling helpers
  • preserve raw callback payloads because PTC does not publish a callback schema, signature contract, or delivery identifier
  • document self-managed WRS 2.7 and Basic-authentication requirements

Validation

  • 189 focused Windchill, block, deployment, and webhook tests
  • Sim and docs type checks and lint
  • API validation, tool metadata, integration catalog, trigger-cycle, imports, canvas, and request-boundary checks
  • documentation regeneration and git diff --check

Stack

This PR is intentionally based on plan-windchill-integration.

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 12, 2026 6:50pm

Request Review

@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Trigger config stores Windchill credentials and auto-provisions external subscriptions; callbacks rely on a secret URL with no documented signature verification, which increases exposure if the webhook URL leaks.

Overview
Adds provider-managed Windchill document triggers so workflows can start on PTC EventMgmt events instead of only via block actions.

The Windchill block now supports triggers (triggerAllowed, four trigger IDs, canvas trigger sentences, and shared trigger sub-blocks). Four new trigger types cover attribute changes, identity changes, lifecycle state entry, and custom installed events, with configuration for service root, Basic auth, and subscription scope (document, folder, or container).

A new windchill webhook provider registers EventMgmt subscriptions on deploy (POST to EventSubscriptions with the right OData entity type) and tears them down on cleanup, reusing existing Windchill session/mutation helpers and storing the returned subscription OID as externalId. Custom event IDs are validated before any Windchill call; inbound payloads stay raw (no typed outputs or formatInput/matchEvent until PTC documents callbacks).

Docs and integrations.json list the four triggers; tests cover subscription bodies per scope/event and block/trigger registration.

Reviewed by Cursor Bugbot for commit c25592c. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds four provider-managed Windchill document webhook triggers and wires their configuration, subscription lifecycle, registry metadata, tests, and documentation into Sim.

  • Supports document, folder, and container scopes through Windchill EventMgmt.
  • Adds attribute, identity, lifecycle-state, and custom document event triggers.
  • Preserves raw inbound payloads and manages external subscription creation and deletion.

Confidence Score: 4/5

The PR appears safe to merge from a functional perspective, with only non-blocking repository-convention cleanup needed.

The Windchill subscription and delivery paths retain the existing request security controls, while the accepted findings are limited to import paths, filenames, and constant typing conventions.

Files Needing Attention: apps/sim/triggers/windchill/index.ts and apps/sim/triggers/windchill/utils.ts

Important Files Changed

Filename Overview
apps/sim/lib/webhooks/providers/windchill.ts Implements creation and cleanup of scoped Windchill EventMgmt subscriptions using existing authenticated and SSRF-protected request helpers.
apps/sim/triggers/windchill/utils.ts Defines shared trigger fields, event mapping, validation, and setup instructions; its constants omit required const assertions.
apps/sim/blocks/blocks/windchill.ts Enables Windchill triggers on the block and merges all four trigger configurations into its editor schema.
apps/sim/triggers/windchill/index.ts Exposes the four trigger definitions through a barrel but uses relative paths contrary to repository rules.
apps/sim/lib/webhooks/providers/windchill.test.ts Covers scope-specific request bodies, lifecycle filtering, validation, cleanup behavior, raw payload handling, and registry alignment.
apps/docs/content/docs/en/integrations/windchill.mdx Documents configuration fields for all four new Windchill triggers.

Sequence Diagram

sequenceDiagram
  participant User
  participant Sim as Sim Deployment
  participant WRS as Windchill EventMgmt
  participant Hook as Sim Webhook Ingress
  participant Exec as Workflow Executor
  User->>Sim: Configure and deploy Windchill trigger
  Sim->>WRS: Create EventSubscription
  WRS-->>Sim: Subscription ID
  WRS->>Hook: POST raw document event
  Hook->>Exec: Enqueue workflow execution
  User->>Sim: Undeploy or replace trigger
  Sim->>WRS: Delete EventSubscription
Loading

Reviews (1): Last reviewed commit: "docs(windchill): clarify trigger authent..." | Re-trigger Greptile

Comment thread apps/sim/triggers/windchill/index.ts
Comment thread apps/sim/triggers/windchill/custom_document_event.ts
Comment thread apps/sim/triggers/windchill/utils.ts
@waleedlatif1
waleedlatif1 force-pushed the plan-windchill-integration branch from 79a871a to 77cec66 Compare August 12, 2026 19:49
Base automatically changed from plan-windchill-integration to staging August 12, 2026 20:18
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