diff --git a/process.js b/process.js index 80d1420..2366b28 100644 --- a/process.js +++ b/process.js @@ -43,7 +43,8 @@ function getProcessPaths(data, workflow) { // console.log("startNodes", startNodes) if (startNodes?.length === 0 || !startNodes) { - invalidPathsWithoutEnding.push({ path: null, data: null, workflow: workflow.id, error: "هیچ پروسسی برای استارت این ورک فلو وجود ندارد" }); + // invalidPathsWithoutEnding.push({ path: null, data: null, workflow: workflow.id, error: "هیچ پروسسی برای استارت این ورک فلو وجود ندارد" }); + invalidPathsWithoutEnding.push("هیچ پروسسی برای استارت این ورک فلو وجود ندارد"); return { allPaths: [], subFlowParentIds: [], @@ -119,11 +120,7 @@ function getProcessPaths(data, workflow) { if (nextNodes?.length === 0) { if (isUniquePath(newPath)) { // allPaths.push({path:newPath.map(n => n.id),data:newMergedData}); - invalidPathsWithoutEnding.push({ - path: newPath.map(n => n.id), - // data: newMergedData, - error: "ورک فلو در این مسیر به پایان نرسید" - }); + invalidPathsWithoutEnding.push(newPath.map(n => n.id).join(",")); } return; } @@ -156,7 +153,7 @@ function getProcessPaths(data, workflow) { // }) // }); - return { allPaths:[...new Set(allPaths)], subFlowParentIds, invalidPathsWithoutEnding }; + return { allPaths, subFlowParentIds, invalidPathsWithoutEnding }; } function getProcessPathsSubFlow(data, subFlowIdTemp, workflow) { @@ -186,7 +183,8 @@ function getProcessPathsSubFlow(data, subFlowIdTemp, workflow) { if (startNodes?.length === 0 || !startNodes) { // return []; - invalidSubPathsWithoutEnding.push({ path: null, data: null, workflow: workflow.id, subworkflow: subFlowIdTemp, error: "هیچ پروسس استارتی برای این ورک فلو وجود ندارد" }); + // invalidSubPathsWithoutEnding.push({ path: null, data: null, workflow: workflow.id, subworkflow: subFlowIdTemp, error: "هیچ پروسس استارتی برای این ورک فلو وجود ندارد" }); + invalidSubPathsWithoutEnding.push("هیچ پروسس استارتی برای این ورک فلو وجود ندارد"); return { subTreePath: [], invalidSubPathsWithoutEnding @@ -263,12 +261,9 @@ function getProcessPathsSubFlow(data, subFlowIdTemp, workflow) { if (isUniquePath(newPath)) { // allPaths.push({path:newPath.map(n => n.id),data:newMergedData}); - invalidSubPathsWithoutEnding.push( - { - path: newPath.map(n => n.id), + invalidSubPathsWithoutEnding.push(newPath.map(n => n.id).join(",") // data: newMergedData, - error: "هیچ پروسس پایانی برای این ورک فلو وجود ندارد" - } + // error: "هیچ پروسس پایانی برای این ورک فلو وجود ندارد" ); } return; @@ -306,7 +301,7 @@ function getProcessPathsSubFlow(data, subFlowIdTemp, workflow) { // }) // }); - return { subTreePath:[...new Set(subTreePath)], invalidSubPathsWithoutEnding }; + return { subTreePath, invalidSubPathsWithoutEnding }; } module.exports = {