@@ -12,6 +12,19 @@ import {Node} from '@xyflow/react';
12
12
import saveWorkflowDefinition from './saveWorkflowDefinition' ;
13
13
import { TASK_DISPATCHER_CONFIG } from './taskDispatcherConfig' ;
14
14
15
+ /**
16
+ * Maps task dispatcher names to their corresponding property names
17
+ * Handles special cases like 'fork-join' -> 'forkJoin'
18
+ */
19
+ function getTaskDispatcherPropertyName ( taskDispatcherName : string ) : string {
20
+ switch ( taskDispatcherName ) {
21
+ case 'fork-join' :
22
+ return 'forkJoin' ;
23
+ default :
24
+ return taskDispatcherName ;
25
+ }
26
+ }
27
+
15
28
interface SaveRootTaskDispatcherProps {
16
29
invalidateWorkflowQueries : ( ) => void ;
17
30
nodes : Node [ ] ;
@@ -107,17 +120,17 @@ function getRecursivelyUpdatedRootTaskDispatcherNodeData(
107
120
108
121
// Look for parent dispatchers of all types
109
122
for ( const taskDispatcherName of TASK_DISPATCHER_NAMES ) {
123
+ const propertyName = getTaskDispatcherPropertyName ( taskDispatcherName ) ;
124
+
110
125
const taskDispatcherData = nodeData [
111
- `${ taskDispatcherName as keyof typeof TASK_DISPATCHER_CONFIG } Data`
126
+ `${ propertyName } Data` as keyof typeof nodeData
112
127
] as TaskDispatcherContextType ;
113
128
114
129
if ( ! taskDispatcherData ) {
115
130
continue ;
116
131
}
117
132
118
- const taskDispatcherId : string = ( taskDispatcherData as TaskDispatcherDataType ) [
119
- `${ taskDispatcherName as keyof typeof TASK_DISPATCHER_CONFIG } Id`
120
- ] ;
133
+ const taskDispatcherId : string = ( taskDispatcherData as unknown as Record < string , string > ) [ `${ propertyName } Id` ] ;
121
134
122
135
const taskDispatcherConfig = TASK_DISPATCHER_CONFIG [ taskDispatcherName as keyof typeof TASK_DISPATCHER_CONFIG ] ;
123
136
0 commit comments