createPatternEvent()
createPatternEvent(
agentId,model,variants,bottlenecks,operatorContext?):PatternEvent
Defined in: event-emitter.ts:118
Create a structured PatternEvent from process mining results.
Pure function — no side effects. Summarizes the mining results into a compact event with top variants (up to 5) and top bottlenecks (up to 5).
Parameters
| Parameter | Type | Description |
|---|---|---|
agentId | string | The agent these patterns belong to. |
model | ProcessModel | The discovered process model. |
variants | Variant[] | Variant analysis results. |
bottlenecks | Bottleneck[] | Bottleneck detection results. |
operatorContext? | { instanceId?: string; operatorId: string; sessionId: string; teamId?: string; timestamp?: number; userAgent?: string; } | - |
operatorContext.instanceId? | string | - |
operatorContext.operatorId? | string | - |
operatorContext.sessionId? | string | - |
operatorContext.teamId? | string | - |
operatorContext.timestamp? | number | - |
operatorContext.userAgent? | string | - |
Returns
A structured PatternEvent.
Example
const model = discoverProcess(graphs);
const variants = findVariants(graphs);
const bottlenecks = getBottlenecks(graphs);
const event = createPatternEvent('my-agent', model, variants, bottlenecks);