update index.js and process.js

main
MohammadHoseinPaymard 2 weeks ago
parent a9da28e96c
commit 3fa1c81c4a
  1. 23
      index.js

@ -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"));
@ -72,19 +74,30 @@ require(path.join(process.cwd(), "..", "server", "dist", "database.js"));
if (processesSubFlow.length == 0) {
allWorkFlowInfo[workflow.id].isValid = false;
subFlowInfo[subFlowId] = {
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,
validSubTreePath: subTreePath,
invalidSubTreePath: invalidSubPathsWithoutEnding
}
continue subFlowFor;
}
}
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")

Loading…
Cancel
Save