From 06caa475463eebc11958b3e538754f53461f8f08 Mon Sep 17 00:00:00 2001 From: ZzIsGod1019 <1498852723@qq.com> Date: Sat, 6 Jan 2024 11:10:18 +0800 Subject: [PATCH] flow: fix bug (#579) * iam: fix bug (res unbind) * iam: modify element code * update * iam: fix bug * flow: fix bug --- middleware/flow/src/serv/flow_inst_serv.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/middleware/flow/src/serv/flow_inst_serv.rs b/middleware/flow/src/serv/flow_inst_serv.rs index 6e51d4921..bdb3d8bf2 100644 --- a/middleware/flow/src/serv/flow_inst_serv.rs +++ b/middleware/flow/src/serv/flow_inst_serv.rs @@ -43,7 +43,7 @@ use crate::{ flow_state_dto::{FlowStateDetailResp, FlowStateFilterReq, FlowStateRelModelExt, FlowSysStateKind}, flow_transition_dto::{ FlowTransitionActionByStateChangeInfo, FlowTransitionActionByVarChangeInfoChangedKind, FlowTransitionActionChangeAgg, FlowTransitionActionChangeInfo, - FlowTransitionActionChangeKind, FlowTransitionDetailResp, FlowTransitionFrontActionInfo, FlowTransitionFrontActionRightValue, StateChangeConditionOp, + FlowTransitionActionChangeKind, FlowTransitionDetailResp, FlowTransitionFrontActionInfo, FlowTransitionFrontActionRightValue, StateChangeConditionOp, TagRelKind, }, }, flow_constants, @@ -951,7 +951,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(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?; } } @@ -962,6 +962,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, @@ -982,8 +983,12 @@ 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 tag = if change_info.obj_tag_rel_kind == Some(TagRelKind::ParentOrSub) { + &flow_model.tag + } else { + &change_info.obj_tag + }; + let resp = FlowExternalServ::do_fetch_rel_obj(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