From 9fa8851162a2e25151cb48cf21cc2f13103c3688 Mon Sep 17 00:00:00 2001 From: ZzIsGod1019 <1498852723@qq.com> Date: Wed, 20 Dec 2023 02:02:02 -0800 Subject: [PATCH 1/3] flow: fix post change error --- middleware/flow/src/serv/flow_inst_serv.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/middleware/flow/src/serv/flow_inst_serv.rs b/middleware/flow/src/serv/flow_inst_serv.rs index 01061e887..0185b2bdd 100644 --- a/middleware/flow/src/serv/flow_inst_serv.rs +++ b/middleware/flow/src/serv/flow_inst_serv.rs @@ -938,7 +938,7 @@ impl FlowInstServ { ) .await?; if !resp.rel_bus_objs.is_empty() { - let inst_ids = Self::find_inst_ids_by_rel_obj_ids(resp.rel_bus_objs.pop().unwrap().rel_bus_obj_ids, &change_info, funs, ctx).await?; + let inst_ids = Self::find_inst_ids_by_rel_obj_ids(¤t_model,resp.rel_bus_objs.pop().unwrap().rel_bus_obj_ids, &change_info, funs, ctx).await?; Self::do_modify_state_by_post_action(inst_ids, &change_info, updated_instance_list, funs, ctx).await?; } } @@ -949,6 +949,7 @@ impl FlowInstServ { Ok(()) } async fn find_inst_ids_by_rel_obj_ids( + flow_model: &FlowModelDetailResp, rel_bus_obj_ids: Vec, change_info: &FlowTransitionActionByStateChangeInfo, funs: &TardisFunsInst, @@ -970,7 +971,7 @@ impl FlowInstServ { } let inst_id = Self::get_inst_ids_by_rel_business_obj_id(vec![rel_obj_id.clone()], funs, ctx).await?.pop().unwrap_or_default(); - let resp = FlowExternalServ::do_fetch_rel_obj(&change_info.obj_tag, &inst_id, rel_obj_id, rel_tags, ctx, funs).await?; + let resp = FlowExternalServ::do_fetch_rel_obj(&flow_model.tag, &inst_id, rel_obj_id, rel_tags, ctx, funs).await?; if !resp.rel_bus_objs.is_empty() { for rel_bus_obj in resp.rel_bus_objs { let condition = change_condition From 2e68ee451d0067db86194b466af42e459a0e2f90 Mon Sep 17 00:00:00 2001 From: ZzIsGod1019 <1498852723@qq.com> Date: Wed, 20 Dec 2023 02:29:00 -0800 Subject: [PATCH 2/3] iam: fix compile error --- support/iam/src/console_system/api/iam_cs_account_api.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/iam/src/console_system/api/iam_cs_account_api.rs b/support/iam/src/console_system/api/iam_cs_account_api.rs index 34c2210e1..f040866b8 100644 --- a/support/iam/src/console_system/api/iam_cs_account_api.rs +++ b/support/iam/src/console_system/api/iam_cs_account_api.rs @@ -69,7 +69,7 @@ impl IamCsAccountApi { /// Get Account By Account Id #[oai(path = "/:id", method = "get")] async fn get(&self, id: Path, tenant_id: Query>, ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { - let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0)?; + let ctx = IamCertServ::try_use_tenant_ctx(ctx.0, tenant_id.0.clone())?; add_remote_ip(request, &ctx).await?; let funs = iam_constants::get_tardis_inst(); let result = IamAccountServ::get_account_detail_aggs( From 6755744e4f4ec225c533a427dd5bc5daeb377fb0 Mon Sep 17 00:00:00 2001 From: ZzIsGod1019 <1498852723@qq.com> Date: Wed, 20 Dec 2023 20:07:40 -0800 Subject: [PATCH 3/3] flow: fix bug --- middleware/flow/src/serv/flow_inst_serv.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/middleware/flow/src/serv/flow_inst_serv.rs b/middleware/flow/src/serv/flow_inst_serv.rs index 0185b2bdd..07433c172 100644 --- a/middleware/flow/src/serv/flow_inst_serv.rs +++ b/middleware/flow/src/serv/flow_inst_serv.rs @@ -938,7 +938,7 @@ impl FlowInstServ { ) .await?; if !resp.rel_bus_objs.is_empty() { - let inst_ids = Self::find_inst_ids_by_rel_obj_ids(¤t_model,resp.rel_bus_objs.pop().unwrap().rel_bus_obj_ids, &change_info, funs, ctx).await?; + let inst_ids = Self::find_inst_ids_by_rel_obj_ids(current_model, resp.rel_bus_objs.pop().unwrap().rel_bus_obj_ids, &change_info, funs, ctx).await?; Self::do_modify_state_by_post_action(inst_ids, &change_info, updated_instance_list, funs, ctx).await?; } } @@ -982,7 +982,7 @@ impl FlowInstServ { let rel_obj_ids = Self::filter_rel_obj_ids_by_state(&rel_bus_obj.rel_bus_obj_ids, &Some(condition.state_id.clone()), funs, ctx).await?; match condition.op { StateChangeConditionOp::And => { - if rel_bus_obj.rel_bus_obj_ids.len() != rel_obj_ids.len() { + if !rel_bus_obj.rel_bus_obj_ids.is_empty() && rel_bus_obj.rel_bus_obj_ids.len() != rel_obj_ids.len() { mismatch_rel_obj_ids.push(rel_obj_id.clone()); continue; }