Model typed SA ports and atomic exchange allocation workflows
This commit is contained in:
@@ -453,6 +453,24 @@ fn apply_command(p: &mut Project, c: &Command, depth: usize) -> Result<Option<Id
|
||||
Some(*id)
|
||||
}
|
||||
Command::Connect(kind, name, source, target) => {
|
||||
if *kind == RelationKind::FunctionalExchange {
|
||||
let id = Id::new_v4();
|
||||
let commands = crate::ports::functional_exchange_commands(
|
||||
p,
|
||||
&FunctionalExchangeRequest {
|
||||
id,
|
||||
alias: p.fresh_alias(name, "relation", id),
|
||||
name: name.clone(),
|
||||
description: String::new(),
|
||||
source: *source,
|
||||
target: *target,
|
||||
source_port: PortChoice::Auto,
|
||||
target_port: PortChoice::Auto,
|
||||
items: vec![],
|
||||
},
|
||||
)?;
|
||||
return apply_command(p, &Command::Batch(commands), depth + 1);
|
||||
}
|
||||
Some(p.relate(*kind, name, *source, *target))
|
||||
}
|
||||
Command::Delete(id) => {
|
||||
|
||||
Reference in New Issue
Block a user