@ -43,7 +43,8 @@ function getProcessPaths(data, workflow) {
// console.log("startNodes", startNodes)
// console.log("startNodes", startNodes)
if ( startNodes ? . length === 0 || ! 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 {
return {
allPaths : [ ] ,
allPaths : [ ] ,
subFlowParentIds : [ ] ,
subFlowParentIds : [ ] ,
@ -119,11 +120,7 @@ function getProcessPaths(data, workflow) {
if ( nextNodes ? . length === 0 ) {
if ( nextNodes ? . length === 0 ) {
if ( isUniquePath ( newPath ) ) {
if ( isUniquePath ( newPath ) ) {
// allPaths.push({path:newPath.map(n => n.id),data:newMergedData});
// allPaths.push({path:newPath.map(n => n.id),data:newMergedData});
invalidPathsWithoutEnding . push ( {
invalidPathsWithoutEnding . push ( newPath . map ( n => n . id ) . join ( "," ) ) ;
path : newPath . map ( n => n . id ) ,
// data: newMergedData,
error : "ورک فلو در این مسیر به پایان نرسید"
} ) ;
}
}
return ;
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 ) {
function getProcessPathsSubFlow ( data , subFlowIdTemp , workflow ) {
@ -186,7 +183,8 @@ function getProcessPathsSubFlow(data, subFlowIdTemp, workflow) {
if ( startNodes ? . length === 0 || ! startNodes ) {
if ( startNodes ? . length === 0 || ! startNodes ) {
// return [];
// 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 {
return {
subTreePath : [ ] ,
subTreePath : [ ] ,
invalidSubPathsWithoutEnding
invalidSubPathsWithoutEnding
@ -263,12 +261,9 @@ function getProcessPathsSubFlow(data, subFlowIdTemp, workflow) {
if ( isUniquePath ( newPath ) ) {
if ( isUniquePath ( newPath ) ) {
// allPaths.push({path:newPath.map(n => n.id),data:newMergedData});
// allPaths.push({path:newPath.map(n => n.id),data:newMergedData});
invalidSubPathsWithoutEnding . push (
invalidSubPathsWithoutEnding . push ( newPath . map ( n => n . id ) . join ( "," )
{
path : newPath . map ( n => n . id ) ,
// data: newMergedData,
// data: newMergedData,
error : "هیچ پروسس پایانی برای این ورک فلو وجود ندارد"
// error: "هیچ پروسس پایانی برای این ورک فلو وجود ندارد"
}
) ;
) ;
}
}
return ;
return ;
@ -306,7 +301,7 @@ function getProcessPathsSubFlow(data, subFlowIdTemp, workflow) {
// })
// })
// });
// });
return { subTreePath : [ ... new Set ( subTreePath ) ] , invalidSubPathsWithoutEnding } ;
return { subTreePath , invalidSubPathsWithoutEnding } ;
}
}
module . exports = {
module . exports = {