update index.js and workflow.js

main
MohammadHoseinPaymard 2 weeks ago
parent 3f749131cf
commit 4de1dc6deb
  1. 7
      index.js
  2. 21
      workflow.js

@ -1,5 +1,6 @@
const path = require('path');
const { sleep } = require('./util');
const { getAllWorkflows } = require('./workflow');
require(path.join(process.cwd(),"..","server","dist","database.js"));
@ -7,6 +8,12 @@ require(path.join(process.cwd(),"..","server","dist","database.js"));
await sleep(5e3);
console.time("WorkflowTester")
console.log("initilizing begin..");
const workflows = await getAllWorkflows();
if(workflows.length==0) throw "There is not any workflow";
console.timeEnd("WorkflowTester")

@ -0,0 +1,21 @@
const getAllWorkflows = async (query = {}) => {
const workflows = await bpmsDB.bpms_workflow.findAll({
where: {
// id:workflowId,
deletedAt: {
[Op.is]: null
},
version: {
[Op.gt]: 0
},
...query
},
raw: true
})
return workflows;
}
module.exports = {
getAllWorkflows,
}
Loading…
Cancel
Save