createPatternEvent()
createPatternEvent(
agentId,model,variants,bottlenecks):PatternEvent
Defined in: event-emitter.ts:117
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. |
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);