mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
refactor(plugin-workflow): split executed columns to stats tables (#6534)
* refactor(plugin-workflow): split executed columns to stats table * fix(plugin-workflow): fix client executed * fix(plugin-workflow): fix test case * fix(plugin-workflow): fix migration * chore(plugin-workflow): remove unused file * chore(plugin-workflow): remove stashed code
This commit is contained in:
parent
51a2d17f13
commit
2aa892a716
@ -116,7 +116,7 @@ test.describe('Configuration page to configure the Trigger node', () => {
|
||||
// 3、预期结果:触发次数为1
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
// 4、后置处理:删除工作流
|
||||
@ -223,7 +223,7 @@ test.describe('Configuration page to configure the Trigger node', () => {
|
||||
// 3、预期结果:触发次数为1
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
// 4、后置处理:删除工作流
|
||||
|
@ -71,7 +71,7 @@ test.describe('Configuration page disable enable', () => {
|
||||
// 3、预期结果:触发次数为1
|
||||
let getWorkflow = await apiGetWorkflow(workflowId);
|
||||
let getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
let getWorkflowExecuted = getWorkflowObj.executed;
|
||||
let getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(0);
|
||||
|
||||
await page.goto(`admin/workflow/workflows/${workflowId}`);
|
||||
@ -85,7 +85,7 @@ test.describe('Configuration page disable enable', () => {
|
||||
|
||||
getWorkflow = await apiGetWorkflow(workflowId);
|
||||
getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
getWorkflowExecuted = getWorkflowObj.executed;
|
||||
getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
// 4、后置处理:删除工作流
|
||||
@ -142,7 +142,7 @@ test.describe('Configuration page disable enable', () => {
|
||||
// 3、预期结果:触发次数为1
|
||||
let getWorkflow = await apiGetWorkflow(workflowId);
|
||||
let getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
let getWorkflowExecuted = getWorkflowObj.executed;
|
||||
let getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
await page.goto(`admin/workflow/workflows/${workflowId}`);
|
||||
@ -156,7 +156,7 @@ test.describe('Configuration page disable enable', () => {
|
||||
|
||||
getWorkflow = await apiGetWorkflow(workflowId);
|
||||
getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
getWorkflowExecuted = getWorkflowObj.executed;
|
||||
getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
// 4、后置处理:删除工作流
|
||||
|
@ -114,7 +114,7 @@ test.describe('filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -221,7 +221,7 @@ test.describe('filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -332,7 +332,7 @@ test.describe('filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -448,7 +448,7 @@ test.describe('filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -560,7 +560,7 @@ test.describe('filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -672,7 +672,7 @@ test.describe('filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -780,7 +780,7 @@ test.describe('filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -896,7 +896,7 @@ test.describe('filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -1021,7 +1021,7 @@ test.describe('filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -1134,7 +1134,7 @@ test.describe('filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -107,7 +107,7 @@ test.describe('no filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -207,7 +207,7 @@ test.describe('no filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -310,7 +310,7 @@ test.describe('no filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -415,7 +415,7 @@ test.describe('no filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -519,7 +519,7 @@ test.describe('no filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -623,7 +623,7 @@ test.describe('no filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -724,7 +724,7 @@ test.describe('no filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -830,7 +830,7 @@ test.describe('no filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -938,7 +938,7 @@ test.describe('no filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -1043,7 +1043,7 @@ test.describe('no filter', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -120,7 +120,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -256,7 +256,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -391,7 +391,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -120,7 +120,7 @@ test.describe('action button', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -261,7 +261,7 @@ test.describe('action button', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -402,7 +402,7 @@ test.describe('action button', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -120,7 +120,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -263,7 +263,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -397,7 +397,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -538,7 +538,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -120,7 +120,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -255,7 +255,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -390,7 +390,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -120,7 +120,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -255,7 +255,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -390,7 +390,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -130,7 +130,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -269,7 +269,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -414,7 +414,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -132,7 +132,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -285,7 +285,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -430,7 +430,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -575,7 +575,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -126,7 +126,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -265,7 +265,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -404,7 +404,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -126,7 +126,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -265,7 +265,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -404,7 +404,7 @@ test.describe('field data entry', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -135,7 +135,7 @@ test.describe('field data', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -291,7 +291,7 @@ test.describe('field data', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -164,7 +164,7 @@ test.describe('field data', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -321,7 +321,7 @@ test.describe('field data', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -526,7 +526,7 @@ test.describe('field data', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -104,7 +104,7 @@ test.describe('field data', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -212,7 +212,7 @@ test.describe('field data', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -331,7 +331,7 @@ test.describe('field data', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -171,7 +171,7 @@ test.describe('field data update', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -350,7 +350,7 @@ test.describe('field data update', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -529,7 +529,7 @@ test.describe('field data update', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -709,7 +709,7 @@ test.describe('field data update', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -163,7 +163,7 @@ test.describe('field data update', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -342,7 +342,7 @@ test.describe('field data update', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -527,7 +527,7 @@ test.describe('field data update', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -147,7 +147,7 @@ test.describe('field data update', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -310,7 +310,7 @@ test.describe('field data update', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -473,7 +473,7 @@ test.describe('field data update', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -147,7 +147,7 @@ test.describe('field data update', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -310,7 +310,7 @@ test.describe('field data update', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -473,7 +473,7 @@ test.describe('field data update', () => {
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -111,7 +111,7 @@ test('filter task node', async ({ page, mockPage, mockCollections, mockRecords }
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
@ -225,7 +225,7 @@ test('filter workflow name', async ({ page, mockPage, mockCollections, mockRecor
|
||||
// 3、预期结果:工作流成功触发,待办弹窗表单中显示数据
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const newPage = mockPage();
|
||||
|
@ -48,6 +48,7 @@ import WorkflowPlugin, {
|
||||
useFlowContext,
|
||||
useNodeContext,
|
||||
useTrigger,
|
||||
useWorkflowExecuted,
|
||||
useWorkflowVariableOptions,
|
||||
} from '@nocobase/plugin-workflow/client';
|
||||
import { Registry, lodash } from '@nocobase/utils/client';
|
||||
@ -428,7 +429,7 @@ export function SchemaConfig({ value, onChange }) {
|
||||
const node = useNodeContext();
|
||||
const nodes = useAvailableUpstreams(node);
|
||||
const form = useForm();
|
||||
const { workflow } = useFlowContext();
|
||||
const executed = useWorkflowExecuted();
|
||||
const refreshRef = useRef(() => {});
|
||||
|
||||
const nodeComponents = {};
|
||||
@ -509,7 +510,7 @@ export function SchemaConfig({ value, onChange }) {
|
||||
<SchemaComponentContext.Provider
|
||||
value={{
|
||||
...ctx,
|
||||
designable: !workflow.executed,
|
||||
designable: !executed,
|
||||
refresh,
|
||||
}}
|
||||
>
|
||||
@ -556,7 +557,7 @@ function validateForms(forms: Record<string, any> = {}) {
|
||||
}
|
||||
|
||||
export function SchemaConfigButton(props) {
|
||||
const { workflow } = useFlowContext();
|
||||
const executed = useWorkflowExecuted();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const { values } = useForm();
|
||||
const { t } = usePluginTranslation();
|
||||
@ -580,7 +581,7 @@ export function SchemaConfigButton(props) {
|
||||
return (
|
||||
<>
|
||||
<Button type="primary" onClick={() => setVisible(true)} disabled={false}>
|
||||
{t(workflow.executed ? 'View user interface' : 'Configure user interface')}
|
||||
{t(executed ? 'View user interface' : 'Configure user interface')}
|
||||
</Button>
|
||||
<ActionContextProvider value={{ visible, setVisible: onSetVisible, formValueChanged: false }}>
|
||||
{props.children}
|
||||
|
@ -21,10 +21,105 @@ import {
|
||||
useGetAriaLabelOfAddButton,
|
||||
RadioWithTooltip,
|
||||
Instruction,
|
||||
useWorkflowExecuted,
|
||||
} from '@nocobase/plugin-workflow/client';
|
||||
|
||||
import { NAMESPACE, useLang } from '../locale';
|
||||
|
||||
function NodeComponent({ data }) {
|
||||
const { styles } = useStyles();
|
||||
const {
|
||||
id,
|
||||
config: { mode },
|
||||
} = data;
|
||||
const { nodes } = useFlowContext();
|
||||
const executed = useWorkflowExecuted();
|
||||
const branches = nodes
|
||||
.reduce((result, node) => {
|
||||
if (node.upstreamId === id && node.branchIndex != null) {
|
||||
return result.concat(node);
|
||||
}
|
||||
return result;
|
||||
}, [])
|
||||
.sort((a, b) => a.branchIndex - b.branchIndex);
|
||||
const [branchCount, setBranchCount] = useState(Math.max(2, branches.length));
|
||||
const { getAriaLabel } = useGetAriaLabelOfAddButton(data);
|
||||
const langAddBranch = useLang('Add branch');
|
||||
|
||||
const tempBranches = Array(Math.max(0, branchCount - branches.length)).fill(null);
|
||||
const lastBranchHead = branches[branches.length - 1];
|
||||
|
||||
return (
|
||||
<NodeDefaultView data={data}>
|
||||
<div className={styles.nodeSubtreeClass}>
|
||||
<div className={styles.branchBlockClass}>
|
||||
{branches.map((branch) => (
|
||||
<Branch key={branch.id} from={data} entry={branch} branchIndex={branch.branchIndex} />
|
||||
))}
|
||||
{tempBranches.map((_, i) => (
|
||||
<Branch
|
||||
key={`temp_${branches.length + i}`}
|
||||
from={data}
|
||||
branchIndex={(lastBranchHead ? lastBranchHead.branchIndex : 0) + i + 1}
|
||||
controller={
|
||||
branches.length + i > 1 ? (
|
||||
<div
|
||||
className={css`
|
||||
padding-top: 2em;
|
||||
|
||||
> button {
|
||||
line-height: 1;
|
||||
|
||||
.anticon {
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
}
|
||||
`}
|
||||
>
|
||||
<Button
|
||||
shape="circle"
|
||||
icon={<PlusOutlined />}
|
||||
onClick={() => setBranchCount(branchCount - 1)}
|
||||
disabled={executed}
|
||||
size="small"
|
||||
/>
|
||||
</div>
|
||||
) : null
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
<Tooltip
|
||||
title={langAddBranch}
|
||||
className={css`
|
||||
visibility: ${executed ? 'hidden' : 'visible'};
|
||||
`}
|
||||
>
|
||||
<Button
|
||||
aria-label={getAriaLabel('add-branch')}
|
||||
icon={<PlusOutlined />}
|
||||
className={css`
|
||||
position: relative;
|
||||
top: 1em;
|
||||
line-height: 1;
|
||||
transform-origin: center;
|
||||
transform: rotate(45deg);
|
||||
|
||||
.anticon {
|
||||
transform-origin: center;
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
`}
|
||||
size="small"
|
||||
onClick={() => setBranchCount(branchCount + 1)}
|
||||
disabled={executed}
|
||||
/>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</NodeDefaultView>
|
||||
);
|
||||
}
|
||||
|
||||
export default class extends Instruction {
|
||||
title = `{{t("Parallel branch", { ns: "${NAMESPACE}" })}}`;
|
||||
type = 'parallel';
|
||||
@ -63,101 +158,5 @@ export default class extends Instruction {
|
||||
components = {
|
||||
RadioWithTooltip,
|
||||
};
|
||||
Component({ data }) {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
const { styles } = useStyles();
|
||||
const {
|
||||
id,
|
||||
config: { mode },
|
||||
} = data;
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
const { workflow, nodes } = useFlowContext();
|
||||
const branches = nodes
|
||||
.reduce((result, node) => {
|
||||
if (node.upstreamId === id && node.branchIndex != null) {
|
||||
return result.concat(node);
|
||||
}
|
||||
return result;
|
||||
}, [])
|
||||
.sort((a, b) => a.branchIndex - b.branchIndex);
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
const [branchCount, setBranchCount] = useState(Math.max(2, branches.length));
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
const { getAriaLabel } = useGetAriaLabelOfAddButton(data);
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
const langAddBranch = useLang('Add branch');
|
||||
|
||||
const tempBranches = Array(Math.max(0, branchCount - branches.length)).fill(null);
|
||||
const lastBranchHead = branches[branches.length - 1];
|
||||
|
||||
return (
|
||||
<NodeDefaultView data={data}>
|
||||
<div className={styles.nodeSubtreeClass}>
|
||||
<div className={styles.branchBlockClass}>
|
||||
{branches.map((branch) => (
|
||||
<Branch key={branch.id} from={data} entry={branch} branchIndex={branch.branchIndex} />
|
||||
))}
|
||||
{tempBranches.map((_, i) => (
|
||||
<Branch
|
||||
key={`temp_${branches.length + i}`}
|
||||
from={data}
|
||||
branchIndex={(lastBranchHead ? lastBranchHead.branchIndex : 0) + i + 1}
|
||||
controller={
|
||||
branches.length + i > 1 ? (
|
||||
<div
|
||||
className={css`
|
||||
padding-top: 2em;
|
||||
|
||||
> button {
|
||||
line-height: 1;
|
||||
|
||||
.anticon {
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
}
|
||||
`}
|
||||
>
|
||||
<Button
|
||||
shape="circle"
|
||||
icon={<PlusOutlined />}
|
||||
onClick={() => setBranchCount(branchCount - 1)}
|
||||
disabled={workflow.executed}
|
||||
size="small"
|
||||
/>
|
||||
</div>
|
||||
) : null
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
<Tooltip
|
||||
title={langAddBranch}
|
||||
className={css`
|
||||
visibility: ${workflow.executed ? 'hidden' : 'visible'};
|
||||
`}
|
||||
>
|
||||
<Button
|
||||
aria-label={getAriaLabel('add-branch')}
|
||||
icon={<PlusOutlined />}
|
||||
className={css`
|
||||
position: relative;
|
||||
top: 1em;
|
||||
line-height: 1;
|
||||
transform-origin: center;
|
||||
transform: rotate(45deg);
|
||||
|
||||
.anticon {
|
||||
transform-origin: center;
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
`}
|
||||
size="small"
|
||||
onClick={() => setBranchCount(branchCount + 1)}
|
||||
disabled={workflow.executed}
|
||||
/>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</NodeDefaultView>
|
||||
);
|
||||
}
|
||||
Component = NodeComponent;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ test.describe('All succeeded', () => {
|
||||
// 3、预期结果:工作流成功触发,判断节点全部通过,后置计算节点执行成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
@ -274,7 +274,7 @@ test.describe('All succeeded', () => {
|
||||
// 3、预期结果:工作流成功触发,判断节点全部通过,后置计算节点执行成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
@ -411,7 +411,7 @@ test.describe('All succeeded', () => {
|
||||
// 3、预期结果:工作流成功触发,判断节点全部通过,后置计算节点执行成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
@ -547,7 +547,7 @@ test.describe('All succeeded', () => {
|
||||
// 3、预期结果:工作流成功触发,判断节点全部通过,后置计算节点执行成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
|
@ -139,7 +139,7 @@ test.describe('Any succeeded', () => {
|
||||
// 3、预期结果:工作流成功触发,判断节点全部通过,后置计算节点执行成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
@ -278,7 +278,7 @@ test.describe('Any succeeded', () => {
|
||||
// 3、预期结果:工作流成功触发,判断节点全部通过,后置计算节点执行成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
@ -418,7 +418,7 @@ test.describe('Any succeeded', () => {
|
||||
// 3、预期结果:工作流成功触发,判断节点全部通过,后置计算节点执行成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
|
@ -125,7 +125,7 @@ test.describe('Any succeeded or failed', () => {
|
||||
// 3、预期结果:工作流成功触发,判断节点全部通过,后置计算节点执行成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
@ -248,7 +248,7 @@ test.describe('Any succeeded or failed', () => {
|
||||
// 3、预期结果:工作流成功触发,判断节点全部通过,后置计算节点执行成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
|
@ -109,7 +109,7 @@ test.describe('select data', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -205,7 +205,7 @@ test.describe('select data', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -307,7 +307,7 @@ test.describe('select data', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -409,7 +409,7 @@ test.describe('select data', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -514,7 +514,7 @@ test.describe('select data', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -619,7 +619,7 @@ test.describe('select data', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -703,7 +703,7 @@ test.describe('insert data', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -791,7 +791,7 @@ test.describe('insert data', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -893,7 +893,7 @@ test.describe('insert data', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -991,7 +991,7 @@ test.describe('update data', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -1097,7 +1097,7 @@ test.describe('update data', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -1196,7 +1196,7 @@ test.describe('delete data', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -1302,7 +1302,7 @@ test.describe('delete data', () => {
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -152,9 +152,12 @@ export const apiGetWorkflow = async (id: number) => {
|
||||
const state = await api.storageState();
|
||||
const headers = getHeaders(state);
|
||||
|
||||
const result = await api.get(`/api/workflows:get?filterByTk=${id}`, {
|
||||
headers,
|
||||
});
|
||||
const result = await api.get(
|
||||
`/api/workflows:get?filterByTk=${id}&appends[]=stats.executed&appends[]=versionStats.executed`,
|
||||
{
|
||||
headers,
|
||||
},
|
||||
);
|
||||
|
||||
if (!result.ok()) {
|
||||
throw new Error(await result.text());
|
||||
@ -172,10 +175,16 @@ export const apiGetWorkflow = async (id: number) => {
|
||||
"type": "collection",
|
||||
"config": { },
|
||||
"useTransaction": true,
|
||||
"executed": 0,
|
||||
"allExecuted": 0,
|
||||
// "executed": 0,
|
||||
// "allExecuted": 0,
|
||||
"current": true,
|
||||
"options": { }
|
||||
"versionStats": {
|
||||
"executed": 0,
|
||||
},
|
||||
"stats": {
|
||||
"executed": 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
@ -23,7 +23,7 @@ import {
|
||||
usePlugin,
|
||||
} from '@nocobase/client';
|
||||
|
||||
import WorkflowPlugin, { Instruction, useStyles } from '.';
|
||||
import WorkflowPlugin, { Instruction, useStyles, useWorkflowExecuted } from '.';
|
||||
import { useFlowContext } from './FlowContext';
|
||||
import { lang, NAMESPACE } from './locale';
|
||||
import { RadioWithTooltip } from './components';
|
||||
@ -47,6 +47,7 @@ export function AddButton(props: AddButtonProps) {
|
||||
const { styles } = useStyles();
|
||||
const { onCreate, creating } = useAddNodeContext();
|
||||
const groupOptions = engine.useInstructionGroupOptions();
|
||||
const executed = useWorkflowExecuted();
|
||||
|
||||
const groups = useMemo(() => {
|
||||
return groupOptions
|
||||
@ -91,7 +92,7 @@ export function AddButton(props: AddButtonProps) {
|
||||
items: groups,
|
||||
onClick,
|
||||
}}
|
||||
disabled={workflow.executed}
|
||||
disabled={executed}
|
||||
overlayClassName={css`
|
||||
.ant-dropdown-menu-root {
|
||||
max-height: 30em;
|
||||
|
@ -14,15 +14,15 @@ import { ErrorBoundary } from 'react-error-boundary';
|
||||
import { cx, css, ErrorFallback } from '@nocobase/client';
|
||||
|
||||
import { Branch } from './Branch';
|
||||
import { useFlowContext } from './FlowContext';
|
||||
import { lang } from './locale';
|
||||
import useStyles from './style';
|
||||
import { TriggerConfig } from './triggers';
|
||||
import { AddNodeContextProvider } from './AddNodeContext';
|
||||
import { useWorkflowExecuted } from './hooks';
|
||||
|
||||
export function CanvasContent({ entry }) {
|
||||
const { styles } = useStyles();
|
||||
const { workflow } = useFlowContext();
|
||||
const executed = useWorkflowExecuted();
|
||||
const [zoom, setZoom] = React.useState(100);
|
||||
|
||||
return (
|
||||
@ -39,7 +39,7 @@ export function CanvasContent({ entry }) {
|
||||
)}
|
||||
>
|
||||
<div className={styles.branchClass}>
|
||||
{workflow?.executed ? (
|
||||
{executed ? (
|
||||
<Alert
|
||||
type="warning"
|
||||
message={lang('Executed workflow cannot be modified. Could be copied to a new version to modify.')}
|
||||
|
@ -37,7 +37,7 @@ export const ExecutionPage = () => {
|
||||
action: 'get',
|
||||
params: {
|
||||
filter: params,
|
||||
appends: ['jobs', 'workflow', 'workflow.nodes'],
|
||||
appends: ['jobs', 'workflow', 'workflow.nodes', 'workflow.versionStats', 'workflow.stats'],
|
||||
except: ['jobs.result', 'workflow.options'],
|
||||
},
|
||||
},
|
||||
|
@ -7,7 +7,7 @@
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
import { Alert, App, Breadcrumb, Button, Dropdown, Result, Spin, Switch, Tag, Tooltip } from 'antd';
|
||||
@ -28,11 +28,9 @@ import {
|
||||
useResourceContext,
|
||||
useCompile,
|
||||
css,
|
||||
usePlugin,
|
||||
} from '@nocobase/client';
|
||||
import { dayjs } from '@nocobase/utils/client';
|
||||
|
||||
import PluginWorkflowClient from '.';
|
||||
import { CanvasContent } from './CanvasContent';
|
||||
import { ExecutionStatusColumn } from './components/ExecutionStatus';
|
||||
import { ExecutionLink } from './ExecutionLink';
|
||||
@ -44,8 +42,9 @@ import { linkNodes, getWorkflowDetailPath } from './utils';
|
||||
import { Fieldset } from './components/Fieldset';
|
||||
import { useRefreshActionProps } from './hooks/useRefreshActionProps';
|
||||
import { useTrigger } from './triggers';
|
||||
import { ExecutionStatusOptionsMap } from './constants';
|
||||
import { ExecutionStatusOptions, ExecutionStatusOptionsMap } from './constants';
|
||||
import { HideVariableContext } from './variable';
|
||||
import { useWorkflowAnyExecuted, useWorkflowExecuted } from './hooks';
|
||||
|
||||
function ExecutionResourceProvider({ request, filter = {}, ...others }) {
|
||||
const { workflow } = useFlowContext();
|
||||
@ -96,6 +95,7 @@ function useExecuteConfirmAction() {
|
||||
const ctx = useActionContext();
|
||||
const navigate = useNavigateNoUpdate();
|
||||
const { message: messageApi } = App.useApp();
|
||||
const executed = useWorkflowExecuted();
|
||||
return {
|
||||
async run() {
|
||||
const { autoRevision, ...values } = form.values;
|
||||
@ -107,7 +107,7 @@ function useExecuteConfirmAction() {
|
||||
} = await resource.execute({
|
||||
filterByTk: workflow.id,
|
||||
values,
|
||||
...(!workflow.executed && autoRevision ? { autoRevision: 1 } : {}),
|
||||
...(!executed && autoRevision ? { autoRevision: 1 } : {}),
|
||||
});
|
||||
form.reset();
|
||||
ctx.setFormValueChanged(false);
|
||||
@ -142,6 +142,7 @@ function ActionDisabledProvider({ children }) {
|
||||
|
||||
function ExecuteActionButton() {
|
||||
const { workflow } = useFlowContext();
|
||||
const executed = useWorkflowExecuted();
|
||||
const trigger = useTrigger();
|
||||
|
||||
return (
|
||||
@ -202,7 +203,7 @@ function ExecuteActionButton() {
|
||||
title: `{{t('Trigger variables', { ns: "${NAMESPACE}" })}}`,
|
||||
properties: trigger.triggerFieldset,
|
||||
},
|
||||
...(workflow.executed
|
||||
...(executed
|
||||
? {}
|
||||
: {
|
||||
autoRevision: {
|
||||
@ -255,6 +256,8 @@ function WorkflowMenu() {
|
||||
const app = useApp();
|
||||
const { resource } = useResourceContext();
|
||||
const { message } = App.useApp();
|
||||
const executed = useWorkflowExecuted();
|
||||
const allExecuted = useWorkflowAnyExecuted();
|
||||
|
||||
const onRevision = useCallback(async () => {
|
||||
const {
|
||||
@ -310,8 +313,8 @@ function WorkflowMenu() {
|
||||
);
|
||||
|
||||
const revisionable =
|
||||
workflow.executed &&
|
||||
!revisions.find((item) => !item.executed && new Date(item.createdAt) > new Date(workflow.createdAt));
|
||||
executed &&
|
||||
!revisions.find((item) => !item.versionStats.executed && new Date(item.createdAt) > new Date(workflow.createdAt));
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -331,7 +334,7 @@ function WorkflowMenu() {
|
||||
'aria-label': 'history',
|
||||
key: 'history',
|
||||
label: lang('Execution history'),
|
||||
disabled: !workflow.allExecuted,
|
||||
disabled: !allExecuted,
|
||||
},
|
||||
{
|
||||
role: 'button',
|
||||
@ -360,6 +363,7 @@ function WorkflowMenu() {
|
||||
}}
|
||||
scope={{
|
||||
useRefreshActionProps,
|
||||
ExecutionStatusOptions,
|
||||
}}
|
||||
/>
|
||||
</ActionContextProvider>
|
||||
@ -374,7 +378,6 @@ export function WorkflowCanvas() {
|
||||
const { resource } = useResourceContext();
|
||||
const { setTitle } = useDocumentTitle();
|
||||
const { styles } = useStyles();
|
||||
const workflowPlugin = usePlugin(PluginWorkflowClient);
|
||||
|
||||
const { nodes = [], revisions = [], ...workflow } = data?.data ?? {};
|
||||
linkNodes(nodes);
|
||||
@ -463,8 +466,8 @@ export function WorkflowCanvas() {
|
||||
key: `${item.id}`,
|
||||
icon: item.current ? <RightOutlined /> : null,
|
||||
className: cx({
|
||||
executed: item.executed,
|
||||
unexecuted: !item.executed,
|
||||
executed: item.versionStats.executed,
|
||||
unexecuted: !item.versionStats.executed,
|
||||
enabled: item.enabled,
|
||||
}),
|
||||
label: (
|
||||
|
@ -42,8 +42,11 @@ export const WorkflowPage = () => {
|
||||
'revisions.id',
|
||||
'revisions.createdAt',
|
||||
'revisions.current',
|
||||
'revisions.executed',
|
||||
'revisions.stats.executed',
|
||||
'revisions.versionStats.executed',
|
||||
'revisions.enabled',
|
||||
'stats.executed',
|
||||
'versionStats.executed',
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -17,6 +17,7 @@ import {
|
||||
SchemaComponentContext,
|
||||
useActionContext,
|
||||
useApp,
|
||||
useCollectionRecordData,
|
||||
usePlugin,
|
||||
useRecord,
|
||||
useResourceActionContext,
|
||||
@ -29,9 +30,10 @@ import { WorkflowLink } from './WorkflowLink';
|
||||
import OpenDrawer from './components/OpenDrawer';
|
||||
import { workflowSchema } from './schemas/workflows';
|
||||
import { ExecutionStatusSelect, ExecutionStatusColumn } from './components/ExecutionStatus';
|
||||
import WorkflowPlugin, { RadioWithTooltip } from '.';
|
||||
import WorkflowPlugin, { ExecutionStatusOptions, RadioWithTooltip } from '.';
|
||||
import { useRefreshActionProps } from './hooks/useRefreshActionProps';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { TriggerOptionRender } from './components/TriggerOptionRender';
|
||||
|
||||
function SyncOptionSelect(props) {
|
||||
const field = useField<any>();
|
||||
@ -117,6 +119,14 @@ function useRevisionAction() {
|
||||
};
|
||||
}
|
||||
|
||||
function ExecutedLink(props) {
|
||||
const record = useCollectionRecordData();
|
||||
return React.createElement('a', {
|
||||
'aria-label': `executed-${record.title}`,
|
||||
...props,
|
||||
});
|
||||
}
|
||||
|
||||
export function WorkflowPane() {
|
||||
const ctx = useContext(SchemaComponentContext);
|
||||
const { useTriggersOptions } = usePlugin(WorkflowPlugin);
|
||||
@ -141,6 +151,9 @@ export function WorkflowPane() {
|
||||
useSyncAction,
|
||||
useRefreshActionProps,
|
||||
useRevisionAction,
|
||||
TriggerOptionRender,
|
||||
ExecutedLink,
|
||||
ExecutionStatusOptions,
|
||||
}}
|
||||
/>
|
||||
</SchemaComponentContext.Provider>
|
||||
|
@ -100,7 +100,7 @@ test.describe('Configuration Page Path Jump Workflow Management Page', () => {
|
||||
await page.waitForTimeout(60000);
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
await page.goto(`admin/workflow/workflows/${workflowId}`);
|
||||
await page.waitForLoadState('load');
|
||||
|
@ -67,7 +67,7 @@ test.describe('Configuration page to configure the Trigger node', () => {
|
||||
// 3、预期结果:工作流成功触发
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
// 4、后置处理:删除工作流
|
||||
|
@ -92,7 +92,7 @@ test('Collection event add data trigger, get trigger node single line text varia
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -184,7 +184,7 @@ test('Collection event add data triggers, get predecessor Formula engine arithme
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -287,7 +287,7 @@ test('Collection events add data triggers, get single line of text data for fron
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -392,7 +392,7 @@ test('Collection event add data trigger, get front added data node single line t
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -488,7 +488,7 @@ test('Collection event adds data triggers, fetches data from front-end aggregati
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -755,7 +755,7 @@ test.skip('Collection event add data trigger, get front manual node add form sin
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -91,7 +91,7 @@ test('Collection event add data trigger, get trigger node single line text varia
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -182,7 +182,7 @@ test('Collection event add data triggers, get predecessor Math engine arithmetic
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -284,7 +284,7 @@ test('Collection events add data triggers, get single line of text data for fron
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -388,7 +388,7 @@ test('Collection event add data trigger, get front added data node single line t
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -483,7 +483,7 @@ test('Collection event adds data triggers, fetches data from front-end aggregati
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -749,7 +749,7 @@ test.skip('Collection event add data trigger, get front manual node add form sin
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -69,7 +69,7 @@ test.describe('Configuration page to configure the Trigger node', () => {
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
// 4、后置处理:删除工作流
|
||||
@ -126,7 +126,7 @@ test.describe('Configuration page to configure the Trigger node', () => {
|
||||
// 3、预期结果:工作流成功触发
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
// 4、后置处理:删除工作流
|
||||
@ -184,7 +184,7 @@ test.describe('Configuration page to configure the Trigger node', () => {
|
||||
// 3、预期结果:工作流成功触发
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(2);
|
||||
|
||||
// 4、后置处理:删除工作流
|
||||
@ -252,7 +252,7 @@ test.describe('Configuration page to configure the Trigger node', () => {
|
||||
// 3、预期结果:工作流成功触发
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
// 4、后置处理:删除工作流
|
||||
@ -322,7 +322,7 @@ test.describe('Configuration page to configure the Trigger node', () => {
|
||||
// 3、预期结果:工作流成功触发
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
// 4、后置处理:删除工作流
|
||||
|
@ -64,7 +64,7 @@ test.describe('Configuration page disable enable', () => {
|
||||
// 3、预期结果:触发次数为1
|
||||
let getWorkflow = await apiGetWorkflow(workflowId);
|
||||
let getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
let getWorkflowExecuted = getWorkflowObj.executed;
|
||||
let getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
await page.goto(`admin/workflow/workflows/${workflowId}`);
|
||||
@ -75,7 +75,7 @@ test.describe('Configuration page disable enable', () => {
|
||||
|
||||
getWorkflow = await apiGetWorkflow(workflowId);
|
||||
getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
getWorkflowExecuted = getWorkflowObj.executed;
|
||||
getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
// 4、后置处理:删除工作流
|
||||
@ -127,7 +127,7 @@ test.describe('Configuration page disable enable', () => {
|
||||
// 3、预期结果:触发次数为1
|
||||
let getWorkflow = await apiGetWorkflow(workflowId);
|
||||
let getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
let getWorkflowExecuted = getWorkflowObj.executed;
|
||||
let getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(0);
|
||||
|
||||
await page.goto(`admin/workflow/workflows/${workflowId}`);
|
||||
@ -138,7 +138,7 @@ test.describe('Configuration page disable enable', () => {
|
||||
|
||||
getWorkflow = await apiGetWorkflow(workflowId);
|
||||
getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
getWorkflowExecuted = getWorkflowObj.executed;
|
||||
getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
|
||||
// 4、后置处理:删除工作流
|
||||
|
@ -152,7 +152,7 @@ test('Collection event add data trigger, determine trigger node integer variable
|
||||
// 3、预期结果:工作流成功触发,判断节点true
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -298,7 +298,7 @@ test('Collection event add data trigger, determine trigger node integer variable
|
||||
// 3、预期结果:工作流成功触发,判断节点false
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -445,7 +445,7 @@ test('Collection event add data trigger, determine trigger node integer variable
|
||||
// 3、预期结果:工作流成功触发,判断节点false
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -592,7 +592,7 @@ test('Collection event add data trigger, determine trigger node integer variable
|
||||
// 3、预期结果:工作流成功触发,判断节点true
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -119,7 +119,7 @@ test('Collection event add data trigger, determines that the trigger node single
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -233,7 +233,7 @@ test('Collection event add data trigger, determines that the trigger node single
|
||||
// 3、预期结果:工作流成功触发,判断节点false
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -349,7 +349,7 @@ test('Collection event Add Data Trigger, determines that the trigger node single
|
||||
// 3、预期结果:工作流成功触发,判断节点false
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -465,7 +465,7 @@ test('Collection event add data trigger, determines that the trigger node single
|
||||
// 3、预期结果:工作流成功触发,判断节点true
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -135,7 +135,7 @@ test('Collection event Add Data Trigger, determines that the trigger node single
|
||||
// 3、预期结果:工作流成功触发,判断节点true
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -260,7 +260,7 @@ test('Collection event Add Data Trigger, determines that the trigger node single
|
||||
// 3、预期结果:工作流成功触发,判断节点false
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -388,7 +388,7 @@ test('Collection event Add Data Trigger, determines that the trigger node single
|
||||
// 3、预期结果:工作流成功触发,判断节点false
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -513,7 +513,7 @@ test('Collection event Add Data Trigger, determines that the trigger node single
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -665,7 +665,7 @@ test('Collection event add data trigger, determine the trigger node integer vari
|
||||
// 3、预期结果:工作流成功触发,判断节点true
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -821,7 +821,7 @@ test('Collection event add data trigger, determine trigger node integer variable
|
||||
// 3、预期结果:工作流成功触发,判断节点false
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -970,7 +970,7 @@ test('Collection event add data trigger, determine trigger node integer variable
|
||||
// 3、预期结果:工作流成功触发,判断节点false
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -1119,7 +1119,7 @@ test('Collection event add data trigger, determine the trigger node integer vari
|
||||
// 3、预期结果:工作流成功触发,判断节点true
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -129,7 +129,7 @@ test('Collection event add data trigger, determine trigger node integer field va
|
||||
// 3、预期结果:工作流成功触发,判断节点true
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -251,7 +251,7 @@ test('Collection event Add Data Trigger, determines that the trigger node intege
|
||||
// 3、预期结果:工作流成功触发,判断节点false
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -373,7 +373,7 @@ test('Collection event Add Data Trigger, determines that the trigger node intege
|
||||
// 3、预期结果:工作流成功触发,判断节点false
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -498,7 +498,7 @@ test('Collection event add data trigger, determines that the trigger node intege
|
||||
// 3、预期结果:工作流成功触发,判断节点true
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -95,7 +95,7 @@ test('Collection event add data trigger, determines that the trigger node single
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -179,7 +179,7 @@ test('Collection event add data trigger, determines that the trigger node single
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -265,7 +265,7 @@ test('Collection event Add Data Trigger, determines that the trigger node single
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -351,7 +351,7 @@ test('Collection event add data trigger, determines that the trigger node single
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -464,7 +464,7 @@ test('Collection event add data trigger, determine trigger node integer variable
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -577,7 +577,7 @@ test('Collection event add data trigger, determine trigger node integer variable
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -692,7 +692,7 @@ test('Collection event add data trigger, determine trigger node integer variable
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -806,7 +806,7 @@ test('Collection event add data trigger, determine trigger node integer variable
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -896,7 +896,7 @@ test('create non-branching condition node before first node, the original first
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -102,7 +102,7 @@ test('Collection event Add Data Trigger, Formula engine, determines that the tri
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -195,7 +195,7 @@ test('Collection event Add Data Trigger, Formula engine, determines that the tri
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -282,7 +282,7 @@ test('Collection event Add Data Trigger, Formula engine, determines that the tri
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -372,7 +372,7 @@ test('Collection event Add Data Trigger, Formula engine, determines that the tri
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -489,7 +489,7 @@ test('Collection event add data trigger, Formula engine, determine the trigger n
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -607,7 +607,7 @@ test('Collection event add data trigger, Formula engine, determine trigger node
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -723,7 +723,7 @@ test('Collection event add data trigger, Formula engine, determine trigger node
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -841,7 +841,7 @@ test('Collection event add data trigger, Formula engine, determine the trigger n
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -100,7 +100,7 @@ test('Collection event add data trigger, Math engine, determine trigger node int
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -191,7 +191,7 @@ test('Collection event Add Data Trigger, Math engine, determines that the trigge
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -281,7 +281,7 @@ test('Collection event Add Data Trigger, Math engine, determines that the trigge
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -372,7 +372,7 @@ test('Collection event add data trigger, Math engine, determines that the trigge
|
||||
// 3、预期结果:工作流成功触发,判断节点true通过
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -107,7 +107,7 @@ test('Collection event add data trigger, single row text fields for common table
|
||||
// 3、预期结果:工作流成功触发,数据表成功新增记录
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -219,7 +219,7 @@ test('Collection event add data trigger, normal table single line text field, se
|
||||
// 3、预期结果:工作流成功触发,数据表成功新增记录
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -322,7 +322,7 @@ test('Collection event add data trigger, normal table integer field, set constan
|
||||
// 3、预期结果:工作流成功触发,数据表成功新增记录
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -434,7 +434,7 @@ test('Collection event add data trigger, normal table integer field, set trigger
|
||||
// 3、预期结果:工作流成功触发,数据表成功新增记录
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -537,7 +537,7 @@ test('Collection event add data trigger, normal table numeric field, set constan
|
||||
// 3、预期结果:工作流成功触发,数据表成功新增记录
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -649,7 +649,7 @@ test('Collection event add data trigger, normal table numeric field, set trigger
|
||||
// 3、预期结果:工作流成功触发,数据表成功新增记录
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -752,7 +752,7 @@ test('Collection event add data trigger, normal table dropdown radio field, set
|
||||
// 3、预期结果:工作流成功触发,数据表成功新增记录
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -864,7 +864,7 @@ test('Collection event add data trigger, normal table dropdown radio field, set
|
||||
// 3、预期结果:工作流成功触发,数据表成功新增记录
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -963,7 +963,7 @@ test('Collection event add data trigger, normal table dropdown radio fields, set
|
||||
// 3、预期结果:工作流成功触发,数据表成功新增记录
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -1075,7 +1075,7 @@ test('Collection event add data trigger, normal table dropdown radio fields, set
|
||||
// 3、预期结果:工作流成功触发,数据表成功新增记录
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -1185,7 +1185,7 @@ test('Collection event add data trigger, normal table date field, set constant d
|
||||
// 3、预期结果:工作流成功触发,数据表成功新增记录
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -1297,7 +1297,7 @@ test('Collection event add data trigger, normal table date field, set trigger no
|
||||
// 3、预期结果:工作流成功触发,数据表成功新增记录
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -84,7 +84,7 @@ test('Collection event add data trigger, no filter no sort query common table 1
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -163,7 +163,7 @@ test('Collection event add data trigger, no filtering and no sorting, query comm
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -251,7 +251,7 @@ test('Collection event add data trigger, no filter ID ascending, query common ta
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -360,7 +360,7 @@ test('Collection event add data trigger, no filter ID descending, query common t
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -465,7 +465,7 @@ test('Collection event add data trigger, no filtering and no sorting, query mult
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -570,7 +570,7 @@ test('Collection event add data trigger, no filtering and no sorting, query the
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -676,7 +676,7 @@ test('Collection event add data trigger, no filtering and no sorting, query the
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -811,7 +811,7 @@ test('Collection event add data trigger, filter to meet all conditions (status_s
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -930,7 +930,7 @@ test('Collection event add data trigger, filter to satisfy any condition (status
|
||||
// 3、预期结果:工作流成功触发,数据查询成功
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -162,7 +162,7 @@ test('Collection event add data trigger, filter dropdown radio fields not null,
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -324,7 +324,7 @@ test('Collection event add data trigger, filter dropdown radio fields not empty,
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -489,7 +489,7 @@ test('Collection event add data trigger, filter date field not null, common tabl
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -651,7 +651,7 @@ test('Collection event add data trigger, filter date field not empty, common tab
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -168,7 +168,7 @@ test('Collection event add data trigger, filter single line text field not empty
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -332,7 +332,7 @@ test('Collection event add data trigger, filter single line text field not empty
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -492,7 +492,7 @@ test('Collection event add data trigger, filter multi-line text field not empty,
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -656,7 +656,7 @@ test('Collection event add data trigger, filter multiline text field not empty,
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -808,7 +808,7 @@ test('Collection event add data trigger, filter integer field not null, common t
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -165,7 +165,7 @@ test('Collection event add data trigger, filter integer field not empty, common
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -318,7 +318,7 @@ test('Collection event add data trigger, filter numeric field not null, common t
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -475,7 +475,7 @@ test('Collection event add data trigger, filter numeric field not empty, common
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -628,7 +628,7 @@ test('Collection event add data trigger, filter dropdown radio field not null, c
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -787,7 +787,7 @@ test('Collection event add data trigger, filter dropdown radio field not empty,
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -171,7 +171,7 @@ test('Collection event add data trigger, filter dropdown radio fields not empty,
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -337,7 +337,7 @@ test('Collection event add data trigger, filter date field not null, common tabl
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -500,7 +500,7 @@ test('Collection event add data trigger, filter date field not empty, common tab
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -169,7 +169,7 @@ test('Collection event add data trigger, filter single line text field not empty
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -334,7 +334,7 @@ test('Collection event add data trigger, filter single line text field not empty
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -495,7 +495,7 @@ test('Collection event add data trigger, filter multi-line text field not empty,
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -660,7 +660,7 @@ test('Collection event add data trigger, filter multiline text field not empty,
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -162,7 +162,7 @@ test('Collection event add data trigger, filter integer field not null, common t
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -319,7 +319,7 @@ test('Collection event add data trigger, filter integer field not empty, common
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -473,7 +473,7 @@ test('Collection event add data trigger, filter numeric field not null, common t
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -631,7 +631,7 @@ test('Collection event add data trigger, filter numeric field not empty, common
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -163,7 +163,7 @@ test('Collection event add data trigger, filter dropdown radio field not null, c
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -323,7 +323,7 @@ test('Collection event add data trigger, filter dropdown radio field not empty,
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
@ -477,7 +477,7 @@ test('Collection event add data trigger, filter dropdown radio fields not null,
|
||||
|
||||
const getWorkflow = await apiGetWorkflow(workflowId);
|
||||
const getWorkflowObj = JSON.parse(JSON.stringify(getWorkflow));
|
||||
const getWorkflowExecuted = getWorkflowObj.executed;
|
||||
const getWorkflowExecuted = getWorkflowObj.versionStats.executed;
|
||||
expect(getWorkflowExecuted).toBe(1);
|
||||
const getWorkflowNodeExecutions = await apiGetWorkflowNodeExecutions(workflowId);
|
||||
const getWorkflowNodeExecutionsObj = JSON.parse(JSON.stringify(getWorkflowNodeExecutions));
|
||||
|
@ -34,6 +34,7 @@ import {
|
||||
import { useFlowContext } from '../FlowContext';
|
||||
import { useWorkflowVariableOptions } from '../variable';
|
||||
import { Card } from 'antd';
|
||||
import { useWorkflowExecuted } from '../hooks';
|
||||
|
||||
function reduceSchema(s, fn) {
|
||||
fn(s);
|
||||
@ -54,9 +55,8 @@ function createNewSchema() {
|
||||
}
|
||||
|
||||
export function AssignedFieldsFormSchemaConfig(props) {
|
||||
const { workflow } = useFlowContext();
|
||||
const executed = useWorkflowExecuted();
|
||||
const { setFormValueChanged } = useActionContext();
|
||||
const api = useAPIClient();
|
||||
const scope = useWorkflowVariableOptions();
|
||||
|
||||
const { values, setValuesIn, disabled } = useForm();
|
||||
@ -73,7 +73,7 @@ export function AssignedFieldsFormSchemaConfig(props) {
|
||||
() =>
|
||||
createForm({
|
||||
initialValues: params.values,
|
||||
disabled: workflow.executed,
|
||||
disabled: executed,
|
||||
effects() {
|
||||
onFormValuesChange((f) => {
|
||||
setValuesIn('params.values', toJS(f.values));
|
||||
@ -81,7 +81,7 @@ export function AssignedFieldsFormSchemaConfig(props) {
|
||||
});
|
||||
},
|
||||
}),
|
||||
[workflow.executed],
|
||||
[executed],
|
||||
);
|
||||
|
||||
useFormEffects(() => {
|
||||
|
@ -11,10 +11,10 @@ import { useFlowContext } from '../FlowContext';
|
||||
|
||||
export function useWorkflowExecuted() {
|
||||
const { workflow } = useFlowContext();
|
||||
return Boolean(workflow?.executed);
|
||||
return Boolean(workflow?.versionStats?.executed);
|
||||
}
|
||||
|
||||
export function useWorkflowAnyExecuted() {
|
||||
const { workflow } = useFlowContext();
|
||||
return Boolean(workflow?.allExecuted);
|
||||
return Boolean(workflow?.stats?.executed);
|
||||
}
|
||||
|
@ -9,8 +9,9 @@
|
||||
|
||||
import { i18n } from '@nocobase/client';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { NAMESPACE } from '../../common/constants';
|
||||
|
||||
export const NAMESPACE = 'workflow';
|
||||
export { NAMESPACE };
|
||||
|
||||
// i18n.addResources('zh-CN', NAMESPACE, zhCN);
|
||||
// i18n.addResources('en-US', NAMESPACE, enUS);
|
||||
|
@ -39,7 +39,7 @@ import { useFlowContext } from '../FlowContext';
|
||||
import { DrawerDescription } from '../components/DrawerDescription';
|
||||
import { StatusButton } from '../components/StatusButton';
|
||||
import { JobStatusOptionsMap } from '../constants';
|
||||
import { useGetAriaLabelOfAddButton } from '../hooks/useGetAriaLabelOfAddButton';
|
||||
import { useGetAriaLabelOfAddButton, useWorkflowExecuted } from '../hooks';
|
||||
import { lang } from '../locale';
|
||||
import useStyles from '../style';
|
||||
import { UseVariableOptions, VariableOption, WorkflowVariableInput } from '../variable';
|
||||
@ -105,10 +105,10 @@ function useUpdateAction() {
|
||||
const ctx = useActionContext();
|
||||
const { refresh } = useResourceActionContext();
|
||||
const data = useNodeContext();
|
||||
const { workflow } = useFlowContext();
|
||||
const executed = useWorkflowExecuted();
|
||||
return {
|
||||
async run() {
|
||||
if (workflow.executed) {
|
||||
if (executed) {
|
||||
message.error(lang('Node in executed workflow cannot be modified'));
|
||||
return;
|
||||
}
|
||||
@ -197,6 +197,7 @@ export function RemoveButton() {
|
||||
const { workflow, nodes, refresh } = useFlowContext() ?? {};
|
||||
const current = useNodeContext();
|
||||
const { modal } = App.useApp();
|
||||
const executed = useWorkflowExecuted();
|
||||
|
||||
const resource = api.resource('flow_nodes');
|
||||
|
||||
@ -247,7 +248,7 @@ export function RemoveButton() {
|
||||
return null;
|
||||
}
|
||||
|
||||
return workflow.executed ? null : (
|
||||
return executed ? null : (
|
||||
<Button
|
||||
type="text"
|
||||
shape="circle"
|
||||
@ -515,8 +516,8 @@ export function NodeDefaultView(props) {
|
||||
const { workflow, refresh } = useFlowContext() ?? {};
|
||||
const { styles } = useStyles();
|
||||
const workflowPlugin = usePlugin(WorkflowPlugin);
|
||||
const executed = useWorkflowExecuted();
|
||||
const instruction = workflowPlugin.instructions.get(data.type);
|
||||
const detailText = workflow.executed ? '{{t("View")}}' : '{{t("Configure")}}';
|
||||
|
||||
const [editingTitle, setEditingTitle] = useState<string>(data.title);
|
||||
const [editingConfig, setEditingConfig] = useState(false);
|
||||
@ -526,7 +527,7 @@ export function NodeDefaultView(props) {
|
||||
const values = cloneDeep(data.config);
|
||||
return createForm({
|
||||
initialValues: values,
|
||||
disabled: workflow.executed,
|
||||
disabled: executed,
|
||||
});
|
||||
}, [data, workflow]);
|
||||
|
||||
@ -620,7 +621,7 @@ export function NodeDefaultView(props) {
|
||||
</div>
|
||||
</div>
|
||||
<Input.TextArea
|
||||
disabled={workflow.executed}
|
||||
disabled={executed}
|
||||
value={editingTitle}
|
||||
onChange={(ev) => setEditingTitle(ev.target.value)}
|
||||
onBlur={(ev) => onChangeTitle(ev.target.value)}
|
||||
@ -723,7 +724,7 @@ export function NodeDefaultView(props) {
|
||||
},
|
||||
properties: instruction.fieldset,
|
||||
},
|
||||
footer: workflow.executed
|
||||
footer: executed
|
||||
? null
|
||||
: {
|
||||
type: 'void',
|
||||
|
@ -14,65 +14,58 @@ import { useTranslation } from 'react-i18next';
|
||||
import { message } from 'antd';
|
||||
|
||||
import { useActionContext, useResourceActionContext, useResourceContext } from '@nocobase/client';
|
||||
import executionCollection from '../../common/collections/executions';
|
||||
|
||||
import { ExecutionStatusOptions, EXECUTION_STATUS } from '../constants';
|
||||
import { NAMESPACE } from '../locale';
|
||||
import { getWorkflowDetailPath } from '../utils';
|
||||
|
||||
export const executionCollection = {
|
||||
name: 'execution-executions',
|
||||
fields: [
|
||||
{
|
||||
interface: 'id',
|
||||
type: 'bigInt',
|
||||
name: 'id',
|
||||
uiSchema: {
|
||||
type: 'number',
|
||||
title: '{{t("ID")}}',
|
||||
'x-component': 'Input',
|
||||
'x-component-props': {},
|
||||
'x-read-pretty': true,
|
||||
} as ISchema,
|
||||
},
|
||||
{
|
||||
interface: 'createdAt',
|
||||
type: 'datetime',
|
||||
name: 'createdAt',
|
||||
uiSchema: {
|
||||
type: 'datetime',
|
||||
title: `{{t("Triggered at", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-component': 'DatePicker',
|
||||
'x-component-props': {},
|
||||
'x-read-pretty': true,
|
||||
} as ISchema,
|
||||
},
|
||||
{
|
||||
interface: 'm2o',
|
||||
type: 'belongsTo',
|
||||
name: 'workflowId',
|
||||
uiSchema: {
|
||||
type: 'number',
|
||||
title: `{{t("Version", { ns: "${NAMESPACE}" })}}`,
|
||||
['x-component']({ value }) {
|
||||
const { setVisible } = useActionContext();
|
||||
return <Link to={getWorkflowDetailPath(value)} onClick={() => setVisible(false)}>{`#${value}`}</Link>;
|
||||
},
|
||||
} as ISchema,
|
||||
},
|
||||
{
|
||||
type: 'number',
|
||||
name: 'status',
|
||||
interface: 'select',
|
||||
uiSchema: {
|
||||
title: `{{t("Status", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'string',
|
||||
'x-component': 'Select',
|
||||
'x-decorator': 'FormItem',
|
||||
enum: ExecutionStatusOptions,
|
||||
} as ISchema,
|
||||
},
|
||||
],
|
||||
};
|
||||
// export const executionCollection = {
|
||||
// name: 'executions',
|
||||
// fields: [
|
||||
// {
|
||||
// interface: 'id',
|
||||
// type: 'bigInt',
|
||||
// name: 'id',
|
||||
// uiSchema: {
|
||||
// type: 'number',
|
||||
// title: '{{t("ID")}}',
|
||||
// 'x-component': 'Input',
|
||||
// 'x-component-props': {},
|
||||
// 'x-read-pretty': true,
|
||||
// } as ISchema,
|
||||
// },
|
||||
// {
|
||||
// interface: 'createdAt',
|
||||
// type: 'datetime',
|
||||
// name: 'createdAt',
|
||||
// uiSchema: {
|
||||
// type: 'datetime',
|
||||
// title: `{{t("Triggered at", { ns: "${NAMESPACE}" })}}`,
|
||||
// 'x-component': 'DatePicker',
|
||||
// 'x-component-props': {},
|
||||
// 'x-read-pretty': true,
|
||||
// } as ISchema,
|
||||
// },
|
||||
// {
|
||||
// interface: 'm2o',
|
||||
// type: 'belongsTo',
|
||||
// name: 'workflowId',
|
||||
// uiSchema: {
|
||||
// type: 'number',
|
||||
// title: `{{t("Version", { ns: "${NAMESPACE}" })}}`,
|
||||
// ['x-component']({ value }) {
|
||||
// const { setVisible } = useActionContext();
|
||||
// return <Link to={getWorkflowDetailPath(value)} onClick={() => setVisible(false)}>{`#${value}`}</Link>;
|
||||
// },
|
||||
// } as ISchema,
|
||||
// },
|
||||
// {
|
||||
// type: 'number',
|
||||
// name: 'status', as ISchema,
|
||||
// },
|
||||
// ],
|
||||
// };
|
||||
|
||||
export const executionSchema = {
|
||||
type: 'void',
|
||||
@ -185,7 +178,7 @@ export const executionSchema = {
|
||||
'x-component': 'Table.Column',
|
||||
properties: {
|
||||
createdAt: {
|
||||
type: 'datetime',
|
||||
type: 'string',
|
||||
'x-component': 'CollectionField',
|
||||
'x-component-props': {
|
||||
showTime: true,
|
||||
@ -198,10 +191,16 @@ export const executionSchema = {
|
||||
type: 'void',
|
||||
'x-decorator': 'Table.Column.Decorator',
|
||||
'x-component': 'Table.Column',
|
||||
title: `{{t("Version", { ns: "${NAMESPACE}" })}}`,
|
||||
properties: {
|
||||
workflowId: {
|
||||
type: 'number',
|
||||
'x-component': 'CollectionField',
|
||||
['x-component']({ value }) {
|
||||
const { setVisible } = useActionContext();
|
||||
return (
|
||||
<Link to={getWorkflowDetailPath(value)} onClick={() => setVisible(false)}>{`#${value}`}</Link>
|
||||
);
|
||||
},
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
},
|
||||
|
@ -7,113 +7,12 @@
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { ISchema } from '@formily/react';
|
||||
import { useRecord } from '@nocobase/client';
|
||||
import { NAMESPACE } from '../locale';
|
||||
// import { triggers } from '../triggers';
|
||||
import { executionSchema } from './executions';
|
||||
import { TriggerOptionRender } from '../components/TriggerOptionRender';
|
||||
|
||||
const collection = {
|
||||
name: 'workflows',
|
||||
fields: [
|
||||
{
|
||||
type: 'string',
|
||||
name: 'title',
|
||||
interface: 'input',
|
||||
uiSchema: {
|
||||
title: '{{t("Name")}}',
|
||||
type: 'string',
|
||||
'x-component': 'Input',
|
||||
required: true,
|
||||
} as ISchema,
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'type',
|
||||
interface: 'select',
|
||||
uiSchema: {
|
||||
title: `{{t("Trigger type", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'string',
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Select',
|
||||
enum: '{{useTriggersOptions()}}',
|
||||
'x-component-props': {
|
||||
optionRender: TriggerOptionRender,
|
||||
popupMatchSelectWidth: true,
|
||||
listHeight: 300,
|
||||
},
|
||||
required: true,
|
||||
} as ISchema,
|
||||
},
|
||||
{
|
||||
type: 'boolean',
|
||||
name: 'sync',
|
||||
interface: 'radioGroup',
|
||||
uiSchema: {
|
||||
title: `{{t("Mode", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'boolean',
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Radio.Group',
|
||||
enum: [
|
||||
{
|
||||
label: `{{ t("Asynchronously", { ns: "${NAMESPACE}" }) }}`,
|
||||
value: false,
|
||||
color: 'cyan',
|
||||
},
|
||||
{
|
||||
label: `{{ t("Synchronously", { ns: "${NAMESPACE}" }) }}`,
|
||||
value: true,
|
||||
color: 'orange',
|
||||
},
|
||||
],
|
||||
required: true,
|
||||
} as ISchema,
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'description',
|
||||
interface: 'textarea',
|
||||
uiSchema: {
|
||||
title: '{{t("Description")}}',
|
||||
type: 'string',
|
||||
'x-component': 'Input.TextArea',
|
||||
} as ISchema,
|
||||
},
|
||||
{
|
||||
type: 'boolean',
|
||||
name: 'enabled',
|
||||
interface: 'radioGroup',
|
||||
uiSchema: {
|
||||
title: `{{t("Status", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'string',
|
||||
enum: [
|
||||
{ label: `{{t("On", { ns: "${NAMESPACE}" })}}`, value: true, color: '#52c41a' },
|
||||
{ label: `{{t("Off", { ns: "${NAMESPACE}" })}}`, value: false },
|
||||
],
|
||||
'x-component': 'Radio.Group',
|
||||
'x-decorator': 'FormItem',
|
||||
default: false,
|
||||
} as ISchema,
|
||||
},
|
||||
{
|
||||
type: 'number',
|
||||
name: 'allExecuted',
|
||||
interface: 'integer',
|
||||
uiSchema: {
|
||||
title: `{{t("Executed", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'number',
|
||||
'x-component': 'InputNumber',
|
||||
'x-decorator': 'FormItem',
|
||||
} as ISchema,
|
||||
},
|
||||
{
|
||||
type: 'object',
|
||||
name: 'options',
|
||||
},
|
||||
],
|
||||
};
|
||||
import collection from '../../common/collections/workflows';
|
||||
|
||||
import { NAMESPACE } from '../locale';
|
||||
import { executionSchema } from './executions';
|
||||
|
||||
const workflowFieldset = {
|
||||
title: {
|
||||
@ -176,6 +75,7 @@ const workflowFieldset = {
|
||||
'x-component-props': {
|
||||
min: 1,
|
||||
precision: 0,
|
||||
className: 'auto-width',
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -201,6 +101,7 @@ export const workflowSchema: ISchema = {
|
||||
},
|
||||
sort: ['-createdAt'],
|
||||
except: ['config'],
|
||||
appends: ['stats'],
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -380,24 +281,19 @@ export const workflowSchema: ISchema = {
|
||||
},
|
||||
},
|
||||
},
|
||||
allExecuted: {
|
||||
'stats.executed': {
|
||||
type: 'void',
|
||||
'x-decorator': 'Table.Column.Decorator',
|
||||
'x-component': 'Table.Column',
|
||||
title: `{{ t("Executed", { ns: "${NAMESPACE}" }) }}`,
|
||||
properties: {
|
||||
allExecuted: {
|
||||
'stats.executed': {
|
||||
type: 'number',
|
||||
'x-decorator': 'OpenDrawer',
|
||||
'x-decorator-props': {
|
||||
component: function Com(props) {
|
||||
const record = useRecord();
|
||||
return React.createElement('a', {
|
||||
'aria-label': `executed-${record.title}`,
|
||||
...props,
|
||||
});
|
||||
},
|
||||
component: '{{ExecutedLink}}',
|
||||
},
|
||||
'x-component': 'CollectionField',
|
||||
'x-component': 'InputNumber',
|
||||
'x-read-pretty': true,
|
||||
properties: {
|
||||
drawer: executionSchema,
|
||||
|
@ -28,7 +28,7 @@ import {
|
||||
useResourceActionContext,
|
||||
} from '@nocobase/client';
|
||||
|
||||
import WorkflowPlugin from '..';
|
||||
import WorkflowPlugin, { useWorkflowExecuted } from '..';
|
||||
import { useFlowContext } from '../FlowContext';
|
||||
import { DrawerDescription } from '../components/DrawerDescription';
|
||||
import { NAMESPACE, lang } from '../locale';
|
||||
@ -39,11 +39,12 @@ function useUpdateConfigAction() {
|
||||
const form = useForm();
|
||||
const api = useAPIClient();
|
||||
const { workflow } = useFlowContext() ?? {};
|
||||
const executed = useWorkflowExecuted();
|
||||
const ctx = useActionContext();
|
||||
const { refresh } = useResourceActionContext();
|
||||
return {
|
||||
async run() {
|
||||
if (workflow.executed) {
|
||||
if (executed) {
|
||||
message.error(lang('Trigger in executed workflow cannot be modified'));
|
||||
return;
|
||||
}
|
||||
@ -171,6 +172,7 @@ export const TriggerConfig = () => {
|
||||
const { styles } = useStyles();
|
||||
const compile = useCompile();
|
||||
const trigger = useTrigger();
|
||||
const executed = useWorkflowExecuted();
|
||||
|
||||
useEffect(() => {
|
||||
if (workflow) {
|
||||
@ -182,7 +184,7 @@ export const TriggerConfig = () => {
|
||||
const values = cloneDeep(workflow.config);
|
||||
return createForm({
|
||||
initialValues: values,
|
||||
disabled: workflow.executed,
|
||||
disabled: executed,
|
||||
});
|
||||
}, [workflow]);
|
||||
|
||||
@ -229,7 +231,6 @@ export const TriggerConfig = () => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
const detailText = workflow.executed ? '{{t("View")}}' : '{{t("Configure")}}';
|
||||
const titleText = lang('Trigger');
|
||||
|
||||
if (!trigger) {
|
||||
@ -284,7 +285,7 @@ export const TriggerConfig = () => {
|
||||
onChange={(ev) => setEditingTitle(ev.target.value)}
|
||||
onBlur={(ev) => onChangeTitle(ev.target.value)}
|
||||
autoSize
|
||||
disabled={workflow.executed}
|
||||
disabled={executed}
|
||||
/>
|
||||
</div>
|
||||
<ActionContextProvider
|
||||
@ -349,7 +350,7 @@ export const TriggerConfig = () => {
|
||||
properties: fieldset,
|
||||
},
|
||||
actions: {
|
||||
...(workflow.executed
|
||||
...(executed
|
||||
? {}
|
||||
: {
|
||||
type: 'void',
|
||||
|
@ -0,0 +1,104 @@
|
||||
/**
|
||||
* This file is part of the NocoBase (R) project.
|
||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
||||
* Authors: NocoBase Team.
|
||||
*
|
||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import { NAMESPACE } from '../constants';
|
||||
|
||||
export default {
|
||||
dumpRules: {
|
||||
group: 'log',
|
||||
},
|
||||
migrationRules: ['schema-only'],
|
||||
name: 'executions',
|
||||
shared: true,
|
||||
fields: [
|
||||
{
|
||||
type: 'bigInt',
|
||||
name: 'id',
|
||||
interface: 'id',
|
||||
uiSchema: {
|
||||
type: 'number',
|
||||
title: '{{t("ID")}}',
|
||||
'x-component': 'Input',
|
||||
'x-component-props': {},
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
},
|
||||
{
|
||||
type: 'belongsTo',
|
||||
name: 'workflow',
|
||||
target: 'workflows',
|
||||
foreignKey: 'workflowId',
|
||||
interface: 'm2o',
|
||||
uiSchema: {
|
||||
type: 'object',
|
||||
title: `{{t("Version", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-component': 'AssociationField',
|
||||
'x-component-props': {
|
||||
fieldNames: {
|
||||
label: 'id',
|
||||
value: 'id',
|
||||
},
|
||||
},
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'key',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'eventKey',
|
||||
unique: true,
|
||||
},
|
||||
{
|
||||
type: 'hasMany',
|
||||
name: 'jobs',
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
{
|
||||
type: 'json',
|
||||
name: 'context',
|
||||
},
|
||||
{
|
||||
type: 'integer',
|
||||
name: 'status',
|
||||
interface: 'select',
|
||||
uiSchema: {
|
||||
title: `{{t("Status", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'string',
|
||||
'x-component': 'Select',
|
||||
'x-decorator': 'FormItem',
|
||||
enum: '{{ExecutionStatusOptions}}',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'json',
|
||||
name: 'stack',
|
||||
},
|
||||
{
|
||||
type: 'json',
|
||||
name: 'output',
|
||||
},
|
||||
{
|
||||
interface: 'createdAt',
|
||||
type: 'datetime',
|
||||
name: 'createdAt',
|
||||
uiSchema: {
|
||||
type: 'datetime',
|
||||
title: `{{t("Triggered at", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-component': 'DatePicker',
|
||||
'x-component-props': {},
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
@ -0,0 +1,66 @@
|
||||
/**
|
||||
* This file is part of the NocoBase (R) project.
|
||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
||||
* Authors: NocoBase Team.
|
||||
*
|
||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
export default {
|
||||
dumpRules: 'required',
|
||||
migrationRules: ['overwrite', 'schema-only'],
|
||||
name: 'flow_nodes',
|
||||
shared: true,
|
||||
fields: [
|
||||
{
|
||||
type: 'uid',
|
||||
name: 'key',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'title',
|
||||
},
|
||||
// which workflow belongs to
|
||||
{
|
||||
name: 'workflow',
|
||||
type: 'belongsTo',
|
||||
},
|
||||
{
|
||||
name: 'upstream',
|
||||
type: 'belongsTo',
|
||||
target: 'flow_nodes',
|
||||
},
|
||||
{
|
||||
name: 'branches',
|
||||
type: 'hasMany',
|
||||
target: 'flow_nodes',
|
||||
sourceKey: 'id',
|
||||
foreignKey: 'upstreamId',
|
||||
},
|
||||
// only works when upstream node is branching type, such as condition and parallel.
|
||||
// put here because the design of flow-links model is not really necessary for now.
|
||||
// or it should be put into flow-links model.
|
||||
{
|
||||
name: 'branchIndex',
|
||||
type: 'integer',
|
||||
},
|
||||
// Note: for reasons:
|
||||
// 1. redirect type node to solve cycle flow.
|
||||
// 2. recognize as real next node after branches.
|
||||
{
|
||||
name: 'downstream',
|
||||
type: 'belongsTo',
|
||||
target: 'flow_nodes',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'type',
|
||||
},
|
||||
{
|
||||
type: 'json',
|
||||
name: 'config',
|
||||
defaultValue: {},
|
||||
},
|
||||
],
|
||||
};
|
@ -0,0 +1,45 @@
|
||||
/**
|
||||
* This file is part of the NocoBase (R) project.
|
||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
||||
* Authors: NocoBase Team.
|
||||
*
|
||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
export default {
|
||||
dumpRules: {
|
||||
group: 'log',
|
||||
},
|
||||
migrationRules: ['schema-only'],
|
||||
name: 'jobs',
|
||||
shared: true,
|
||||
fields: [
|
||||
{
|
||||
type: 'belongsTo',
|
||||
name: 'execution',
|
||||
},
|
||||
{
|
||||
type: 'belongsTo',
|
||||
name: 'node',
|
||||
target: 'flow_nodes',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'nodeKey',
|
||||
},
|
||||
{
|
||||
type: 'belongsTo',
|
||||
name: 'upstream',
|
||||
target: 'jobs',
|
||||
},
|
||||
{
|
||||
type: 'integer',
|
||||
name: 'status',
|
||||
},
|
||||
{
|
||||
type: 'json',
|
||||
name: 'result',
|
||||
},
|
||||
],
|
||||
};
|
@ -0,0 +1,38 @@
|
||||
/**
|
||||
* This file is part of the NocoBase (R) project.
|
||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
||||
* Authors: NocoBase Team.
|
||||
*
|
||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import { NAMESPACE } from '../constants';
|
||||
|
||||
export default {
|
||||
dumpRules: {
|
||||
group: 'log',
|
||||
},
|
||||
migrationRules: ['schema-only'],
|
||||
name: 'workflowStats',
|
||||
shared: true,
|
||||
autoGenId: false,
|
||||
fields: [
|
||||
{
|
||||
name: 'key',
|
||||
type: 'uid',
|
||||
primaryKey: true,
|
||||
},
|
||||
{
|
||||
type: 'bigInt',
|
||||
name: 'executed',
|
||||
defaultValue: 0,
|
||||
interface: 'number',
|
||||
uiSchema: {
|
||||
title: `{{t("Executed", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-component': 'InputNumber',
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
@ -0,0 +1,44 @@
|
||||
/**
|
||||
* This file is part of the NocoBase (R) project.
|
||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
||||
* Authors: NocoBase Team.
|
||||
*
|
||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import { CollectionOptions } from '@nocobase/database';
|
||||
|
||||
export default function () {
|
||||
return {
|
||||
dumpRules: 'required',
|
||||
migrationRules: ['overwrite', 'schema-only'],
|
||||
name: 'workflowTasks',
|
||||
shared: true,
|
||||
repository: 'WorkflowTasksRepository',
|
||||
fields: [
|
||||
{
|
||||
name: 'user',
|
||||
type: 'belongsTo',
|
||||
},
|
||||
{
|
||||
name: 'workflow',
|
||||
type: 'belongsTo',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'type',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'key',
|
||||
},
|
||||
],
|
||||
indexes: [
|
||||
{
|
||||
unique: true,
|
||||
fields: ['type', 'key'],
|
||||
},
|
||||
],
|
||||
} as CollectionOptions;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
/**
|
||||
* This file is part of the NocoBase (R) project.
|
||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
||||
* Authors: NocoBase Team.
|
||||
*
|
||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import { NAMESPACE } from '../constants';
|
||||
|
||||
export default {
|
||||
dumpRules: {
|
||||
group: 'log',
|
||||
},
|
||||
migrationRules: ['schema-only'],
|
||||
name: 'workflowVersionStats',
|
||||
shared: true,
|
||||
autoGenId: false,
|
||||
fields: [
|
||||
{
|
||||
name: 'id',
|
||||
type: 'bigInt',
|
||||
primaryKey: true,
|
||||
},
|
||||
{
|
||||
type: 'bigInt',
|
||||
name: 'executed',
|
||||
defaultValue: 0,
|
||||
interface: 'number',
|
||||
uiSchema: {
|
||||
title: `{{t("Executed", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-component': 'InputNumber',
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
@ -0,0 +1,204 @@
|
||||
/**
|
||||
* This file is part of the NocoBase (R) project.
|
||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
||||
* Authors: NocoBase Team.
|
||||
*
|
||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import { NAMESPACE } from '../constants';
|
||||
|
||||
export default {
|
||||
dumpRules: 'required',
|
||||
migrationRules: ['overwrite', 'schema-only'],
|
||||
name: 'workflows',
|
||||
shared: true,
|
||||
repository: 'WorkflowRepository',
|
||||
fields: [
|
||||
{
|
||||
name: 'key',
|
||||
type: 'uid',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'title',
|
||||
interface: 'input',
|
||||
uiSchema: {
|
||||
title: '{{t("Name")}}',
|
||||
type: 'string',
|
||||
'x-component': 'Input',
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'boolean',
|
||||
name: 'enabled',
|
||||
defaultValue: false,
|
||||
interface: 'radioGroup',
|
||||
uiSchema: {
|
||||
title: `{{t("Status", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'string',
|
||||
enum: [
|
||||
{ label: `{{t("On", { ns: "${NAMESPACE}" })}}`, value: true, color: '#52c41a' },
|
||||
{ label: `{{t("Off", { ns: "${NAMESPACE}" })}}`, value: false },
|
||||
],
|
||||
'x-component': 'Radio.Group',
|
||||
'x-decorator': 'FormItem',
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
name: 'description',
|
||||
interface: 'textarea',
|
||||
uiSchema: {
|
||||
title: '{{t("Description")}}',
|
||||
type: 'string',
|
||||
'x-component': 'Input.TextArea',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'type',
|
||||
required: true,
|
||||
interface: 'select',
|
||||
uiSchema: {
|
||||
title: `{{t("Trigger type", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'string',
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Select',
|
||||
enum: '{{useTriggersOptions()}}',
|
||||
'x-component-props': {
|
||||
optionRender: '{{TriggerOptionRender}}',
|
||||
popupMatchSelectWidth: true,
|
||||
listHeight: 300,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'triggerTitle',
|
||||
},
|
||||
{
|
||||
type: 'jsonb',
|
||||
name: 'config',
|
||||
required: true,
|
||||
defaultValue: {},
|
||||
},
|
||||
{
|
||||
type: 'hasMany',
|
||||
name: 'nodes',
|
||||
target: 'flow_nodes',
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
{
|
||||
type: 'hasMany',
|
||||
name: 'executions',
|
||||
},
|
||||
{
|
||||
type: 'integer',
|
||||
name: 'executed',
|
||||
defaultValue: 0,
|
||||
},
|
||||
{
|
||||
type: 'integer',
|
||||
name: 'allExecuted',
|
||||
defaultValue: 0,
|
||||
},
|
||||
{
|
||||
type: 'boolean',
|
||||
name: 'current',
|
||||
},
|
||||
{
|
||||
type: 'boolean',
|
||||
name: 'sync',
|
||||
defaultValue: false,
|
||||
interface: 'radioGroup',
|
||||
uiSchema: {
|
||||
title: `{{t("Mode", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'boolean',
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Radio.Group',
|
||||
enum: [
|
||||
{
|
||||
label: `{{ t("Asynchronously", { ns: "${NAMESPACE}" }) }}`,
|
||||
value: false,
|
||||
color: 'cyan',
|
||||
},
|
||||
{
|
||||
label: `{{ t("Synchronously", { ns: "${NAMESPACE}" }) }}`,
|
||||
value: true,
|
||||
color: 'orange',
|
||||
},
|
||||
],
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'hasMany',
|
||||
name: 'revisions',
|
||||
target: 'workflows',
|
||||
foreignKey: 'key',
|
||||
sourceKey: 'key',
|
||||
// NOTE: no constraints needed here because tricky self-referencing
|
||||
constraints: false,
|
||||
onDelete: 'NO ACTION',
|
||||
},
|
||||
{
|
||||
type: 'jsonb',
|
||||
name: 'options',
|
||||
defaultValue: {},
|
||||
},
|
||||
{
|
||||
type: 'hasOne',
|
||||
name: 'stats',
|
||||
target: 'workflowStats',
|
||||
foreignKey: 'key',
|
||||
sourceKey: 'key',
|
||||
constraints: false,
|
||||
onDelete: 'CASCADE',
|
||||
interface: 'oho',
|
||||
uiSchema: {
|
||||
type: 'object',
|
||||
'x-component': 'AssociationField',
|
||||
'x-component-props': {
|
||||
fieldNames: {
|
||||
label: 'executed',
|
||||
value: 'key',
|
||||
},
|
||||
},
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'hasOne',
|
||||
name: 'versionStats',
|
||||
target: 'workflowVersionStats',
|
||||
foreignKey: 'id',
|
||||
sourceKey: 'id',
|
||||
constraints: false,
|
||||
onDelete: 'CASCADE',
|
||||
interface: 'oho',
|
||||
uiSchema: {
|
||||
type: 'object',
|
||||
'x-component': 'AssociationField',
|
||||
'x-component-props': {
|
||||
fieldNames: {
|
||||
label: 'executed',
|
||||
value: 'id',
|
||||
},
|
||||
},
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
},
|
||||
],
|
||||
// NOTE: use unique index for avoiding deadlock in mysql when setCurrent
|
||||
indexes: [
|
||||
{
|
||||
unique: true,
|
||||
fields: ['key', 'current'],
|
||||
},
|
||||
],
|
||||
};
|
@ -0,0 +1,10 @@
|
||||
/**
|
||||
* This file is part of the NocoBase (R) project.
|
||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
||||
* Authors: NocoBase Team.
|
||||
*
|
||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
export const NAMESPACE = 'workflow';
|
@ -33,6 +33,10 @@
|
||||
"Auto delete history when execution is on end status": "执行结束后自动删除对应状态的历史记录",
|
||||
"Maximum number of cycling triggers": "最大循环触发次数",
|
||||
"The triggers of same workflow by some node (create, update and sub-flow etc.) more than this number will be ignored. Large number may cause performance issues. Please use with caution.": "由某个节点(创建、更新和子流程等)触发同一个工作流超过这个次数时将被忽略。设置过高的次数可能会导致性能问题,请谨慎使用。",
|
||||
|
||||
"Continue when disabled or upgraded": "工作流被禁用或升级到新版本继续处理在途流程",
|
||||
"If checked, all nodes in-progress could continue to be processed in execution of disabled workflow. Otherwise, all nodes in-progress will be aborted automatically.": "如果选中,在途的节点在禁用或升级到新版本的工作流中将继续处理。否则将自动取消执行。",
|
||||
|
||||
"Trigger": "触发器",
|
||||
"Unknown trigger": "未知触发器",
|
||||
"Workflow with unknown type will cause error. Please delete it or check plugin which provide this type.": "未知类型的工作流会导致错误,请删除或检查提供该类型的插件。",
|
||||
|
@ -279,14 +279,24 @@ export default class PluginWorkflowServer extends Plugin {
|
||||
});
|
||||
|
||||
db.on('workflows.beforeSave', this.onBeforeSave);
|
||||
db.on('workflows.afterCreate', (model: WorkflowModel, { transaction }) => {
|
||||
db.on('workflows.afterCreate', async (model: WorkflowModel, { transaction }) => {
|
||||
const WorkflowStatsModel = this.db.getModel('workflowStats');
|
||||
const [stats, created] = await WorkflowStatsModel.findOrCreate({
|
||||
where: { key: model.key },
|
||||
defaults: { key: model.key },
|
||||
transaction,
|
||||
});
|
||||
model.stats = stats;
|
||||
model.versionStats = await model.createVersionStats({ id: model.id }, { transaction });
|
||||
if (model.enabled) {
|
||||
this.toggle(model, true, { transaction });
|
||||
}
|
||||
});
|
||||
db.on('workflows.afterUpdate', (model: WorkflowModel, { transaction }) =>
|
||||
this.toggle(model, model.enabled, { transaction }),
|
||||
);
|
||||
db.on('workflows.afterUpdate', async (model: WorkflowModel, { transaction }) => {
|
||||
model.stats = await model.getStats({ transaction });
|
||||
model.versionStats = await model.getVersionStats({ transaction });
|
||||
this.toggle(model, model.enabled, { transaction });
|
||||
});
|
||||
db.on('workflows.afterDestroy', async (model: WorkflowModel, { transaction }) => {
|
||||
this.toggle(model, false, { transaction });
|
||||
|
||||
@ -531,7 +541,7 @@ export default class PluginWorkflowServer extends Plugin {
|
||||
return Promise.reject(new Error('event is not valid'));
|
||||
}
|
||||
|
||||
let execution;
|
||||
let execution: ExecutionModel;
|
||||
try {
|
||||
execution = await workflow.createExecution(
|
||||
{
|
||||
@ -552,23 +562,21 @@ export default class PluginWorkflowServer extends Plugin {
|
||||
|
||||
this.getLogger(workflow.id).info(`execution of workflow ${workflow.id} created as ${execution.id}`);
|
||||
|
||||
await workflow.increment(['executed', 'allExecuted'], { transaction });
|
||||
if (!workflow.stats) {
|
||||
workflow.stats = await workflow.getStats({ transaction });
|
||||
}
|
||||
await workflow.stats.increment('executed', { transaction });
|
||||
// NOTE: https://sequelize.org/api/v6/class/src/model.js~model#instance-method-increment
|
||||
if (this.db.options.dialect !== 'postgres') {
|
||||
await workflow.reload({ transaction });
|
||||
await workflow.stats.reload({ transaction });
|
||||
}
|
||||
if (!workflow.versionStats) {
|
||||
workflow.versionStats = await workflow.getVersionStats({ transaction });
|
||||
}
|
||||
await workflow.versionStats.increment('executed', { transaction });
|
||||
if (this.db.options.dialect !== 'postgres') {
|
||||
await workflow.versionStats.reload({ transaction });
|
||||
}
|
||||
|
||||
await (<typeof WorkflowModel>workflow.constructor).update(
|
||||
{
|
||||
allExecuted: workflow.allExecuted,
|
||||
},
|
||||
{
|
||||
where: {
|
||||
key: workflow.key,
|
||||
},
|
||||
transaction,
|
||||
},
|
||||
);
|
||||
|
||||
if (!sameTransaction) {
|
||||
await transaction.commit();
|
||||
|
@ -54,9 +54,9 @@ describe('workflow > actions > workflows', () => {
|
||||
const workflow = await WorkflowModel.create({
|
||||
enabled: true,
|
||||
type: 'asyncTrigger',
|
||||
executed: 1,
|
||||
allExecuted: 1,
|
||||
});
|
||||
await workflow.stats.update({ executed: 1 });
|
||||
await workflow.versionStats.update({ executed: 1 });
|
||||
|
||||
const { status } = await agent.resource('workflows.nodes', workflow.id).create({
|
||||
values: {
|
||||
|
@ -19,6 +19,8 @@ describe('workflow > actions > workflows', () => {
|
||||
let PostRepo;
|
||||
let WorkflowModel;
|
||||
let ExecutionModel;
|
||||
let WorkflowStatsRepo;
|
||||
let WorkflowVersionStatsRepo;
|
||||
|
||||
beforeEach(async () => {
|
||||
app = await getApp();
|
||||
@ -26,6 +28,8 @@ describe('workflow > actions > workflows', () => {
|
||||
db = app.db;
|
||||
WorkflowModel = db.getCollection('workflows').model;
|
||||
ExecutionModel = db.getCollection('executions').model;
|
||||
WorkflowStatsRepo = db.getCollection('workflowStats').repository;
|
||||
WorkflowVersionStatsRepo = db.getCollection('workflowVersionStats').repository;
|
||||
PostModel = db.getCollection('posts').model;
|
||||
PostRepo = db.getCollection('posts').repository;
|
||||
});
|
||||
@ -185,6 +189,12 @@ describe('workflow > actions > workflows', () => {
|
||||
|
||||
const j2c = await JobModel.count();
|
||||
expect(j2c).toBe(1);
|
||||
|
||||
// NOTE: stats records should be deleted
|
||||
const statsCount = await WorkflowStatsRepo.count();
|
||||
expect(statsCount).toBe(0);
|
||||
const versionStatsCount = await WorkflowVersionStatsRepo.count();
|
||||
expect(versionStatsCount).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
@ -211,13 +221,23 @@ describe('workflow > actions > workflows', () => {
|
||||
});
|
||||
|
||||
expect(status).toBe(200);
|
||||
const { data: w2 } = body;
|
||||
const w2 = await WorkflowModel.findOne({
|
||||
where: {
|
||||
id: body.data.id,
|
||||
},
|
||||
include: ['stats', 'versionStats'],
|
||||
});
|
||||
expect(w2.config).toMatchObject(w1.config);
|
||||
expect(w2.key).toBe(w1.key);
|
||||
expect(w2.current).toBeFalsy();
|
||||
expect(w2.enabled).toBe(false);
|
||||
expect(w2.executed).toBe(0);
|
||||
expect(w2.allExecuted).toBe(1);
|
||||
expect(w2.versionStats.executed).toBe(0);
|
||||
expect(w2.stats.executed).toBe(1);
|
||||
|
||||
const s1c = await WorkflowStatsRepo.count();
|
||||
expect(s1c).toBe(1);
|
||||
const sv1c = await WorkflowVersionStatsRepo.count();
|
||||
expect(sv1c).toBe(2);
|
||||
|
||||
await WorkflowModel.update(
|
||||
{
|
||||
@ -237,15 +257,16 @@ describe('workflow > actions > workflows', () => {
|
||||
|
||||
const [w1next, w2next] = await WorkflowModel.findAll({
|
||||
order: [['id', 'ASC']],
|
||||
include: ['stats', 'versionStats'],
|
||||
});
|
||||
|
||||
expect(w1next.enabled).toBe(false);
|
||||
expect(w1next.current).toBe(null);
|
||||
expect(w1next.allExecuted).toBe(2);
|
||||
expect(w1next.stats.executed).toBe(2);
|
||||
expect(w2next.enabled).toBe(true);
|
||||
expect(w2next.current).toBe(true);
|
||||
expect(w2next.executed).toBe(1);
|
||||
expect(w2next.allExecuted).toBe(2);
|
||||
expect(w2next.versionStats.executed).toBe(1);
|
||||
expect(w2next.stats.executed).toBe(2);
|
||||
|
||||
const [e1] = await w1next.getExecutions();
|
||||
const [e2] = await w2next.getExecutions();
|
||||
@ -330,12 +351,18 @@ describe('workflow > actions > workflows', () => {
|
||||
});
|
||||
|
||||
expect(status).toBe(200);
|
||||
const { data: w2 } = body;
|
||||
const w2 = await WorkflowModel.findOne({
|
||||
where: {
|
||||
id: body.data.id,
|
||||
},
|
||||
include: ['stats', 'versionStats'],
|
||||
});
|
||||
expect(w2.config).toMatchObject(w1.config);
|
||||
expect(w2.key).not.toBe(w1.key);
|
||||
expect(w2.current).toBeTruthy();
|
||||
expect(w2.enabled).toBe(false);
|
||||
expect(w2.allExecuted).toBe(0);
|
||||
expect(w2.stats.executed).toBe(0);
|
||||
expect(w2.versionStats.executed).toBe(0);
|
||||
|
||||
// stop w1
|
||||
await WorkflowModel.update(
|
||||
@ -368,15 +395,16 @@ describe('workflow > actions > workflows', () => {
|
||||
|
||||
const [w1next, w2next] = await WorkflowModel.findAll({
|
||||
order: [['id', 'ASC']],
|
||||
include: ['stats', 'versionStats'],
|
||||
});
|
||||
|
||||
expect(w1next.enabled).toBe(false);
|
||||
expect(w1next.current).toBe(true);
|
||||
expect(w1next.executed).toBe(1);
|
||||
expect(w1next.allExecuted).toBe(1);
|
||||
expect(w1next.versionStats.executed).toBe(1);
|
||||
expect(w1next.stats.executed).toBe(1);
|
||||
expect(w2next.enabled).toBe(true);
|
||||
expect(w2next.executed).toBe(1);
|
||||
expect(w2next.allExecuted).toBe(1);
|
||||
expect(w2next.versionStats.executed).toBe(1);
|
||||
expect(w2next.stats.executed).toBe(1);
|
||||
|
||||
const [e1] = await w1next.getExecutions();
|
||||
const [e2] = await w2next.getExecutions();
|
||||
@ -402,12 +430,17 @@ describe('workflow > actions > workflows', () => {
|
||||
});
|
||||
|
||||
expect(status).toBe(200);
|
||||
const { data: w2 } = body;
|
||||
const w2 = await WorkflowModel.findOne({
|
||||
where: {
|
||||
id: body.data.id,
|
||||
},
|
||||
include: ['stats', 'versionStats'],
|
||||
});
|
||||
expect(w2.config).toMatchObject(w1.config);
|
||||
expect(w2.key).not.toBe(w1.key);
|
||||
expect(w2.current).toBeTruthy();
|
||||
expect(w2.enabled).toBe(false);
|
||||
expect(w2.allExecuted).toBe(0);
|
||||
expect(w2.stats.executed).toBe(0);
|
||||
expect(w2.sync).toBe(true);
|
||||
|
||||
// stop w1
|
||||
@ -439,15 +472,16 @@ describe('workflow > actions > workflows', () => {
|
||||
|
||||
const [w1next, w2next] = await WorkflowModel.findAll({
|
||||
order: [['id', 'ASC']],
|
||||
include: ['stats', 'versionStats'],
|
||||
});
|
||||
|
||||
expect(w1next.enabled).toBe(false);
|
||||
expect(w1next.current).toBe(true);
|
||||
expect(w1next.executed).toBe(1);
|
||||
expect(w1next.allExecuted).toBe(1);
|
||||
expect(w1next.versionStats.executed).toBe(1);
|
||||
expect(w1next.stats.executed).toBe(1);
|
||||
expect(w2next.enabled).toBe(true);
|
||||
expect(w2next.executed).toBe(1);
|
||||
expect(w2next.allExecuted).toBe(1);
|
||||
expect(w2next.versionStats.executed).toBe(1);
|
||||
expect(w2next.stats.executed).toBe(1);
|
||||
|
||||
const [e1] = await w1next.getExecutions();
|
||||
const [e2] = await w2next.getExecutions();
|
||||
|
@ -0,0 +1,155 @@
|
||||
/**
|
||||
* This file is part of the NocoBase (R) project.
|
||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
||||
* Authors: NocoBase Team.
|
||||
*
|
||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import { describe, test } from 'vitest';
|
||||
|
||||
import { MockServer } from '@nocobase/test';
|
||||
import { getApp } from '@nocobase/plugin-workflow-test';
|
||||
|
||||
import Migration from '../../migrations/20250320223415-stats';
|
||||
import PluginWorkflowServer from '../..';
|
||||
|
||||
describe('20250320223415-stats', () => {
|
||||
let app: MockServer;
|
||||
let workflow;
|
||||
let plugin: PluginWorkflowServer;
|
||||
let WorkflowRepo;
|
||||
let WorkflowStatsRepo;
|
||||
let WorkflowVersionStatsRepo;
|
||||
|
||||
describe('legacy stats should be migrated', () => {
|
||||
beforeEach(async () => {
|
||||
app = await getApp();
|
||||
app.version.update('1.6.0');
|
||||
plugin = app.pm.get(PluginWorkflowServer) as PluginWorkflowServer;
|
||||
WorkflowRepo = app.db.getRepository('workflows');
|
||||
WorkflowStatsRepo = app.db.getRepository('workflowStats');
|
||||
WorkflowVersionStatsRepo = app.db.getRepository('workflowVersionStats');
|
||||
});
|
||||
|
||||
afterEach(() => app.destroy());
|
||||
|
||||
test('only one version', async () => {
|
||||
workflow = await WorkflowRepo.create({
|
||||
values: {
|
||||
type: 'syncTrigger',
|
||||
executed: 1,
|
||||
allExecuted: 1,
|
||||
key: 'abc',
|
||||
},
|
||||
hooks: false,
|
||||
});
|
||||
|
||||
const migration = new Migration({ app, db: app.db } as any);
|
||||
await migration.up();
|
||||
|
||||
const stats = await WorkflowStatsRepo.findOne({
|
||||
filterByTk: workflow.get('key'),
|
||||
});
|
||||
|
||||
expect(stats.get('executed')).toBe(1);
|
||||
|
||||
const versionStats = await WorkflowVersionStatsRepo.findOne({
|
||||
filterByTk: workflow.get('id'),
|
||||
});
|
||||
|
||||
expect(versionStats.get('executed')).toBe(1);
|
||||
});
|
||||
|
||||
test('multiple versions', async () => {
|
||||
const w1 = await WorkflowRepo.create({
|
||||
values: {
|
||||
enabled: true,
|
||||
type: 'syncTrigger',
|
||||
executed: 1,
|
||||
allExecuted: 2,
|
||||
key: 'abc',
|
||||
},
|
||||
hooks: false,
|
||||
});
|
||||
|
||||
const w2 = await WorkflowRepo.create({
|
||||
values: {
|
||||
enabled: true,
|
||||
type: 'syncTrigger',
|
||||
executed: 1,
|
||||
allExecuted: 2,
|
||||
key: 'abc',
|
||||
},
|
||||
hooks: false,
|
||||
});
|
||||
|
||||
const migration = new Migration({ app, db: app.db } as any);
|
||||
await migration.up();
|
||||
|
||||
const stats = await WorkflowStatsRepo.findOne({
|
||||
filterByTk: w1.get('key'),
|
||||
});
|
||||
|
||||
expect(stats.get('executed')).toBe(2);
|
||||
|
||||
const v1Stats = await WorkflowVersionStatsRepo.findOne({
|
||||
filterByTk: w1.get('id'),
|
||||
});
|
||||
|
||||
expect(v1Stats.get('executed')).toBe(1);
|
||||
|
||||
const v2Stats = await WorkflowVersionStatsRepo.findOne({
|
||||
filterByTk: w2.get('id'),
|
||||
});
|
||||
|
||||
expect(v2Stats.get('executed')).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('executed field should works correctly after migrated', () => {
|
||||
beforeEach(async () => {
|
||||
app = await getApp();
|
||||
app.version.update('1.6.0');
|
||||
plugin = app.pm.get(PluginWorkflowServer) as PluginWorkflowServer;
|
||||
WorkflowStatsRepo = app.db.getRepository('workflowStats');
|
||||
WorkflowVersionStatsRepo = app.db.getRepository('workflowVersionStats');
|
||||
const WorkflowRepo = app.db.getRepository('workflows');
|
||||
workflow = await WorkflowRepo.create({
|
||||
values: {
|
||||
type: 'syncTrigger',
|
||||
key: 'abc',
|
||||
},
|
||||
hooks: false,
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => app.destroy());
|
||||
|
||||
test('trigger should get correct executed value', async () => {
|
||||
const migration = new Migration({ app, db: app.db } as any);
|
||||
await migration.up();
|
||||
|
||||
await workflow.update({
|
||||
enabled: true,
|
||||
});
|
||||
workflow.stats = await workflow.getStats();
|
||||
workflow.versionStats = await workflow.getVersionStats();
|
||||
|
||||
await plugin.trigger(workflow, {});
|
||||
|
||||
const stats = await WorkflowStatsRepo.findOne({
|
||||
filterByTk: workflow.get('key'),
|
||||
});
|
||||
|
||||
expect(stats.get('executed')).toBe(1);
|
||||
|
||||
const versionStats = await WorkflowVersionStatsRepo.findOne({
|
||||
filterByTk: workflow.get('id'),
|
||||
});
|
||||
|
||||
expect(versionStats.get('executed')).toBe(1);
|
||||
});
|
||||
});
|
||||
});
|
@ -19,7 +19,9 @@ export async function create(context: Context, next) {
|
||||
|
||||
context.body = await db.sequelize.transaction(async (transaction) => {
|
||||
const workflow = (await repository.getSourceModel(transaction)) as WorkflowModel;
|
||||
if (workflow.executed) {
|
||||
workflow.versionStats = await workflow.getVersionStats({ transaction });
|
||||
const { executed } = workflow.versionStats;
|
||||
if (executed) {
|
||||
context.throw(400, 'Node could not be created in executed workflow');
|
||||
}
|
||||
|
||||
@ -126,9 +128,9 @@ export async function destroy(context: Context, next) {
|
||||
const instance = await repository.findOne({
|
||||
filterByTk,
|
||||
fields: [...fields, 'workflowId'],
|
||||
appends: ['upstream', 'downstream', 'workflow'],
|
||||
appends: ['upstream', 'downstream', 'workflow.versionStats.executed'],
|
||||
});
|
||||
if (instance.workflow.executed) {
|
||||
if (instance.workflow.versionStats.executed) {
|
||||
context.throw(400, 'Nodes in executed workflow could not be deleted');
|
||||
}
|
||||
|
||||
@ -199,10 +201,10 @@ export async function update(context: Context, next) {
|
||||
// TODO(optimize): duplicated instance query
|
||||
const { workflow } = await repository.findOne({
|
||||
filterByTk,
|
||||
appends: ['workflow.executed'],
|
||||
appends: ['workflow.versionStats.executed'],
|
||||
transaction,
|
||||
});
|
||||
if (workflow.executed) {
|
||||
if (workflow.versionStats.executed) {
|
||||
context.throw(400, 'Nodes in executed workflow could not be reconfigured');
|
||||
}
|
||||
|
||||
|
@ -22,8 +22,11 @@ export async function update(context: Context, next) {
|
||||
});
|
||||
// only enable/disable
|
||||
if (Object.keys(values).includes('config')) {
|
||||
const workflow = await repository.findById(filterByTk);
|
||||
if (workflow.get('executed')) {
|
||||
const workflow = await repository.findOne({
|
||||
filterByTk,
|
||||
appends: ['versionStats'],
|
||||
});
|
||||
if (workflow.versionStats.executed) {
|
||||
return context.throw(400, 'config of executed workflow can not be updated');
|
||||
}
|
||||
}
|
||||
|
@ -9,47 +9,6 @@
|
||||
|
||||
import { CollectionOptions } from '@nocobase/database';
|
||||
|
||||
export default {
|
||||
dumpRules: {
|
||||
group: 'log',
|
||||
},
|
||||
migrationRules: ['schema-only'],
|
||||
name: 'executions',
|
||||
shared: true,
|
||||
fields: [
|
||||
{
|
||||
type: 'belongsTo',
|
||||
name: 'workflow',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'key',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'eventKey',
|
||||
unique: true,
|
||||
},
|
||||
{
|
||||
type: 'hasMany',
|
||||
name: 'jobs',
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
{
|
||||
type: 'json',
|
||||
name: 'context',
|
||||
},
|
||||
{
|
||||
type: 'integer',
|
||||
name: 'status',
|
||||
},
|
||||
{
|
||||
type: 'json',
|
||||
name: 'stack',
|
||||
},
|
||||
{
|
||||
type: 'json',
|
||||
name: 'output',
|
||||
},
|
||||
],
|
||||
} as CollectionOptions;
|
||||
import options from '../../common/collections/executions';
|
||||
|
||||
export default options as CollectionOptions;
|
||||
|
@ -9,60 +9,6 @@
|
||||
|
||||
import { CollectionOptions } from '@nocobase/database';
|
||||
|
||||
export default {
|
||||
dumpRules: 'required',
|
||||
migrationRules: ['overwrite', 'schema-only'],
|
||||
name: 'flow_nodes',
|
||||
shared: true,
|
||||
fields: [
|
||||
{
|
||||
type: 'uid',
|
||||
name: 'key',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'title',
|
||||
},
|
||||
// which workflow belongs to
|
||||
{
|
||||
name: 'workflow',
|
||||
type: 'belongsTo',
|
||||
},
|
||||
{
|
||||
name: 'upstream',
|
||||
type: 'belongsTo',
|
||||
target: 'flow_nodes',
|
||||
},
|
||||
{
|
||||
name: 'branches',
|
||||
type: 'hasMany',
|
||||
target: 'flow_nodes',
|
||||
sourceKey: 'id',
|
||||
foreignKey: 'upstreamId',
|
||||
},
|
||||
// only works when upstream node is branching type, such as condition and parallel.
|
||||
// put here because the design of flow-links model is not really necessary for now.
|
||||
// or it should be put into flow-links model.
|
||||
{
|
||||
name: 'branchIndex',
|
||||
type: 'integer',
|
||||
},
|
||||
// Note: for reasons:
|
||||
// 1. redirect type node to solve cycle flow.
|
||||
// 2. recognize as real next node after branches.
|
||||
{
|
||||
name: 'downstream',
|
||||
type: 'belongsTo',
|
||||
target: 'flow_nodes',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'type',
|
||||
},
|
||||
{
|
||||
type: 'json',
|
||||
name: 'config',
|
||||
defaultValue: {},
|
||||
},
|
||||
],
|
||||
} as CollectionOptions;
|
||||
import options from '../../common/collections/flow_nodes';
|
||||
|
||||
export default options as CollectionOptions;
|
||||
|
@ -9,39 +9,6 @@
|
||||
|
||||
import { CollectionOptions } from '@nocobase/database';
|
||||
|
||||
export default {
|
||||
dumpRules: {
|
||||
group: 'log',
|
||||
},
|
||||
migrationRules: ['schema-only'],
|
||||
name: 'jobs',
|
||||
shared: true,
|
||||
fields: [
|
||||
{
|
||||
type: 'belongsTo',
|
||||
name: 'execution',
|
||||
},
|
||||
{
|
||||
type: 'belongsTo',
|
||||
name: 'node',
|
||||
target: 'flow_nodes',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'nodeKey',
|
||||
},
|
||||
{
|
||||
type: 'belongsTo',
|
||||
name: 'upstream',
|
||||
target: 'jobs',
|
||||
},
|
||||
{
|
||||
type: 'integer',
|
||||
name: 'status',
|
||||
},
|
||||
{
|
||||
type: 'json',
|
||||
name: 'result',
|
||||
},
|
||||
],
|
||||
} as CollectionOptions;
|
||||
import options from '../../common/collections/jobs';
|
||||
|
||||
export default options as CollectionOptions;
|
||||
|
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* This file is part of the NocoBase (R) project.
|
||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
||||
* Authors: NocoBase Team.
|
||||
*
|
||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import { CollectionOptions } from '@nocobase/database';
|
||||
|
||||
import options from '../../common/collections/workflowStats';
|
||||
|
||||
export default options as CollectionOptions;
|
@ -9,36 +9,6 @@
|
||||
|
||||
import { CollectionOptions } from '@nocobase/database';
|
||||
|
||||
export default function () {
|
||||
return {
|
||||
dumpRules: 'required',
|
||||
migrationRules: ['overwrite', 'schema-only'],
|
||||
name: 'workflowTasks',
|
||||
shared: true,
|
||||
repository: 'WorkflowTasksRepository',
|
||||
fields: [
|
||||
{
|
||||
name: 'user',
|
||||
type: 'belongsTo',
|
||||
},
|
||||
{
|
||||
name: 'workflow',
|
||||
type: 'belongsTo',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'type',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'key',
|
||||
},
|
||||
],
|
||||
indexes: [
|
||||
{
|
||||
unique: true,
|
||||
fields: ['type', 'key'],
|
||||
},
|
||||
],
|
||||
} as CollectionOptions;
|
||||
}
|
||||
import options from '../../common/collections/workflowTasks';
|
||||
|
||||
export default options as CollectionOptions;
|
||||
|
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* This file is part of the NocoBase (R) project.
|
||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
||||
* Authors: NocoBase Team.
|
||||
*
|
||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import { CollectionOptions } from '@nocobase/database';
|
||||
|
||||
import options from '../../common/collections/workflowVersionStats';
|
||||
|
||||
export default options as CollectionOptions;
|
@ -9,104 +9,6 @@
|
||||
|
||||
import { CollectionOptions } from '@nocobase/database';
|
||||
|
||||
export default function () {
|
||||
return {
|
||||
dumpRules: 'required',
|
||||
migrationRules: ['overwrite', 'schema-only'],
|
||||
name: 'workflows',
|
||||
shared: true,
|
||||
repository: 'WorkflowRepository',
|
||||
fields: [
|
||||
{
|
||||
name: 'key',
|
||||
type: 'uid',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'title',
|
||||
interface: 'input',
|
||||
uiSchema: {
|
||||
title: '{{t("Name")}}',
|
||||
type: 'string',
|
||||
'x-component': 'Input',
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'boolean',
|
||||
name: 'enabled',
|
||||
defaultValue: false,
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
name: 'description',
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'type',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'triggerTitle',
|
||||
},
|
||||
{
|
||||
type: 'jsonb',
|
||||
name: 'config',
|
||||
required: true,
|
||||
defaultValue: {},
|
||||
},
|
||||
{
|
||||
type: 'hasMany',
|
||||
name: 'nodes',
|
||||
target: 'flow_nodes',
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
{
|
||||
type: 'hasMany',
|
||||
name: 'executions',
|
||||
},
|
||||
{
|
||||
type: 'integer',
|
||||
name: 'executed',
|
||||
defaultValue: 0,
|
||||
},
|
||||
{
|
||||
type: 'integer',
|
||||
name: 'allExecuted',
|
||||
defaultValue: 0,
|
||||
},
|
||||
{
|
||||
type: 'boolean',
|
||||
name: 'current',
|
||||
},
|
||||
{
|
||||
type: 'boolean',
|
||||
name: 'sync',
|
||||
defaultValue: false,
|
||||
},
|
||||
{
|
||||
type: 'hasMany',
|
||||
name: 'revisions',
|
||||
target: 'workflows',
|
||||
foreignKey: 'key',
|
||||
sourceKey: 'key',
|
||||
// NOTE: no constraints needed here because tricky self-referencing
|
||||
constraints: false,
|
||||
onDelete: 'NO ACTION',
|
||||
},
|
||||
{
|
||||
type: 'jsonb',
|
||||
name: 'options',
|
||||
defaultValue: {},
|
||||
},
|
||||
],
|
||||
// NOTE: use unique index for avoiding deadlock in mysql when setCurrent
|
||||
indexes: [
|
||||
{
|
||||
unique: true,
|
||||
fields: ['key', 'current'],
|
||||
},
|
||||
],
|
||||
} as CollectionOptions;
|
||||
}
|
||||
import options from '../../common/collections/workflows';
|
||||
|
||||
export default options as CollectionOptions;
|
||||
|
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* This file is part of the NocoBase (R) project.
|
||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
||||
* Authors: NocoBase Team.
|
||||
*
|
||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import { Migration } from '@nocobase/server';
|
||||
|
||||
export default class extends Migration {
|
||||
appVersion = '<1.7.0';
|
||||
on = 'afterLoad';
|
||||
async up() {
|
||||
const { db } = this.context;
|
||||
|
||||
const WorkflowRepo = db.getRepository('workflows');
|
||||
const WorkflowStatsModel = db.getModel('workflowStats');
|
||||
const WorkflowVersionStatsModel = db.getModel('workflowVersionStats');
|
||||
await db.sequelize.transaction(async (transaction) => {
|
||||
const workflows = await WorkflowRepo.find({
|
||||
fields: ['id', 'key', 'executed', 'allExecuted'],
|
||||
transaction,
|
||||
});
|
||||
|
||||
const groupCounts: { [key: string]: { key: string; executed: number } } = {};
|
||||
for (const workflow of workflows) {
|
||||
await WorkflowVersionStatsModel.findOrCreate({
|
||||
where: {
|
||||
id: workflow.id,
|
||||
},
|
||||
defaults: {
|
||||
id: workflow.id,
|
||||
executed: workflow.get('executed'),
|
||||
},
|
||||
transaction,
|
||||
});
|
||||
|
||||
const key = workflow.get('key');
|
||||
groupCounts[key] = {
|
||||
key,
|
||||
executed: workflow.get('allExecuted') || 0,
|
||||
};
|
||||
}
|
||||
for (const values of Object.values(groupCounts)) {
|
||||
await WorkflowStatsModel.findOrCreate({
|
||||
where: {
|
||||
key: values.key,
|
||||
},
|
||||
defaults: values,
|
||||
transaction,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -18,7 +18,7 @@ export default class WorkflowRepository extends Repository {
|
||||
const origin = await this.findOne({
|
||||
filterByTk,
|
||||
filter,
|
||||
appends: ['nodes'],
|
||||
appends: ['nodes', 'stats', 'versionStats'],
|
||||
context,
|
||||
transaction,
|
||||
});
|
||||
@ -30,7 +30,6 @@ export default class WorkflowRepository extends Repository {
|
||||
key: filter.key,
|
||||
title: origin.title,
|
||||
triggerTitle: origin.triggerTitle,
|
||||
allExecuted: origin.allExecuted,
|
||||
current: null,
|
||||
...values,
|
||||
}
|
||||
|
@ -159,12 +159,12 @@ export default class DateFieldScheduleTrigger {
|
||||
// i. endsOn after now -> yes
|
||||
// ii. endsOn before now -> no
|
||||
async loadRecordsToSchedule(
|
||||
{ id, config: { collection, limit, startsOn, repeat, endsOn }, allExecuted }: WorkflowModel,
|
||||
{ id, config: { collection, limit, startsOn, repeat, endsOn }, stats }: WorkflowModel,
|
||||
currentDate: Date,
|
||||
) {
|
||||
const { dataSourceManager } = this.workflow.app;
|
||||
if (limit && allExecuted >= limit) {
|
||||
this.workflow.getLogger(id).warn(`[Schedule on date field] limit reached (all executed ${allExecuted})`);
|
||||
if (limit && stats.executed >= limit) {
|
||||
this.workflow.getLogger(id).warn(`[Schedule on date field] limit reached (all executed ${stats.executed})`);
|
||||
return [];
|
||||
}
|
||||
if (!startsOn) {
|
||||
@ -256,9 +256,9 @@ export default class DateFieldScheduleTrigger {
|
||||
getRecordNextTime(workflow: WorkflowModel, record, nextSecond = false) {
|
||||
const {
|
||||
config: { startsOn, endsOn, repeat, limit },
|
||||
allExecuted,
|
||||
stats,
|
||||
} = workflow;
|
||||
if (limit && allExecuted >= limit) {
|
||||
if (limit && stats.executed >= limit) {
|
||||
return null;
|
||||
}
|
||||
const range = this.cacheCycle;
|
||||
@ -356,7 +356,7 @@ export default class DateFieldScheduleTrigger {
|
||||
},
|
||||
);
|
||||
|
||||
if (!workflow.config.repeat || (workflow.config.limit && workflow.allExecuted >= workflow.config.limit - 1)) {
|
||||
if (!workflow.config.repeat || (workflow.config.limit && workflow.stats.executed >= workflow.config.limit - 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -50,8 +50,8 @@ export default class StaticScheduleTrigger {
|
||||
});
|
||||
}
|
||||
|
||||
getNextTime({ config, allExecuted }: WorkflowModel, currentDate: Date, nextSecond = false) {
|
||||
if (config.limit && allExecuted >= config.limit) {
|
||||
getNextTime({ config, stats }: WorkflowModel, currentDate: Date, nextSecond = false) {
|
||||
if (config.limit && stats.executed >= config.limit) {
|
||||
return null;
|
||||
}
|
||||
if (!config.startsOn) {
|
||||
@ -119,7 +119,7 @@ export default class StaticScheduleTrigger {
|
||||
|
||||
this.workflow.trigger(workflow, { date: new Date(time) }, { eventKey });
|
||||
|
||||
if (!workflow.config.repeat || (workflow.config.limit && workflow.allExecuted >= workflow.config.limit - 1)) {
|
||||
if (!workflow.config.repeat || (workflow.config.limit && workflow.stats.executed >= workflow.config.limit - 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -29,8 +29,6 @@ export default class WorkflowModel extends Model {
|
||||
declare type: string;
|
||||
declare config: any;
|
||||
declare options: any;
|
||||
declare executed: number;
|
||||
declare allExecuted: number;
|
||||
declare sync: boolean;
|
||||
|
||||
declare createdAt: Date;
|
||||
|
@ -579,14 +579,6 @@ export default {
|
||||
type: 'array',
|
||||
description: 'Revisions',
|
||||
},
|
||||
executed: {
|
||||
type: 'integer',
|
||||
description: 'Executed count for a single version',
|
||||
},
|
||||
allExecuted: {
|
||||
type: 'integer',
|
||||
description: 'Executed count for all versions of the same workflow',
|
||||
},
|
||||
},
|
||||
},
|
||||
filterByTk: {
|
||||
@ -623,12 +615,6 @@ export default {
|
||||
key: {
|
||||
$ref: '#/components/schemas/workflow/model/properties/key',
|
||||
},
|
||||
executed: {
|
||||
$ref: '#/components/schemas/workflow/model/properties/executed',
|
||||
},
|
||||
allExecuted: {
|
||||
$ref: '#/components/schemas/workflow/model/properties/allExecuted',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user