|
|
|
@ -1,7 +1,7 @@ |
|
|
|
|
const path = require('path'); |
|
|
|
|
const fs = require('fs'); |
|
|
|
|
|
|
|
|
|
const { sleep, saveLargeObject } = require('./util'); |
|
|
|
|
const { sleep, saveLargeObject, createUser, realPayloadGenerator } = require('./util'); |
|
|
|
|
const { getAllWorkflows } = require('./workflow'); |
|
|
|
|
const { getAllProcesses, getProcessPaths, getProcessPathsSubFlow } = require('./process'); |
|
|
|
|
const { initFunctionData } = require('./initFunctionData'); |
|
|
|
@ -13,6 +13,11 @@ require(path.join(process.cwd(), "..", "server", "dist", "database.js")); |
|
|
|
|
console.time("WorkflowTester") |
|
|
|
|
console.log("initilizing begin.."); |
|
|
|
|
|
|
|
|
|
const baseUser = await createUser(); |
|
|
|
|
const baseData = await realPayloadGenerator({}, baseUser); |
|
|
|
|
const basePayload = baseData.payload; |
|
|
|
|
console.log("user information created") |
|
|
|
|
|
|
|
|
|
const workflows = await getAllWorkflows({ |
|
|
|
|
id: { |
|
|
|
|
[Op.gt]: 0 |
|
|
|
@ -142,18 +147,17 @@ require(path.join(process.cwd(), "..", "server", "dist", "database.js")); |
|
|
|
|
|
|
|
|
|
for await (let path of pathCollection) { |
|
|
|
|
const process = await bpmsDB.bpms_process.findByPk(path, { raw: true }); |
|
|
|
|
|
|
|
|
|
console.log(path, process); |
|
|
|
|
if ([0, 1].includes(+process.type)) { |
|
|
|
|
const processData = await initFunctionData({ |
|
|
|
|
processId: process.id, |
|
|
|
|
|
|
|
|
|
payload: basePayload |
|
|
|
|
}) |
|
|
|
|
data = { ...data, ...processData }; |
|
|
|
|
console.log("data",data); |
|
|
|
|
} |
|
|
|
|
console.log(path, process); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|