- matchesEvent:事件触发的命中判定(S-FEEL 规则;规则写坏按不命中处置,不让事件流停摆) - assembleInput:字段映射装配;缺必填即起单失败入死信,不静默丢弃 - 幂等:同一事件对同一触发器至多起一单;数据日历型同一行同一日期只触发一次 - 周期两型:日历表达式到点扫描 + 数据日历型(日期字段 + 偏移 + 过滤)逐行起单 - 登记触发:人工起单的统一形态,登记人即来源 - 触发器与流程包平级:配置独立存放,增删启停不改流程包版本 340 个测试通过,门禁五道全绿 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
17 lines
609 B
SQL
17 lines
609 B
SQL
CREATE TABLE "sys"."trigger_claim" (
|
|
"key" text PRIMARY KEY NOT NULL,
|
|
"claimed_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE "sys"."trigger" (
|
|
"id" text PRIMARY KEY NOT NULL,
|
|
"name" text NOT NULL,
|
|
"enabled" boolean DEFAULT true NOT NULL,
|
|
"process_package_id" text NOT NULL,
|
|
"mapping" jsonb DEFAULT '[]'::jsonb NOT NULL,
|
|
"spec" jsonb NOT NULL,
|
|
"last_fired_at" timestamp with time zone,
|
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE INDEX "trigger_enabled_idx" ON "sys"."trigger" USING btree ("enabled"); |