mldong/jeeflow-core/model does not have a README file

    CcInstance

    pub(all) struct CcInstance {
    id : Int64
    process_instance_id : Int64
    actor_id : String
    state : Int
    create_time : String?
    create_user : String?
    update_time : String?
    update_user : String?
    } derive(Eq)

    CountersignType

    pub(all) enum CountersignType {
    Parallel
    Sequential
    } derive(Eq, Show)

    CountersignType::from_str_name

    fn CountersignType::from_str_name(s : String) -> CountersignType

    DefineRow

    pub(all) struct DefineRow {
    id : Int64
    name : String
    display_name : String
    define_type : String
    state : Int
    version : Int
    create_time : String?
    create_user : String?
    update_time : String?
    update_user : String?
    } derive(Eq)

    定义行

    DefineRow::new_empty

    fn DefineRow::new_empty() -> DefineRow

    DefineState

    pub(all) enum DefineState {
    Disable
    Enable
    } derive(Eq, Show)

    DefineState::code

    fn DefineState::code(self : DefineState) -> Int

    DefineState::from_code

    fn DefineState::from_code(code : Int) -> DefineState

    FilterOp

    pub(all) enum FilterOp {
    Eq
    Ne
    Like
    Gt
    Lt
    Ge
    Le
    In
    Nin
    Bt
    } derive(Eq, Show)

    m_ 三段式过滤操作符(spec/06 §2.2)

    FilterOp::from_str

    fn FilterOp::from_str(s : String) -> FilterOp?

    InstanceRow

    pub(all) struct InstanceRow {
    id : Int64
    parent_id : Int64?
    process_define_id : Int64
    state : Int
    parent_node_name : String?
    business_no : String?
    operator : String
    expire_time : String?
    variable : String?
    create_time : String?
    create_user : String?
    update_time : String?
    update_user : String?
    define_name : String?
    define_display_name : String?
    define_version : Int?
    } derive(Eq)

    实例行

    InstanceRow::new_empty

    fn InstanceRow::new_empty() -> InstanceRow

    InstanceState

    pub(all) enum InstanceState {
    Doing
    Finished
    Withdraw
    Interrupt
    Reject
    Pending
    Abandon
    } derive(Eq, Show)

    InstanceState::code

    fn InstanceState::code(self : InstanceState) -> Int

    InstanceState::from_code

    fn InstanceState::from_code(code : Int) -> InstanceState?

    PageQuery

    pub(all) struct PageQuery {
    page_num : Int64
    page_size : Int64
    order_by : String?
    operator : String?
    conditions : Map[String, Json]
    filters : Array[QueryFilter]
    }

    PageQuery::add_condition

    fn PageQuery::add_condition(self : PageQuery, key : String, value : Json) -> Unit

    PageQuery::add_filter

    fn PageQuery::add_filter(self : PageQuery, f : QueryFilter) -> Unit

    PageQuery::conditions

    fn PageQuery::conditions(self : PageQuery) -> Map[String, Json]

    PageQuery::filters

    fn PageQuery::filters(self : PageQuery) -> Array[QueryFilter]

    PageQuery::new

    fn PageQuery::new(page_num : Int64, page_size : Int64) -> PageQuery

    PageQuery::operator

    fn PageQuery::operator(self : PageQuery) -> String?

    PageQuery::order_by

    fn PageQuery::order_by(self : PageQuery) -> String?

    PageQuery::page_num

    fn PageQuery::page_num(self : PageQuery) -> Int64

    PageQuery::page_size

    fn PageQuery::page_size(self : PageQuery) -> Int64

    PageQuery::set_operator

    fn PageQuery::set_operator(self : PageQuery, op : String?) -> Unit

    PageQuery::set_order_by

    fn PageQuery::set_order_by(self : PageQuery, s : String) -> Unit

    PageQuery::set_page_num

    fn PageQuery::set_page_num(self : PageQuery, n : Int64) -> Unit

    PageQuery::set_page_size

    fn PageQuery::set_page_size(self : PageQuery, n : Int64) -> Unit

    PageResult

    pub(all) struct PageResult[T] {
    page_num : Int64
    page_size : Int64
    record_count : Int64
    total_page : Int64
    rows : Array[T]
    }

    分页结果:恒五键契约(C22:pageNum/pageSize/recordCount/totalPage/rows)

    PageResult::new

    fn[T] PageResult::new(page_num : Int64, page_size : Int64, record_count : Int64, rows : Array[T]) -> PageResult[T]

    PageResult::page_num

    fn[T] PageResult::page_num(self : PageResult[T]) -> Int64

    PageResult::page_size

    fn[T] PageResult::page_size(self : PageResult[T]) -> Int64

    PageResult::record_count

    fn[T] PageResult::record_count(self : PageResult[T]) -> Int64

    PageResult::rows

    fn[T] PageResult::rows(self : PageResult[T]) -> Array[T]

    PageResult::total_page

    fn[T] PageResult::total_page(self : PageResult[T]) -> Int64

    PerformType

    pub(all) enum PerformType {
    Normal
    Countersign
    } derive(Eq, Show)

    PerformType::code

    fn PerformType::code(self : PerformType) -> Int

    PerformType::from_code

    fn PerformType::from_code(code : Int) -> PerformType

    ProcessDefine

    pub(all) struct ProcessDefine {
    id : Int64
    name : String
    display_name : String
    define_type : String
    state : Int
    content : String
    version : Int
    create_time : String?
    create_user : String?
    update_time : String?
    update_user : String?
    } derive(Eq)

    ProcessDefine::clone

    ProcessDesign

    pub(all) struct ProcessDesign {
    id : Int64
    name : String
    display_name : String
    design_type : String
    icon : String?
    is_deployed : Int
    remark : String?
    create_time : String?
    create_user : String?
    update_time : String?
    update_user : String?
    } derive(Eq)

    ProcessDesign::clone

    ProcessDesignHis

    pub(all) struct ProcessDesignHis {
    id : Int64
    process_design_id : Int64
    content : String
    create_time : String?
    create_user : String?
    } derive(Eq)

    ProcessDesignHis::clone

    ProcessInstance

    pub(all) struct ProcessInstance {
    instance_id : Int64
    parent_id : Int64?
    define_id : Int64
    state : Int
    parent_node_name : String?
    business_no : String?
    operator : String
    expire_time : String?
    variables :
    FlowData

    tasks : Array[ProcessTask]
    create_time : String?
    create_user : String?
    update_time : String?
    update_user : String?
    define : ProcessDefine?
    }

    ProcessInstance —— DDD 聚合根

    ProcessInstance::abandon_all_doing

    fn ProcessInstance::abandon_all_doing(self : ProcessInstance) -> Unit

    ProcessInstance::abandon_task

    fn ProcessInstance::abandon_task(self : ProcessInstance, task_id : Int64) -> Unit raise
    JeeflowError

    ProcessInstance::add_variable

    ProcessInstance::clone

    ProcessInstance::complete_task

    fn ProcessInstance::complete_task(self : ProcessInstance, task_id : Int64, operator : String, args :
    FlowData
    ) -> Unit raise
    JeeflowError

    完成任务:finish 任务 + 合并 f_ 变量(rust complete_task)

    ProcessInstance::create

    工厂:新建实例(state=DOING=10)

    ProcessInstance::create_countersign_tasks

    fn ProcessInstance::create_countersign_tasks(self : ProcessInstance, task_name : String, display_name : String, actor_ids : Array[String], operator : String, task_type : TaskType, form_key : String?, parent_task_id : Int64?) -> Array[ProcessTask]

    会签任务:每人一个独立任务(C9:串行一次只建一个由引擎控制;此处为并行建全入口)

    ProcessInstance::create_history_task

    fn ProcessInstance::create_history_task(self : ProcessInstance, task_name : String, display_name : String, operator : String, task_type : TaskType) -> ProcessTask

    历史任务(custom 节点用,直接 FINISHED)

    ProcessInstance::create_task

    fn ProcessInstance::create_task(self : ProcessInstance, task_name : String, display_name : String, actor_ids : Array[String], operator : String, task_type : TaskType, perform_type : PerformType, form_key : String?, parent_task_id : Int64?) -> ProcessTask

    建任务(子实体工厂;task_id=0 由 ID 生成器赋值——rust 91b:原片赋 id 再克隆返回)

    ProcessInstance::create_with_parent

    fn ProcessInstance::create_with_parent(define : ProcessDefine, operator : String, args :
    FlowData
    , parent_id : Int64, parent_node_name : String) -> ProcessInstance

    工厂(子流程):带父实例

    ProcessInstance::finish

    fn ProcessInstance::finish(self : ProcessInstance) -> Unit

    ProcessInstance::get_doing_tasks

    fn ProcessInstance::get_doing_tasks(self : ProcessInstance) -> Array[ProcessTask]

    ProcessInstance::get_doing_tasks_by_names

    fn ProcessInstance::get_doing_tasks_by_names(self : ProcessInstance, names : Array[String]) -> Array[ProcessTask]

    ProcessInstance::get_done_tasks_by_names

    fn ProcessInstance::get_done_tasks_by_names(self : ProcessInstance, names : Array[String]) -> Array[ProcessTask]

    ProcessInstance::get_finished_tasks

    fn ProcessInstance::get_finished_tasks(self : ProcessInstance) -> Array[ProcessTask]

    ProcessInstance::get_history_tasks

    fn ProcessInstance::get_history_tasks(self : ProcessInstance) -> Array[ProcessTask]

    ProcessInstance::interrupt

    fn ProcessInstance::interrupt(self : ProcessInstance) -> Unit

    ProcessInstance::is_all_tasks_finished

    fn ProcessInstance::is_all_tasks_finished(self : ProcessInstance) -> Bool

    ProcessInstance::is_doing

    fn ProcessInstance::is_doing(self : ProcessInstance) -> Bool

    ProcessInstance::is_finished

    fn ProcessInstance::is_finished(self : ProcessInstance) -> Bool

    ProcessInstance::pending

    fn ProcessInstance::pending(self : ProcessInstance) -> Unit

    ProcessInstance::reject

    fn ProcessInstance::reject(self : ProcessInstance) -> Unit

    ProcessInstance::reject_task

    fn ProcessInstance::reject_task(self : ProcessInstance, task_name : String, display_name : String, actor_ids : Array[String], operator : String, parent_task_id : Int64) -> ProcessTask

    退回上一步:为新节点建待办任务

    ProcessInstance::remove_variables

    fn ProcessInstance::remove_variables(self : ProcessInstance, keys : Array[String]) -> Unit

    ProcessInstance::resume

    fn ProcessInstance::resume(self : ProcessInstance) -> Unit

    ProcessInstance::withdraw

    fn ProcessInstance::withdraw(self : ProcessInstance) -> Unit

    撤回:实例 30 WITHDRAW + 全部 DOING 任务 30(C28:任务 30 非 45)

    ProcessSurrogate

    pub(all) struct ProcessSurrogate {
    id : Int64
    process_name : String
    operator : String
    surrogate : String
    start_time : String?
    end_time : String?
    enabled : Int
    create_time : String?
    create_user : String?
    update_time : String?
    update_user : String?
    } derive(Eq)

    ProcessSurrogate::clone

    ProcessTask

    pub(all) struct ProcessTask {
    task_id : Int64
    process_instance_id : Int64
    task_name : String
    display_name : String
    task_type : Int
    perform_type : Int
    task_state : Int
    actor_id : String?
    actor_ids : Array[String]
    finish_time : String?
    expire_time : String?
    form_key : String?
    parent_task_id : Int64?
    variables :
    FlowData

    create_time : String?
    create_user : String?
    update_time : String?
    update_user : String?
    }

    ProcessTask —— 子实体

    ProcessTask::abandon

    ProcessTask::clone

    fn ProcessTask::clone(self : ProcessTask) -> ProcessTask

    ProcessTask::finish

    fn ProcessTask::finish(self : ProcessTask, operator : String) -> Unit raise
    JeeflowError

    完成(state→FINISHED=20);守卫:仅 DOING + 处理人可办(并发语义 §6.2)

    ProcessTask::interrupt

    ProcessTask::is_allowed

    fn ProcessTask::is_allowed(self : ProcessTask, operator : String) -> Bool

    处理人校验:"flow.auto"/"flow.admin" 直通

    ProcessTask::is_doing

    fn ProcessTask::is_doing(self : ProcessTask) -> Bool

    ProcessTask::is_finished

    fn ProcessTask::is_finished(self : ProcessTask) -> Bool

    ProcessTask::pending

    ProcessTask::resume

    fn ProcessTask::resume(self : ProcessTask) -> Unit

    ProcessTask::withdraw

    fn ProcessTask::withdraw(self : ProcessTask) -> Unit

    QueryFilter

    pub(all) struct QueryFilter {
    alias : String
    op : FilterOp
    column : String
    value : String
    } derive(Eq)

    m_ 过滤条件(spec/06 §2.2)

    QueryFilter::alias

    fn QueryFilter::alias(self : QueryFilter) -> String

    QueryFilter::column

    fn QueryFilter::column(self : QueryFilter) -> String

    QueryFilter::make

    fn QueryFilter::make(alias : String, op : FilterOp, column : String, value : String) -> QueryFilter

    QueryFilter::op

    fn QueryFilter::op(self : QueryFilter) -> FilterOp

    QueryFilter::value

    fn QueryFilter::value(self : QueryFilter) -> String

    SubmitType

    pub(all) enum SubmitType {
    Apply
    Agree
    Reject
    Rollback
    Jump
    ReApply
    RollbackToOperator
    CountersignDisagree
    } derive(Eq, Show)

    SubmitType::code

    fn SubmitType::code(self : SubmitType) -> Int64

    SubmitType::from_code

    fn SubmitType::from_code(code : Int64) -> SubmitType?

    TaskActor

    pub(all) struct TaskActor {
    id : Int64
    process_task_id : Int64
    actor_id : String
    create_time : String?
    create_user : String?
    } derive(Eq)

    TaskRow

    pub(all) struct TaskRow {
    id : Int64
    process_instance_id : Int64
    task_name : String
    display_name : String
    task_type : Int
    perform_type : Int
    task_state : Int
    operator : String?
    actor_id : String?
    finish_time : String?
    expire_time : String?
    form_key : String?
    task_parent_id : Int64?
    variable : String?
    create_time : String?
    create_user : String?
    update_time : String?
    update_user : String?
    process_define_id : Int64?
    instance_state : Int?
    instance_operator : String?
    business_no : String?
    instance_variable : String?
    instance_create_time : String?
    define_name : String?
    define_display_name : String?
    define_version : Int?
    } derive(Eq)

    待办/已办任务行

    TaskRow::new_empty

    fn TaskRow::new_empty() -> TaskRow

    TaskState

    pub(all) enum TaskState {
    Doing
    Finished
    Withdraw
    Interrupt
    Pending
    Abandon
    } derive(Eq, Show)

    TaskState::code

    fn TaskState::code(self : TaskState) -> Int

    TaskState::from_code

    fn TaskState::from_code(code : Int) -> TaskState?

    TaskType

    pub(all) enum TaskType {
    Major
    Assistant
    Record
    } derive(Eq, Show)

    TaskType::code

    fn TaskType::code(self : TaskType) -> Int

    TaskType::from_code

    fn TaskType::from_code(code : Int) -> TaskType

    UserInfo

    pub(all) struct UserInfo {
    user_id : String
    real_name : String
    dept_id : String
    dept_name : String
    post_id : String
    post_name : String
    } derive(Eq)

    用户信息(IUserProvider 返回)

    UserInfo::dept_id

    fn UserInfo::dept_id(self : UserInfo) -> String

    UserInfo::dept_name

    fn UserInfo::dept_name(self : UserInfo) -> String

    UserInfo::make

    fn UserInfo::make(user_id~ : String, real_name~ : String, dept_id? : String, dept_name? : String, post_id? : String, post_name? : String) -> UserInfo

    UserInfo::post_id

    fn UserInfo::post_id(self : UserInfo) -> String

    UserInfo::post_name

    fn UserInfo::post_name(self : UserInfo) -> String

    UserInfo::real_name

    fn UserInfo::real_name(self : UserInfo) -> String

    UserInfo::user_id

    fn UserInfo::user_id(self : UserInfo) -> String

    cmp_str

    fn cmp_str(a : String, b : String) -> Int

    逐码位字典序比较——绕开 String::compare 在 wasm sort 内部的怪异行为 (实测 core sort/sort_by 排 String 结果错误而 compare 直调正常;D-M3-2)

    current_time_str

    fn current_time_str() -> String

    epoch_millis

    fn epoch_millis() -> Int64

    当前墙钟毫秒(@env.now() 的单位实测为 epoch 毫秒,见 model_test)

    epoch_secs

    fn epoch_secs() -> Int64

    当前墙钟秒

    format_time

    fn format_time(s : String) -> String

    format_unix_utc

    fn format_unix_utc(secs : Int64) -> String

    Format unix seconds (UTC) as yyyy-MM-dd HH:mm:ss(civil_from_days, Howard Hinnant)

    set_clock

    fn set_clock(f : () -> String?) -> Unit

    sort_i64

    fn sort_i64(arr : Array[Int64]) -> Unit

    Int64 插入排序(数值序;防同款 core 排序问题扩散)

    sort_int

    fn sort_int(arr : Array[Int]) -> Unit

    Int 插入排序

    sort_strings

    fn sort_strings(arr : Array[String]) -> Unit

    String 插入排序(cmp_str 承载)

    to_camel_case

    fn to_camel_case(s : String) -> String

    snake_case → camelCase