fix: 버튼 제어관리 노드 플로우 실행 수정

프론트엔드:
- ImprovedButtonControlConfigPanel에서 selectedDiagramId 저장 추가
- 플로우 선택 시 flowConfig와 함께 selectedDiagramId도 저장
- selectedRelationshipId는 null로 설정 (노드 플로우는 관계 불필요)

백엔드:
- dynamicFormService에서 relationshipId 유무에 따라 실행 방식 분기
- relationshipId가 없으면 NodeFlowExecutionService.executeFlow() 실행
- relationshipId가 있으면 기존 dataflowControlService.executeDataflowControl() 실행
- 노드 플로우 실행 시 formData를 contextData로 전달

원인:
- 기존에는 flowConfig만 저장하고 selectedDiagramId를 저장하지 않음
- 백엔드에서 selectedDiagramId가 없어서 제어관리 실행 조건 불만족
- 관계 기반 제어와 노드 플로우를 구분하지 못함
This commit is contained in:
kjs 2025-10-31 17:16:47 +09:00
parent 27d278ca8c
commit 9a674b6686
2 changed files with 43 additions and 8 deletions

View File

@ -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);

View File

@ -63,11 +63,17 @@ export const ImprovedButtonControlConfigPanel: React.FC<ImprovedButtonControlCon
const handleFlowSelect = (flowId: string) => {
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: {},
},
});
}
};