Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ideal-world/bios
Browse files Browse the repository at this point in the history
  • Loading branch information
ljl committed Jan 6, 2024
2 parents 8704433 + 06caa47 commit fe1110d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions middleware/flow/src/serv/flow_inst_serv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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?;
}
}
Expand All @@ -962,6 +962,7 @@ impl FlowInstServ {
Ok(())
}
async fn find_inst_ids_by_rel_obj_ids(
flow_model: &FlowModelDetailResp,
rel_bus_obj_ids: Vec<String>,
change_info: &FlowTransitionActionByStateChangeInfo,
funs: &TardisFunsInst,
Expand All @@ -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
Expand Down

0 comments on commit fe1110d

Please sign in to comment.