|
|
@ -60,7 +60,7 @@ function getProcessPaths(data, workflow) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function traverse(currentNode, currentPath, visited, mergedData = []) { |
|
|
|
function traverse(currentNode, currentPath, visited) { |
|
|
|
// if (currentNode.type === 99) { // in bekhatere in ezaf shod ke mikhastim gozaresh ha ro nadide begirim felan
|
|
|
|
// if (currentNode.type === 99) { // in bekhatere in ezaf shod ke mikhastim gozaresh ha ro nadide begirim felan
|
|
|
|
// if(isUniquePath([...currentPath])){
|
|
|
|
// if(isUniquePath([...currentPath])){
|
|
|
|
// // allPaths.push({path:[...currentPath].map(n => n.id),data:mergedData});
|
|
|
|
// // allPaths.push({path:[...currentPath].map(n => n.id),data:mergedData});
|
|
|
@ -83,18 +83,21 @@ function getProcessPaths(data, workflow) { |
|
|
|
newVisited[nodeIdStr] = visitCount + 1; |
|
|
|
newVisited[nodeIdStr] = visitCount + 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const newMergedData = [...mergedData] |
|
|
|
// const newMergedData = [...mergedData]
|
|
|
|
newMergedData.push({ |
|
|
|
// newMergedData.push({
|
|
|
|
processId: currentNode.id.toString(), |
|
|
|
// processId: currentNode.id.toString(),
|
|
|
|
// condition: convertStringToJson(currentNode.conditions)
|
|
|
|
// // condition: convertStringToJson(currentNode.conditions)
|
|
|
|
}); |
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (currentNode.type === 99 || currentNode.type === 100 || currentNode.subFlowPid) { |
|
|
|
if (currentNode.type === 99 || currentNode.type === 100 || currentNode.subFlowPid) { |
|
|
|
if (currentNode.subFlowPid && !subFlowParentIds.includes(currentNode.subFlowPid)) subFlowParentIds.push(currentNode.subFlowPid) |
|
|
|
if (currentNode.subFlowPid && !subFlowParentIds.includes(currentNode.subFlowPid)) subFlowParentIds.push(currentNode.subFlowPid) |
|
|
|
// allPaths.push(newPath.map(n => n.id));
|
|
|
|
// allPaths.push(newPath.map(n => n.id));
|
|
|
|
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
|
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
// console.timeEnd(date);
|
|
|
|
// console.timeEnd(date);
|
|
|
|
return; |
|
|
|
return; |
|
|
@ -119,13 +122,17 @@ 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({ path: newPath.map(n => n.id), data: newMergedData, error: "ورک فلو در این مسیر به پایان نرسید" }); |
|
|
|
invalidPathsWithoutEnding.push({ |
|
|
|
|
|
|
|
path: newPath.map(n => n.id), |
|
|
|
|
|
|
|
// data: newMergedData,
|
|
|
|
|
|
|
|
error: "ورک فلو در این مسیر به پایان نرسید" |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
nextNodes.forEach(nextNode => { |
|
|
|
nextNodes.forEach(nextNode => { |
|
|
|
traverse(nextNode, newPath, newVisited, newMergedData); |
|
|
|
traverse(nextNode, newPath, newVisited); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -197,7 +204,7 @@ function getProcessPathsSubFlow(data, subFlowIdTemp, workflow) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function traverse(currentNode, currentPath, visited, mergedData = []) { |
|
|
|
function traverse(currentNode, currentPath, visited) { |
|
|
|
// if (currentNode.type === 99) { // in bekhatere in ezaf shod ke mikhastim gozaresh ha ro nadide begirim felan
|
|
|
|
// if (currentNode.type === 99) { // in bekhatere in ezaf shod ke mikhastim gozaresh ha ro nadide begirim felan
|
|
|
|
// if(isUniquePath([...currentPath])){
|
|
|
|
// if(isUniquePath([...currentPath])){
|
|
|
|
// // allPaths.push({path:[...currentPath].map(n => n.id),data:mergedData});
|
|
|
|
// // allPaths.push({path:[...currentPath].map(n => n.id),data:mergedData});
|
|
|
@ -220,11 +227,11 @@ function getProcessPathsSubFlow(data, subFlowIdTemp, workflow) { |
|
|
|
newVisited[nodeIdStr] = visitCount + 1; |
|
|
|
newVisited[nodeIdStr] = visitCount + 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const newMergedData = [...mergedData] |
|
|
|
// const newMergedData = [...mergedData]
|
|
|
|
newMergedData.push({ |
|
|
|
// newMergedData.push({
|
|
|
|
processId: currentNode.id.toString(), |
|
|
|
// processId: currentNode.id.toString(),
|
|
|
|
// condition: convertStringToJson(currentNode.conditions)
|
|
|
|
// // condition: convertStringToJson(currentNode.conditions)
|
|
|
|
}); |
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (currentNode.type === 99 || currentNode.type === 100 |
|
|
|
if (currentNode.type === 99 || currentNode.type === 100 |
|
|
@ -277,7 +284,7 @@ function getProcessPathsSubFlow(data, subFlowIdTemp, workflow) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nextNodes.forEach(nextNode => { |
|
|
|
nextNodes.forEach(nextNode => { |
|
|
|
traverse(nextNode, newPath, newVisited, newMergedData); |
|
|
|
traverse(nextNode, newPath, newVisited); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|