Skip to content

Commit 3068a1c

Browse files
committed
2546 - improve check for task dispatcher context calculation
1 parent e6045f4 commit 3068a1c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

client/src/pages/platform/workflow-editor/utils/getTaskDispatcherContext.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ export default function getTaskDispatcherContext({
108108
const isSourceGhost = source.includes('ghost');
109109
const isTargetGhost = target.includes('ghost');
110110

111+
const isSourceNestedBottomGhost = sourceNode?.data.isNestedBottomGhost;
112+
111113
const taskDispatcherId = (sourceNode?.data?.taskDispatcherId || targetNode?.data.taskDispatcherId) as string;
112114

113115
const context: TaskDispatcherContextType = {
@@ -125,15 +127,19 @@ export default function getTaskDispatcherContext({
125127
}
126128

127129
if (isSourceGhost && isTargetTaskDispatcher) {
128-
if (!targetNode.data.conditionData && !targetNode.data.loopDaXta && !targetNode.data.branchData) {
130+
if (!isSourceNestedBottomGhost) {
131+
if (targetNode.data.conditionData || targetNode.data.loopData || targetNode.data.branchData) {
132+
return getContextFromTaskNodeData(targetNode.data as NodeDataType, 0);
133+
}
134+
129135
return undefined;
130136
}
131137

132138
return getContextFromTaskNodeData(targetNode.data as NodeDataType, 0);
133139
}
134140

135-
if (isSourceGhost && isTargetTask) {
136-
return getContextFromTaskNodeData(targetNode.data as NodeDataType);
141+
if (isSourceGhost && !isSourceNestedBottomGhost && isTargetTask) {
142+
return getContextFromTaskNodeData(targetNode.data as NodeDataType, 1);
137143
}
138144

139145
if (isSourceTaskDispatcher && isTargetTask) {

0 commit comments

Comments
 (0)