File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed
Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -470,7 +470,15 @@ export const simFoundations: Course = {
470470 type : 'edge_exists' ,
471471 sourceType : 'condition' ,
472472 targetType : 'agent' ,
473- label : 'Connect the Condition to at least one Agent' ,
473+ sourceHandle : 'condition-if' ,
474+ label : 'Connect the Condition true branch (top handle) to an Agent' ,
475+ } ,
476+ {
477+ type : 'edge_exists' ,
478+ sourceType : 'condition' ,
479+ targetType : 'agent' ,
480+ sourceHandle : 'condition-else' ,
481+ label : 'Connect the Condition false branch (bottom handle) to an Agent' ,
474482 } ,
475483 ] ,
476484 hints : [
@@ -683,7 +691,15 @@ export const simFoundations: Course = {
683691 type : 'edge_exists' ,
684692 sourceType : 'condition' ,
685693 targetType : 'agent' ,
686- label : 'Connect the Condition to at least one branch Agent' ,
694+ sourceHandle : 'condition-if' ,
695+ label : 'Connect the Condition true branch to an Agent' ,
696+ } ,
697+ {
698+ type : 'edge_exists' ,
699+ sourceType : 'condition' ,
700+ targetType : 'agent' ,
701+ sourceHandle : 'condition-else' ,
702+ label : 'Connect the Condition false branch to an Agent' ,
687703 } ,
688704 ] ,
689705 hints : [
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ export type ValidationRule = { label?: string } & (
114114 valueNotEmpty ?: boolean
115115 valuePattern ?: string
116116 }
117- | { type : 'edge_exists' ; sourceType : string ; targetType : string }
117+ | { type : 'edge_exists' ; sourceType : string ; targetType : string ; sourceHandle ?: string }
118118 | { type : 'block_count_min' ; count : number }
119119 | { type : 'block_count_max' ; count : number }
120120 | { type : 'custom' ; validatorId : string ; params ?: Record < string , unknown > }
Original file line number Diff line number Diff line change @@ -58,7 +58,9 @@ function checkRule(
5858 return edges . some ( ( e ) => {
5959 const source = blockMap . get ( e . source )
6060 const target = blockMap . get ( e . target )
61- return source ?. type === rule . sourceType && target ?. type === rule . targetType
61+ if ( source ?. type !== rule . sourceType || target ?. type !== rule . targetType ) return false
62+ if ( rule . sourceHandle && e . sourceHandle !== rule . sourceHandle ) return false
63+ return true
6264 } )
6365 }
6466
You can’t perform that action at this time.
0 commit comments