processlens

    Petri-net discovery and model alignment, BPMN control flow, XES/PNML exchange and process diagnostics

    process-mining
    event-log
    conformance
    analytics
    Download zip
    Author
    Version
    0.3.0
    License
    MIT
    Last updated
    7 days ago
    Downloads
    52

    #MoonProcessLens

    MoonProcessLens 是使用 MoonBit 实现的过程日志分析与流程挖掘基础库。它从订单、工单、审批、生产及流水线中已经发生的活动记录,发现实际处理路径,解释与参考流程的偏差,并定位等待、返工和资源并发压力。

    #0.3.0:资源并发与案例流量窗口

    • EventLog::resource_timeline 返回资源任务并发时间线,保留空闲段并合并同时边界,用于设备、工单和流水线资源压力分析。
    • EventLog::flow_windows 统计整案例开始/完成、跨窗活跃数、观察在制量及周期分布,用于订单、审批和服务流程的流量回看。

    要求 moonc >= 0.10.16。资源并发不直接代表人员利用率,完整案例日志也不能推断未上报或未完成案例;接口与预算详见功能文档。

    moon run examples/workload_windows --target wasm-gc --deny-warn

    #0.2.0:从路径分析扩展到模型级流程挖掘

    本版新增模型接口,旧版 0.1.0 不包含这些接口。原有 DFG、参考路径和性能接口保留;EventLog、CaseTrace、ReferencePath、AlignmentSpec 的内部数组现为私有,外部代码应使用复制返回的访问方法,避免破坏日志不变量。

    新增核心能力实际可复用的结果
    可执行模型发现经典 Alpha 从因果足迹发现含并行结构的接受 Petri Net;前缀网发现保留观察到的有限轨迹语言,支持重复活动和短循环样例,不将 DFG 换名为模型
    模型级一致性带权普通 P/T 网、初始/终止标识、静默迁移;Dijkstra 在轨迹与标识乘积空间返回最优同步/日志/模型偏差证据;预算不足显式报错
    模型行为检查可达状态图、终止可达、能否从已探索状态完成、剩余令牌完成异常、死锁与死迁移;未完成探索标记 complete=false,不冒充完整 soundness 证明
    BPMN 控制流接入支持一个起止事件、普通 task、XOR/AND 分支及汇合的受限 BPMN 2.0 XML,转换成 Petri Net 后按语义检查;不执行条件、事件、数据或子流程
    标准格式互操作XES 完成事件和 start/complete 配对、时间/资源/实例身份;PNML 带权网与明确终止标识;XML 双向交换,明确投影与不支持项
    批量变体复用同一模型、同一标签序列只搜索一次,逐实例重新绑定事件 ID;成本与证据与不复用版本一致,可统计实际搜索工作

    另外新增 声明式响应/前置/互斥/职责分离规则、响应时限、完整实例筛选、资源交接网络、群组变体分布差异。资源缺失返回 inconclusive,群组差异是描述统计,不当作因果或统计显著性结论。

    #三个新增完整场景

    moon run --target native examples/model_discovery moon run --target native examples/model_conformance moon run --target native examples/standard_workflow

    • 生产履约:从两种并行交错发现模型,两种顺序均通过,漏做质检产生代价 1;PNML 交换后行为保持。
    • 审批复核:读取 XOR 审批 BPMN,人工或自动审批各自合法,重复走两个分支被指出;不是将网关当普通活动。
    • 工单治理:XES 交换后检查审批时限和“四眼原则”,找到延误与自审批,筛出慢实例并构建资源交接网络。

    三个都是合成数据上的可运行断言示例,不是生产用户采用声明。模型选择、支持矩阵和算法代价详见 模型能力与互操作。

    #与成熟工具对照及量化证据

    python scripts/compare_pm4py.py 使用独立 PM4Py 2.7.23(开发期 oracle,非运行依赖)。已实测 484 个无权模型对齐成本、6 个 Alpha 发现行为、8 个 XES 事件、2 个 PNML 成本、3 个 BPMN 行为一致;PM4Py 写出的 XES/PNML 再由本库读取验证 2 个实例。另有 121 个带权成本使用 PM4Py 执行语义枚举接受语言加独立距离计算,不冒称其对齐器本身支持该权重样例。完整版本条件和局限见 验证说明。

    参照对象是真实安装的 PM4Py 发布包,不是自写的替身;但“使用成熟完整工具作参照”不等于“覆盖其全部能力”。PM4Py 能力对应与验证矩阵 逐项列出已实现、独立对照、语义差异与未覆盖能力。项目不是 PM4Py 的源码移植,也不依赖 Python 执行核心计算。

    moon run --target native --release examples/model_scale 对 2000 个实例、4 个变体做 10 轮成本及完整证据一致性对比。本机重复变体负载下每轮复用 1996 个实例,搜索状态 32 对 16000,最近一次 P50 为 3ms 对 52ms(前次 4ms 对 52ms);不保证其他分布、更复杂模型或跨机器收益。

    本轮本地 moon check/build/test --target all --deny-warn 已通过;wasm、wasm-gc、JavaScript、native 每个后端各 158 项测试通过。CI 同时执行四后端及独立 PM4Py job;远程执行状态以 GitHub Actions 对应提交为准,不以本地结果代替。

    输入是带 case_id / activity / started / completed / resource 的区间日志;输出是可供报表、可视化及业务工具使用的流程关系图、路径变体、对齐证据和耗时报告。核心分析不依赖外部服务或流计算集群。

    #保留的基础诊断能力

    能力可复用价值
    日志重建与 JSON 互操作将乱序业务区间按实例重建,验证身份、时间与容量,便于应用或现有协议库接入。
    流程关系和变体发现区分活动次数与实例覆盖,识别直接相邻关系、自循环、起止节点和完整处理路径。
    最优加权轨迹对齐对有限参考路径解释额外活动和缺失步骤,输出活动身份与逐步证据,支持不同偏差成本。
    区间性能和资源诊断区分服务工作量、并发区间覆盖和真正空闲,分析分位数、环节间隔及资源并发峰值。

    #本地使用

    模块为 xingsiyi/processlens。GitHub 与 Mooncakes 发布账号均为 xingsiyi;项目继续使用原本地文件夹,文件夹名称不代表产品名称。

    安装当前版本:moon add xingsiyi/processlens@0.3.0。

    import { "xingsiyi/processlens" @lens }

    fn main raise {
    let log = @lens.EventLog::new([
    @lens.LogEvent::new("o1", "order/7", "create", 0L, 1L),
    @lens.LogEvent::new("o2", "order/7", "ship", 5L, 6L),
    ])
    let model = @lens.ReferencePath::new("approved-order", ["create", "approve", "ship"])
    let result = log.align([model])
    assert_eq(result[0].cost, 1)
    println(@lens.alignment_to_json(result[0]).stringify())
    println(@lens.process_map_to_json(log.discover()).stringify())
    println(@lens.performance_to_json(log.performance()).stringify())
    }

    生产根包仅使用 MoonBit 标准库。文件 CLI 的 IO 使用 moonbitlang/x@0.4.49;核心分析支持 wasm、wasm-gc、JavaScript、native,开发工具链为 moonc 0.10.16。

    #完整业务场景

    示例输入、分析和可核验结果
    procurement两笔乱序订单,发现正常和跳过审批两种路径;对齐明确指出缺失审批,并报告处理空闲。
    support工单反复调查形成自循环;对齐给出多余活动证据,并输出客服环节服务耗时分布。
    pipeline构建与测试并行;区间并集避免把并发工作量误算成总耗时,计算资源并发峰值。
    repairs正常维修和复检返工走不同参考路径;识别变体,比较工位服务时间和跨工单并发。

    moon run --target native examples/procurement moon run --target native examples/support moon run --target native examples/pipeline moon run --target native examples/repairs moon run --target native --release examples/process_scale

    上述示例都有实际输出和断言,使用自建合成数据。规模示例处理 60,000 个事件、20,000 个实例,实际完成发现、对齐和性能分析;不据此宣称优于其他实现。

    #文件工具

    moon run --target native cmd/processlens -- analyze examples/files/process-log.json moon run --target native cmd/processlens -- align examples/files/process-log.json examples/files/reference-paths.json

    analyze 输出流程图和性能报告;align 对全部实例预先检查累计计算预算,再输出逐步偏差证据。格式、边界、算法复杂度见 API、语义、JSON 和 性能。

    新增文件工具可直接连接标准日志与模型:

    moon run --target native cmd/processlens -- check examples/files/model-log.xes examples/files/parallel.bpmn moon run --target native cmd/processlens -- discover examples/files/model-log.xes alpha moon run --target native cmd/processlens -- discover-pnml examples/files/model-log.xes prefix moon run --target native cmd/processlens -- model examples/files/parallel.bpmn moon run --target native cmd/processlens -- audit examples/files/model-log.xes examples/files/policies.json python scripts/verify_model_cli.py

    check 和 audit 会输出证据;发现不一致/违反或不可判定时退出码 3。非法输入/预算失败为 1,命令用法错误为 2。analyze/model/compare/resources 是描述性报告命令,不能以退出 0 当作完整模型正确性证明。

    #功能边界

    关系图仍只描述指定排序下的相邻活动;align 针对有限参考路径,新 align_net 才是接受模型的最优对齐。Alpha 是经典算法、有明确完备性假设及 16 活动上限;短循环应显式选择前缀网,后者不泛化未知循环次数。支持普通 Petri Net 与限定 BPMN/XES/PNML profile,不是完整 BPMN/XES/PNML 标准实现或 PM4Py 等价替代;不支持 OCEL、Inductive Miner、执行工作流、统计因果推断。无工作日历/资源容量时仅报告观察到的耗时和并发。

    根包与旧序列引擎相互独立。早期 MoonCEP 的实现和测试保留在可选 sequence 子包,工具入口为 cmd/sequence,详见 历史能力文档。沿革和代码来源如实保留,项目更名不等于历史被删除。

    #验证

    moon check --target all --deny-warn moon build --target all --deny-warn moon test --target all --deny-warn moon fmt --check moon info git diff --exit-code python scripts/verify_repository.py

    本机 Windows 0.10.16 如遇官方扩展路径问题,使用 & .\scripts\Invoke-Moon.ps1 ... 替代 moon ...。该适配仅转发参数,不修改全局工具。

    测试含独立的公共子序列穷举对齐预言机、整数时间槽区间覆盖/并发预言机、JSON 边界和旧检测器回归。CI 验证所有后端、完整场景与文件工具;远端运行状态以仓库 Actions 页面为准。

    采用 MIT 许可证,AI 辅助独立实现;参考、依赖和演进来源见 来源说明。申报书与过程报告保存在仓库外。

    ProcessError

    pub(all) suberror ProcessError {
    InvalidLog(path~ : String, reason~ : String)
    Capacity(resource~ : String, limit~ : Int)
    } derive(
    Debug
    )

    ActivityNode

    pub(all) struct ActivityNode {
    activity : String
    occurrences : Int
    cases : Int
    starts : Int
    ends : Int
    } derive(Eq,
    Debug
    )

    ActivityNode::equal

    ActivityNode::not_equal

    fn ActivityNode::not_equal(x : ActivityNode, y : ActivityNode) -> Bool

    ActivityPerformance

    pub(all) struct ActivityPerformance {
    activity : String
    service : DurationDistribution
    }

    AlignmentCosts

    pub struct AlignmentCosts {
    unexpected : Int
    missing : Int
    }

    AlignmentCosts::new

    fn AlignmentCosts::new(unexpected? : Int, missing? : Int) -> AlignmentCosts raise ProcessError

    AlignmentMove

    pub(all) enum AlignmentMove {
    Synchronous(event_id~ : String, activity~ : String)
    Unexpected(event_id~ : String, activity~ : String)
    Missing(activity~ : String)
    } derive(Eq,
    Debug
    )

    AlignmentMove::equal

    AlignmentMove::not_equal

    fn AlignmentMove::not_equal(x : AlignmentMove, y : AlignmentMove) -> Bool

    AlignmentSpec

    pub struct AlignmentSpec {
    // private fields
    }

    AlignmentSpec::costs

    AlignmentSpec::paths

    BpmnFlow

    pub(all) struct BpmnFlow {
    id : String
    source : String
    target : String
    }

    BpmnKind

    pub(all) enum BpmnKind {
    Start
    End
    Task
    Exclusive
    Parallel
    }

    BpmnModel

    pub struct BpmnModel {
    // private fields
    }

    Control-flow subset with one start/end, plain tasks, exclusive and parallel split/join gateways. No conditions, event semantics, subprocesses or data.

    BpmnModel::flows

    fn BpmnModel::flows(self : BpmnModel) -> Array[BpmnFlow]

    BpmnModel::new

    fn BpmnModel::new(nodes : Array[BpmnNode], flows : Array[BpmnFlow]) -> BpmnModel raise ProcessError

    BpmnModel::nodes

    fn BpmnModel::nodes(self : BpmnModel) -> Array[BpmnNode]

    BpmnModel::to_bpmn

    fn BpmnModel::to_bpmn(self : BpmnModel) -> String

    BpmnModel::to_petri_net

    fn BpmnModel::to_petri_net(self : BpmnModel) -> PetriNet raise ProcessError

    BpmnNode

    pub(all) struct BpmnNode {
    id : String
    kind : BpmnKind
    activity : String?
    }

    CasePerformance

    pub(all) struct CasePerformance {
    case_id : String
    events : Int
    cycle_time : Int64
    busy_union : Int64
    idle_time : Int64
    service_work : Double
    overlapping_starts : Int
    }

    CaseSelection

    pub(all) struct CaseSelection {
    require_activities : Array[String]
    exclude_activities : Array[String]
    minimum_cycle : Int64?
    maximum_cycle : Int64?
    starts_from : Int64?
    starts_before : Int64?
    }

    CaseSelection::all

    CaseTrace

    pub struct CaseTrace {
    // private fields
    }

    CaseTrace::activities

    fn CaseTrace::activities(self : CaseTrace) -> Array[String]

    CaseTrace::align

    fn CaseTrace::align(self : CaseTrace, references : Array[ReferencePath], costs? : AlignmentCosts, max_cells? : Int) -> TraceAlignment raise ProcessError

    Minimum-cost insertion/deletion alignment against finite reference paths. This is not Petri-net alignment: loops need explicit reference repetitions. Reference ties follow caller order; move ties prefer sync, unexpected, missing.

    CaseTrace::align_net

    fn CaseTrace::align_net(self : CaseTrace, net : PetriNet, limits? : ModelLimits) -> ModelAlignment raise ProcessError

    Dijkstra on the synchronous product (trace index, marking). Visible log/model moves cost 1, sync and silent transitions cost 0. Final marking must match EXACTLY. Exhaustion raises Capacity; never returns an approximate optimum.

    CaseTrace::cycle_time

    fn CaseTrace::cycle_time(self : CaseTrace) -> Int64

    CaseTrace::events

    fn CaseTrace::events(self : CaseTrace) -> Array[LogEvent]

    CaseTrace::id

    fn CaseTrace::id(self : CaseTrace) -> String

    CaseTrace::new

    fn CaseTrace::new(id : String, events : Array[LogEvent]) -> CaseTrace raise ProcessError

    CaseTrace::performance

    fn CaseTrace::performance(self : CaseTrace) -> CasePerformance

    Busy time is interval union, not the sum of concurrent service durations.

    CohortComparison

    pub(all) struct CohortComparison {
    before_cases : Int
    after_cases : Int
    total_variation : Double
    variants : Array[VariantDelta]
    }

    DurationDistribution

    pub(all) struct DurationDistribution {
    count : Int
    minimum : Int64?
    maximum : Int64?
    median : Int64?
    p95 : Int64?
    mean : Double?
    }

    EventLog

    pub struct EventLog {
    // private fields
    }

    EventLog::align

    fn EventLog::align(self : EventLog, references : Array[ReferencePath], costs? : AlignmentCosts, max_cells? : Int) -> Array[TraceAlignment] raise ProcessError

    EventLog::align_net

    fn EventLog::align_net(self : EventLog, net : PetriNet, limits? : ModelLimits, reuse_variants? : Bool) -> Array[ModelAlignment] raise ProcessError

    Aggregate work budget bounds the whole log, including all traces, not only each search. Results are returned only after all traces succeed.

    EventLog::case_count

    fn EventLog::case_count(self : EventLog) -> Int

    EventLog::check_policies

    fn EventLog::check_policies(self : EventLog, policies : Array[ProcessPolicy], max_work? : Int, max_findings? : Int) -> Array[PolicyResult] raise ProcessError

    Trace-order declarative checks. Response targets must be later occurrences; bounded response requires target.started >= trigger.completed. Missing resource data yields Inconclusive, never a silent separation-of-duty pass.

    EventLog::compare_cohort

    fn EventLog::compare_cohort(self : EventLog, next : EventLog) -> CohortComparison raise ProcessError

    Compare normalized variant distributions (total variation distance 0..1). Requires two nonempty cohorts; this is descriptive drift, not a p-value or a causal explanation. Frequency and full variant sequence are retained.

    EventLog::discover

    fn EventLog::discover(self : EventLog) -> ProcessMap

    Direct-follow means adjacency in each reconstructed case, not causality. Self-loops are retained; the graph does not infer a Petri net or parallelism.

    EventLog::discover_alpha

    fn EventLog::discover_alpha(self : EventLog, max_work? : Int) -> PetriNet raise ProcessError

    Classical Alpha miner: one transition per activity, causal footprint and maximal independent input/output sets. Explicitly rejects observed length-1 and length-2 loops. Incomplete/noisy logs can yield unsound or underfitting nets; use analyze() and actual conformance, not a universal soundness claim.

    EventLog::discover_prefix_net

    fn EventLog::discover_prefix_net(self : EventLog, max_nodes? : Int) -> PetriNet raise ProcessError

    Prefix-acceptor net discovery for exact observed finite language. Repeated labels, prefixes and short loops are supported as separate occurrences; no generalisation to arbitrary loop iterations or unseen concurrency is implied.

    EventLog::event_count

    fn EventLog::event_count(self : EventLog) -> Int

    EventLog::flow_windows

    fn EventLog::flow_windows(self : EventLog, from : Int64, until : Int64, width : Int64, max_windows? : Int, max_work? : Int) -> Array[FlowWindow] raise ProcessError

    Fixed-width retrospective windows over whole observed cases. Arrivals and completions use [start,end); occupancy uses case [first-start,last-complete). Open/incomplete cases absent from EventLog cannot be inferred here.

    EventLog::new

    fn EventLog::new(events : Array[LogEvent], max_events? : Int, max_cases? : Int, max_trace? : Int) -> EventLog raise ProcessError

    Sort by start time, completion time, then original input occurrence. Event IDs are globally unique; case IDs are opaque and sorted lexically.

    EventLog::performance

    fn EventLog::performance(self : EventLog) -> PerformanceReport

    Handoffs are descriptive adjacent-activity gaps. Overlapping pairs contribute zero to the gap distribution and are counted separately. They are not proof of causality. Resource concurrency is observed workload, not utilization.

    EventLog::resource_handoffs

    fn EventLog::resource_handoffs(self : EventLog) -> Array[ResourceHandoff]

    Adjacent observed resource handovers, excluding self-handover and missing resources. Descriptive only: adjacency does not prove a causal transfer.

    EventLog::resource_timeline

    fn EventLog::resource_timeline(self : EventLog, resource : String, from : Int64, until : Int64, max_segments? : Int) -> Array[ResourceOccupancy] raise ProcessError

    Half-open occupancy for one observed resource, including idle spans. Simultaneous boundaries are folded before sampling; zero-length work adds no occupancy. This is observed concurrency, not staffing utilization.

    EventLog::select_cases

    fn EventLog::select_cases(self : EventLog, selection : CaseSelection) -> EventLog raise ProcessError

    Select WHOLE cases, never truncate histories or synthesize missing events. Window is start-inclusive/end-exclusive in the caller's interval time unit.

    EventLog::to_xes

    fn EventLog::to_xes(self : EventLog) -> String raise ProcessError

    Non-lossless projection: exports core event fields only. Time unit must be Unix milliseconds. Completion is standard; lens:started preserves intervals.

    EventLog::traces

    fn EventLog::traces(self : EventLog) -> Array[CaseTrace]

    FlowEdge

    pub(all) struct FlowEdge {
    source : String
    target : String
    occurrences : Int
    cases : Int
    } derive(Eq,
    Debug
    )

    FlowEdge::equal

    fn FlowEdge::equal(FlowEdge, FlowEdge) -> Bool

    FlowEdge::not_equal

    fn FlowEdge::not_equal(x : FlowEdge, y : FlowEdge) -> Bool

    FlowEdge::to_repr

    FlowWindow

    pub(all) struct FlowWindow {
    started : Int64
    completed : Int64
    cases_started : Int
    cases_completed : Int
    active_at_start : Int
    active_before_end : Int
    observed_work_area : Double
    mean_observed_wip : Double
    completed_cycles : DurationDistribution
    }

    HandoffPerformance

    pub(all) struct HandoffPerformance {
    source : String
    target : String
    positive_gap : DurationDistribution
    overlapping_pairs : Int
    }

    LogEvent

    pub struct LogEvent {
    id : String
    case_id : String
    activity : String
    started : Int64
    completed : Int64
    resource : String?
    } derive(Eq,
    Debug
    )

    A completed activity occurrence. Intervals may overlap within a case.

    LogEvent::activity

    fn LogEvent::activity(self : LogEvent) -> String

    LogEvent::case_id

    fn LogEvent::case_id(self : LogEvent) -> String

    LogEvent::completed

    fn LogEvent::completed(self : LogEvent) -> Int64

    LogEvent::equal

    fn LogEvent::equal(LogEvent, LogEvent) -> Bool

    LogEvent::id

    fn LogEvent::id(self : LogEvent) -> String

    LogEvent::new

    fn LogEvent::new(id : String, case_id : String, activity : String, started : Int64, completed : Int64, resource? : String?) -> LogEvent raise ProcessError

    LogEvent::not_equal

    fn LogEvent::not_equal(x : LogEvent, y : LogEvent) -> Bool

    LogEvent::resource

    fn LogEvent::resource(self : LogEvent) -> String?

    LogEvent::started

    fn LogEvent::started(self : LogEvent) -> Int64

    LogEvent::to_repr

    ModelAlignment

    pub(all) struct ModelAlignment {
    case_id : String
    cost : Int
    conforming : Bool
    moves : Array[NetMove]
    visited_states : Int
    explored_edges : Int
    transition_checks : Int
    reused_variant : Bool
    }

    ModelAnalysis

    pub(all) struct ModelAnalysis {
    complete : Bool
    states : Int
    edges : Int
    final_reachable : Bool
    all_states_can_complete : Bool
    proper_completion : Bool
    dead_transitions : Array[String]
    deadlock_markings : Array[Array[Int]]
    }

    ModelLimits

    pub(all) struct ModelLimits {
    states : Int
    edges : Int
    tokens_per_place : Int
    }

    ModelLimits::default

    fn ModelLimits::default() -> ModelLimits

    NetArc

    pub(all) struct NetArc {
    source : String
    target : String
    weight : Int
    }

    NetMove

    pub(all) enum NetMove {
    Sync(event_id~ : String, transition~ : String, activity~ : String)
    LogOnly(event_id~ : String, activity~ : String)
    ModelOnly(transition~ : String, activity~ : String?)
    } derive(Eq,
    Debug
    )

    NetMove::equal

    fn NetMove::equal(NetMove, NetMove) -> Bool

    NetMove::not_equal

    fn NetMove::not_equal(x : NetMove, y : NetMove) -> Bool

    NetMove::to_repr

    NetTransition

    pub(all) struct NetTransition {
    id : String
    activity : String?
    }

    PerformanceReport

    pub(all) struct PerformanceReport {
    cases : Array[CasePerformance]
    activities : Array[ActivityPerformance]
    handoffs : Array[HandoffPerformance]
    resources : Array[ResourcePerformance]
    cycle_times : DurationDistribution
    }

    PetriNet

    pub struct PetriNet {
    // private fields
    }

    Ordinary weighted P/T net; no inhibitors, priorities or coloured tokens. Captures all arrays. Markings are vectors in places() order.

    PetriNet::analyze

    fn PetriNet::analyze(self : PetriNet, limits? : ModelLimits) -> ModelAnalysis raise ProcessError

    These are accepting-net behavioural checks, NOT a full WF-net structural soundness theorem. Positive conclusions require complete exploration.

    PetriNet::arcs

    fn PetriNet::arcs(self : PetriNet) -> Array[NetArc]

    PetriNet::enabled

    fn PetriNet::enabled(self : PetriNet, marking : Array[Int]) -> Array[String] raise ProcessError

    PetriNet::final_marking

    fn PetriNet::final_marking(self : PetriNet) -> Array[Int]

    PetriNet::fire

    fn PetriNet::fire(self : PetriNet, marking : Array[Int], transition : String) -> Array[Int] raise ProcessError

    PetriNet::initial_marking

    fn PetriNet::initial_marking(self : PetriNet) -> Array[Int]

    PetriNet::new

    fn PetriNet::new(places : Array[String], transitions : Array[NetTransition], arcs : Array[NetArc], initial : Array[PlaceTokens], accepting : Array[PlaceTokens]) -> PetriNet raise ProcessError

    PetriNet::places

    fn PetriNet::places(self : PetriNet) -> Array[String]

    PetriNet::to_json

    fn PetriNet::to_json(self : PetriNet) -> Json

    PetriNet::to_pnml

    fn PetriNet::to_pnml(self : PetriNet) -> String

    PetriNet::transitions

    fn PetriNet::transitions(self : PetriNet) -> Array[NetTransition]

    PlaceTokens

    pub(all) struct PlaceTokens {
    place : String
    tokens : Int
    }

    PolicyResult

    pub(all) struct PolicyResult {
    case_id : String
    policy : String
    status : PolicyStatus
    event_ids : Array[String]
    }

    PolicyStatus

    pub(all) enum PolicyStatus {
    Satisfied
    Violated
    Inconclusive
    NotApplicable
    } derive(Eq,
    Debug
    )

    PolicyStatus::equal

    PolicyStatus::not_equal

    fn PolicyStatus::not_equal(x : PolicyStatus, y : PolicyStatus) -> Bool

    ProcessMap

    pub(all) struct ProcessMap {
    nodes : Array[ActivityNode]
    edges : Array[FlowEdge]
    variants : Array[ProcessVariant]
    cases : Int
    events : Int
    }

    ProcessMap::frequent_edges

    fn ProcessMap::frequent_edges(self : ProcessMap, minimum : Int) -> Array[FlowEdge] raise ProcessError

    Return a detached graph filtered by edge occurrence count. All observed activity nodes remain so pruning cannot silently erase isolated activities.

    ProcessPolicy

    pub(all) enum ProcessPolicy {
    Response(id~ : String, trigger~ : String, target~ : String, within_ms~ : Int64?)
    Precedence(id~ : String, trigger~ : String, required~ : String)
    NotCoexist(id~ : String, first~ : String, second~ : String)
    SeparationOfDuties(id~ : String, first~ : String, second~ : String)
    }

    ProcessVariant

    pub(all) struct ProcessVariant {
    activities : Array[String]
    cases : Array[String]
    }

    ReferencePath

    pub struct ReferencePath {
    // private fields
    }

    ReferencePath::activities

    fn ReferencePath::activities(self : ReferencePath) -> Array[String]

    ReferencePath::name

    fn ReferencePath::name(self : ReferencePath) -> String

    ReferencePath::new

    fn ReferencePath::new(name : String, activities : Array[String]) -> ReferencePath raise ProcessError

    ResourceHandoff

    pub(all) struct ResourceHandoff {
    source : String
    target : String
    occurrences : Int
    cases : Int
    }

    ResourceOccupancy

    pub(all) struct ResourceOccupancy {
    started : Int64
    completed : Int64
    active : Int
    }

    ResourcePerformance

    pub(all) struct ResourcePerformance {
    resource : String
    occurrences : Int
    service : DurationDistribution
    maximum_concurrency : Int
    }

    TraceAlignment

    pub(all) struct TraceAlignment {
    case_id : String
    reference : String
    cost : Int
    fitness : Double
    moves : Array[AlignmentMove]
    evaluated_cells : Int
    }

    VariantDelta

    pub(all) struct VariantDelta {
    activities : Array[String]
    before_cases : Int
    after_cases : Int
    }

    XesMode

    pub(all) enum XesMode {
    Completed
    LifecyclePairs
    }

    alignment_to_json

    fn alignment_to_json(result : TraceAlignment) -> Json

    cohort_comparison_to_json

    fn cohort_comparison_to_json(result : CohortComparison) -> Json

    log_to_json

    fn log_to_json(log : EventLog) -> Json

    model_alignment_to_json

    fn model_alignment_to_json(result : ModelAlignment) -> Json

    model_analysis_to_json

    fn model_analysis_to_json(report : ModelAnalysis) -> Json

    parse_alignment_spec

    fn parse_alignment_spec(text : String) -> AlignmentSpec raise ProcessError

    parse_bpmn

    fn parse_bpmn(text : String) -> BpmnModel raise ProcessError

    parse_log

    fn parse_log(text : String) -> EventLog raise ProcessError

    parse_net

    fn parse_net(text : String) -> PetriNet raise ProcessError

    parse_pnml

    fn parse_pnml(text : String) -> PetriNet raise ProcessError

    Single net, one flat page (or direct nodes), ordinary weighted PNML P/T net. Requires explicit finalmarkings; never guesses accepting semantics from a sink. ProM is recognized, other executable annotations refused.

    parse_policies

    fn parse_policies(text : String) -> Array[ProcessPolicy] raise ProcessError

    parse_xes

    fn parse_xes(text : String, mode? : XesMode) -> EventLog raise ProcessError

    XES XML scalar-attribute profile. Completed mode maps completion events to points unless lens:started is supplied. Pairing mode requires start/complete with matching (activity, concept:instance); ambiguous overlaps are rejected.

    performance_to_json

    fn performance_to_json(report : PerformanceReport) -> Json

    policy_results_to_json

    fn policy_results_to_json(results : Array[PolicyResult]) -> Json

    process_map_to_json

    fn process_map_to_json(map : ProcessMap) -> Json

    resource_handoffs_to_json

    fn resource_handoffs_to_json(result : Array[ResourceHandoff]) -> Json