|  |  |  | @ -1,7 +1,9 @@ | 
			
		
	
		
			
				
					|  |  |  |  | const path = require('path'); | 
			
		
	
		
			
				
					|  |  |  |  | const fs = require('fs'); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | const { sleep } = require('./util'); | 
			
		
	
		
			
				
					|  |  |  |  | const { getAllWorkflows } = require('./workflow'); | 
			
		
	
		
			
				
					|  |  |  |  | const { getAllProcesses, getProcessPaths } = require('./process'); | 
			
		
	
		
			
				
					|  |  |  |  | const { getAllProcesses, getProcessPaths, getProcessPathsSubFlow } = require('./process'); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | require(path.join(process.cwd(), "..", "server", "dist", "database.js")); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -73,18 +75,29 @@ require(path.join(process.cwd(), "..", "server", "dist", "database.js")); | 
			
		
	
		
			
				
					|  |  |  |  |             if (processesSubFlow.length == 0) { | 
			
		
	
		
			
				
					|  |  |  |  |                 allWorkFlowInfo[workflow.id].isValid = false; | 
			
		
	
		
			
				
					|  |  |  |  |                 subFlowInfo[subFlowId] = { | 
			
		
	
		
			
				
					|  |  |  |  |                     valid: subTreePath.length, | 
			
		
	
		
			
				
					|  |  |  |  |                     invalid: invalidSubPathsWithoutEnding.length, | 
			
		
	
		
			
				
					|  |  |  |  |                     validSubTreePath:subTreePath, | 
			
		
	
		
			
				
					|  |  |  |  |                     invalidSubTreePath: invalidSubPathsWithoutEnding | 
			
		
	
		
			
				
					|  |  |  |  |                     valid: 0, | 
			
		
	
		
			
				
					|  |  |  |  |                     invalid: 0, | 
			
		
	
		
			
				
					|  |  |  |  |                     validSubTreePath: [], | 
			
		
	
		
			
				
					|  |  |  |  |                     invalidSubTreePath: [], | 
			
		
	
		
			
				
					|  |  |  |  |                     error: "این ورک فلو ساب آیدی ، هیچ زیرمجموعه ای ندارد" | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |                 continue subFlowFor; | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             const { subTreePath, invalidSubPathsWithoutEnding } = await getProcessPathsSubFlow(processesSubFlow, subFlowId, workflow); | 
			
		
	
		
			
				
					|  |  |  |  |             subFlowInfo[subFlowId] = { | 
			
		
	
		
			
				
					|  |  |  |  |                 valid: subTreePath.length, | 
			
		
	
		
			
				
					|  |  |  |  |                 invalid: invalidSubPathsWithoutEnding.length, | 
			
		
	
		
			
				
					|  |  |  |  |                 validSubTreePath: subTreePath, | 
			
		
	
		
			
				
					|  |  |  |  |                 invalidSubTreePath: invalidSubPathsWithoutEnding | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         allWorkFlowInfo[workflow.id]["subFlow"] = subFlowInfo; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         console.log("allWorkFlowInfo",JSON.stringify(allWorkFlowInfo,null,2)); | 
			
		
	
		
			
				
					|  |  |  |  |         console.log("allWorkFlowInfo", JSON.stringify(allWorkFlowInfo, null, 2)); | 
			
		
	
		
			
				
					|  |  |  |  |         fs.writeFileSync("./result-pretty.json",JSON.stringify(allWorkFlowInfo,null,2)); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     console.timeEnd("WorkflowTester") | 
			
		
	
	
		
			
				
					|  |  |  | 
 |