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

    ProcessExtRepository

    pub(open) trait ProcessExtRepository {
    async fn find_design_by_id(Self, Int64) ->
    ProcessDesign
    ? raise
    JeeflowError

    async fn save_design(Self,
    ProcessDesign
    ) -> Unit raise
    JeeflowError

    async fn update_design(Self,
    ProcessDesign
    ) -> Unit raise
    JeeflowError

    async fn remove_design(Self, Int64) -> Unit raise
    JeeflowError

    async fn page_designs(Self,
    PageQuery
    ) ->
    PageResult
    [
    ProcessDesign
    ] raise
    JeeflowError

    async fn save_design_his(Self,
    ProcessDesignHis
    ) -> Unit raise
    JeeflowError

    async fn list_design_his(Self, Int64) -> Array[
    ProcessDesignHis
    ] raise
    JeeflowError

    async fn find_surrogate_by_id(Self, Int64) ->
    ProcessSurrogate
    ? raise
    JeeflowError

    async fn save_surrogate(Self,
    ProcessSurrogate
    ) -> Unit raise
    JeeflowError

    async fn update_surrogate(Self,
    ProcessSurrogate
    ) -> Unit raise
    JeeflowError

    async fn remove_surrogate(Self, Int64) -> Unit raise
    JeeflowError

    async fn page_surrogates(Self,
    PageQuery
    ) ->
    PageResult
    [
    ProcessSurrogate
    ] raise
    JeeflowError

    async fn get_surrogate(Self, String, String, String) ->
    ProcessSurrogate
    ? raise
    JeeflowError

    }

    IProcessExtRepository(spec/05,14 方法:design/his/surrogate)

    ProcessRepository

    pub(open) trait ProcessRepository {
    async fn find_define_by_id(Self, Int64) ->
    ProcessDefine
    ? raise
    JeeflowError

    async fn save_define(Self,
    ProcessDefine
    ) -> Unit raise
    JeeflowError

    async fn update_define(Self,
    ProcessDefine
    ) -> Unit raise
    JeeflowError

    async fn update_define_state(Self, Int64, Int) -> Unit raise
    JeeflowError

    async fn remove_define(Self, Int64) -> Unit raise
    JeeflowError

    async fn find_instance_by_id(Self, Int64) ->
    ProcessInstance
    ? raise
    JeeflowError

    async fn save_instance(Self,
    ProcessInstance
    ) -> Unit raise
    JeeflowError

    async fn update_instance(Self,
    ProcessInstance
    ) -> Unit raise
    JeeflowError

    async fn find_task_by_id(Self, Int64) ->
    ProcessTask
    ? raise
    JeeflowError

    async fn save_task(Self,
    ProcessTask
    ) -> Unit raise
    JeeflowError

    async fn update_task(Self,
    ProcessTask
    ) -> Unit raise
    JeeflowError

    async fn find_doing_tasks(Self, Int64, Array[String]) -> Array[
    ProcessTask
    ] raise
    JeeflowError

    async fn find_done_tasks(Self, Int64, Array[String]) -> Array[
    ProcessTask
    ] raise
    JeeflowError

    async fn find_history_tasks(Self, Int64) -> Array[
    ProcessTask
    ] raise
    JeeflowError

    async fn find_task_actors(Self, Int64) -> Array[String] raise
    JeeflowError

    async fn add_task_actor(Self, Int64, Array[String]) -> Unit raise
    JeeflowError

    async fn remove_task_actor(Self, Int64, Array[String]) -> Unit raise
    JeeflowError

    async fn create_cc_instance(Self, Int64, String, Array[String]) -> Unit raise
    JeeflowError

    async fn update_cc_status(Self, Int64, String) -> Unit raise
    JeeflowError

    async fn page_todo_tasks(Self,
    PageQuery
    ) ->
    PageResult
    [
    TaskRow
    ] raise
    JeeflowError

    async fn page_done_tasks(Self,
    PageQuery
    ) ->
    PageResult
    [
    TaskRow
    ] raise
    JeeflowError

    async fn page_instances(Self,
    PageQuery
    ) ->
    PageResult
    [
    InstanceRow
    ] raise
    JeeflowError

    async fn page_cc_instances(Self,
    PageQuery
    ) ->
    PageResult
    [
    InstanceRow
    ] raise
    JeeflowError

    async fn page_defines(Self,
    PageQuery
    ) ->
    PageResult
    [
    DefineRow
    ] raise
    JeeflowError

    async fn count_todo_tasks(Self, String) -> Int64 raise
    JeeflowError

    async fn get_all_instances(Self) -> Array[
    ProcessInstance
    ] raise
    JeeflowError

    async fn get_all_tasks(Self) -> Array[
    ProcessTask
    ] raise
    JeeflowError

    }

    IProcessRepository(spec/05,24 方法,全 async)

    Ctx

    pub(all) struct Ctx[R, E] {
    repository : R
    ext_repository : E
    user_provider : (String) ->
    UserInfo
    ? raise
    JeeflowError
    ?
    org_user_provider : OrgUserProviderFns?
    user_search_provider : UserSearchProviderFns?
    json_provider : JsonProviderFns?
    expression_evaluator : (String, Map[String, Json]) -> Json raise
    JeeflowError
    ?
    id_generator : () -> Int64 raise
    JeeflowError
    ?
    action_permission_provider : (String) -> Array[String]?
    biz_data_reader : (String, Int64) -> Map[String, Json]? raise
    JeeflowError
    ?
    assignment_handlers : Map[String, (
    Execution
    ) -> String raise
    JeeflowError
    ]
    decision_handlers : Map[String, (
    Execution
    ) -> String raise
    JeeflowError
    ]
    interceptors : Array[InterceptorFn]
    event_listeners : Array[(
    ProcessEvent
    ) -> Unit raise]
    }

    ServiceContext —— 启动期构建、运行期只读的 SPI 注册表

    Ctx::event_listeners

    fn[R, E] Ctx::event_listeners(self : Ctx[R, E]) -> Array[(
    ProcessEvent
    ) -> Unit raise]

    Ctx::ext_repository

    fn[R, E] Ctx::ext_repository(self : Ctx[R, E]) -> E

    Ctx::find_assignment_handler

    fn[R, E] Ctx::find_assignment_handler(self : Ctx[R, E], name : String) -> (
    Execution
    ) -> String raise
    JeeflowError
    ?

    Ctx::find_decision_handler

    fn[R, E] Ctx::find_decision_handler(self : Ctx[R, E], name : String) -> (
    Execution
    ) -> String raise
    JeeflowError
    ?

    Ctx::id_generator_or_default

    fn[R, E] Ctx::id_generator_or_default(self : Ctx[R, E]) -> (() -> Int64 raise
    JeeflowError
    )

    IIdGenerator:未注入时回退默认雪花(worker 0)

    Ctx::json_provider_or_default

    fn[R, E] Ctx::json_provider_or_default(self : Ctx[R, E]) -> JsonProviderFns

    Ctx::new

    fn[R, E] Ctx::new(repository : R, ext_repository : E) -> Ctx[R, E]

    Ctx::permission_codes

    fn[R, E] Ctx::permission_codes(self : Ctx[R, E], action : String) -> Array[String]

    IActionPermissionProvider:未注入用默认 wf:{action /→:}

    Ctx::register_assignment_handler

    fn[R, E] Ctx::register_assignment_handler(self : Ctx[R, E], name : String, handler : (
    Execution
    ) -> String raise
    JeeflowError
    ) -> Unit

    Ctx::register_decision_handler

    fn[R, E] Ctx::register_decision_handler(self : Ctx[R, E], name : String, handler : (
    Execution
    ) -> String raise
    JeeflowError
    ) -> Unit

    Ctx::register_event_listener

    fn[R, E] Ctx::register_event_listener(self : Ctx[R, E], l : (
    ProcessEvent
    ) -> Unit raise) -> Unit

    Ctx::register_interceptor

    fn[R, E] Ctx::register_interceptor(self : Ctx[R, E], i : InterceptorFn) -> Unit

    Ctx::repository

    fn[R, E] Ctx::repository(self : Ctx[R, E]) -> R

    Ctx::with_action_permission_provider

    fn[R, E] Ctx::with_action_permission_provider(self : Ctx[R, E], f : (String) -> Array[String]) -> Ctx[R, E]

    Ctx::with_biz_data_reader

    fn[R, E] Ctx::with_biz_data_reader(self : Ctx[R, E], f : (String, Int64) -> Map[String, Json]? raise
    JeeflowError
    ) -> Ctx[R, E]

    Ctx::with_expression_evaluator

    fn[R, E] Ctx::with_expression_evaluator(self : Ctx[R, E], f : (String, Map[String, Json]) -> Json raise
    JeeflowError
    ) -> Ctx[R, E]

    Ctx::with_id_generator

    fn[R, E] Ctx::with_id_generator(self : Ctx[R, E], f : () -> Int64 raise
    JeeflowError
    ) -> Ctx[R, E]

    Ctx::with_org_user_provider

    fn[R, E] Ctx::with_org_user_provider(self : Ctx[R, E], p : OrgUserProviderFns) -> Ctx[R, E]

    Ctx::with_user_provider

    fn[R, E] Ctx::with_user_provider(self : Ctx[R, E], p : (String) ->
    UserInfo
    ? raise
    JeeflowError
    ) -> Ctx[R, E]

    Ctx::with_user_search_provider

    fn[R, E] Ctx::with_user_search_provider(self : Ctx[R, E], p : UserSearchProviderFns) -> Ctx[R, E]

    InterceptorFn

    pub(all) struct InterceptorFn {
    order : Int
    run : (
    Execution
    ) -> Unit raise
    JeeflowError

    }

    FlowInterceptor 闭包形态(带 order)

    JsonProviderFns

    pub(all) struct JsonProviderFns {
    to_json : (Json) -> String
    from_json : (String) -> Json raise
    JeeflowError

    is_json : (String) -> Bool
    }

    IJsonProvider 闭包组(spec/05)

    NoExtRepository

    pub(all) struct NoExtRepository {
    }

    引擎不需要扩展仓储时的空实现

    NoExtRepository::new

    OrgUserProviderFns

    pub(all) struct OrgUserProviderFns {
    find_dept_leaders : (String) -> Array[String] raise
    JeeflowError

    find_dept_main_leaders : (String) -> Array[String] raise
    JeeflowError

    find_by_role : (String) -> Array[String] raise
    JeeflowError

    }

    IOrgUserProvider 闭包组(spec/05 v1.6.0)

    UserSearchProviderFns

    IUserSearchProvider 闭包组(spec/06 §4.3/§6)

    default_action_permission_provider

    fn default_action_permission_provider(action : String) -> Array[String]

    IActionPermissionProvider 默认实现:wf:{action /→:}(spec/06 §2.6)

    default_json_provider

    fn default_json_provider() -> JsonProviderFns

    默认 JsonProvider(core stdlib @cjson 承载)