diff --git a/backend-node/src/services/dynamicFormService.ts b/backend-node/src/services/dynamicFormService.ts index 2955633f..e7a9a10f 100644 --- a/backend-node/src/services/dynamicFormService.ts +++ b/backend-node/src/services/dynamicFormService.ts @@ -1389,9 +1389,37 @@ export class DynamicFormService { triggerType, }); - // 제어관리 실행 - const controlResult = - await this.dataflowControlService.executeDataflowControl( + // 노드 플로우 실행 (relationshipId가 없는 경우 노드 플로우로 간주) + let controlResult: any; + + if (!relationshipId) { + // 노드 플로우 실행 + console.log(`🚀 노드 플로우 실행 (flowId: ${diagramId})`); + const { NodeFlowExecutionService } = await import("./nodeFlowExecutionService"); + + const executionResult = await NodeFlowExecutionService.executeFlow(diagramId, { + sourceData: [savedData], + dataSourceType: "formData", + buttonId: "save-button", + screenId: screenId, + userId: userId, + formData: savedData, + }); + + controlResult = { + success: executionResult.success, + message: executionResult.message, + executedActions: executionResult.executedNodes?.map((node: any) => ({ + nodeId: node.nodeId, + status: node.status, + duration: node.duration, + })), + errors: executionResult.errors, + }; + } else { + // 관계 기반 제어관리 실행 + console.log(`🎯 관계 기반 제어관리 실행 (relationshipId: ${relationshipId})`); + controlResult = await this.dataflowControlService.executeDataflowControl( diagramId, relationshipId, triggerType, @@ -1399,6 +1427,7 @@ export class DynamicFormService { tableName, userId ); + } console.log(`🎯 제어관리 실행 결과:`, controlResult); diff --git a/frontend/components/screen/config-panels/ImprovedButtonControlConfigPanel.tsx b/frontend/components/screen/config-panels/ImprovedButtonControlConfigPanel.tsx index 35e1befe..18a51bba 100644 --- a/frontend/components/screen/config-panels/ImprovedButtonControlConfigPanel.tsx +++ b/frontend/components/screen/config-panels/ImprovedButtonControlConfigPanel.tsx @@ -63,11 +63,17 @@ export const ImprovedButtonControlConfigPanel: React.FC { const selectedFlow = flows.find((f) => f.flowId.toString() === flowId); if (selectedFlow) { - onUpdateProperty("webTypeConfig.dataflowConfig.flowConfig", { - flowId: selectedFlow.flowId, - flowName: selectedFlow.flowName, - executionTiming: "before", // 기본값 - contextData: {}, + // 전체 dataflowConfig 업데이트 (selectedDiagramId 포함) + onUpdateProperty("webTypeConfig.dataflowConfig", { + ...dataflowConfig, + selectedDiagramId: selectedFlow.flowId, // 백엔드에서 사용 + selectedRelationshipId: null, // 노드 플로우는 관계 ID 불필요 + flowConfig: { + flowId: selectedFlow.flowId, + flowName: selectedFlow.flowName, + executionTiming: "before", // 기본값 + contextData: {}, + }, }); } };