From e768eb65ccbc6159abf9e17c72521ff490beaff9 Mon Sep 17 00:00:00 2001 From: MohammadHoseinPaymard Date: Tue, 27 May 2025 11:03:30 +0330 Subject: [PATCH] update index.js and util.js --- index.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 50765c0..c20219d 100644 --- a/index.js +++ b/index.js @@ -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;