From a408f2707d820919a57c296f622ade18996f0e35 Mon Sep 17 00:00:00 2001 From: jkilzi Date: Tue, 20 Feb 2024 13:57:11 +0200 Subject: [PATCH] chore(orchestrator): decommission the ProcessInstance.lastUpdate field Addresses: - https://issues.redhat.com/browse/FLPATH-1017 --- .../orchestrator-backend/src/service/DataIndexService.ts | 8 ++++---- plugins/orchestrator-common/src/models.ts | 2 -- .../src/__fixtures__/fakeLongProcessInstanceList.ts | 1 - .../orchestrator/src/__fixtures__/fakeProcessInstance.ts | 4 ---- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/plugins/orchestrator-backend/src/service/DataIndexService.ts b/plugins/orchestrator-backend/src/service/DataIndexService.ts index 2ba7f8a5df..b05df51319 100644 --- a/plugins/orchestrator-backend/src/service/DataIndexService.ts +++ b/plugins/orchestrator-backend/src/service/DataIndexService.ts @@ -102,7 +102,7 @@ export class DataIndexService { public async fetchProcessInstances(): Promise { const graphQlQuery = - '{ ProcessInstances ( orderBy: { start: ASC }, where: {processId: {isNull: false} } ) { id, processName, processId, businessKey, state, start, lastUpdate, end, nodes { id }, variables, parentProcessInstance {id, processName, businessKey} } }'; + '{ ProcessInstances ( orderBy: { start: ASC }, where: {processId: {isNull: false} } ) { id, processName, processId, businessKey, state, start, end, nodes { id }, variables, parentProcessInstance {id, processName, businessKey} } }'; const response = await this.client.query(graphQlQuery, {}); @@ -163,7 +163,7 @@ export class DataIndexService { limit: number, offset: number, ): Promise { - const graphQlQuery = `{ ProcessInstances(where: {processId: {equal: "${workflowId}" } }, pagination: {limit: ${limit}, offset: ${offset}}) { processName, state, start, lastUpdate, end } }`; + const graphQlQuery = `{ ProcessInstances(where: {processId: {equal: "${workflowId}" } }, pagination: {limit: ${limit}, offset: ${offset}}) { processName, state, start, end } }`; const result = await this.client.query(graphQlQuery, {}); @@ -180,7 +180,7 @@ export class DataIndexService { public async fetchProcessInstanceJobs( instanceId: string, ): Promise { - const graphQlQuery = `{ Jobs (where: { processInstanceId: { equal: "${instanceId}" } }) { id, processId, processInstanceId, rootProcessId, status, expirationTime, priority, callbackEndpoint, repeatInterval, repeatLimit, scheduledId, retries, lastUpdate, endpoint, nodeInstanceId, executionCounter } }`; + const graphQlQuery = `{ Jobs (where: { processInstanceId: { equal: "${instanceId}" } }) { id, processId, processInstanceId, rootProcessId, status, expirationTime, priority, callbackEndpoint, repeatInterval, repeatLimit, scheduledId, retries, endpoint, nodeInstanceId, executionCounter } }`; const result = await this.client.query(graphQlQuery, {}); @@ -214,7 +214,7 @@ export class DataIndexService { public async fetchProcessInstance( instanceId: string, ): Promise { - const graphQlQuery = `{ ProcessInstances (where: { id: {equal: "${instanceId}" } } ) { id, processName, processId, businessKey, state, start, lastUpdate, end, nodes { id, nodeId, definitionId, type, name, enter, exit }, variables, parentProcessInstance {id, processName, businessKey}, error { nodeDefinitionId, message} } }`; + const graphQlQuery = `{ ProcessInstances (where: { id: {equal: "${instanceId}" } } ) { id, processName, processId, businessKey, state, start, end, nodes { id, nodeId, definitionId, type, name, enter, exit }, variables, parentProcessInstance {id, processName, businessKey}, error { nodeDefinitionId, message} } }`; const result = await this.client.query(graphQlQuery, {}); diff --git a/plugins/orchestrator-common/src/models.ts b/plugins/orchestrator-common/src/models.ts index 7859422232..71c99d4253 100644 --- a/plugins/orchestrator-common/src/models.ts +++ b/plugins/orchestrator-common/src/models.ts @@ -72,7 +72,6 @@ export interface ProcessInstance { childProcessInstances?: ProcessInstance[]; error?: ProcessInstanceError; addons?: string[]; - lastUpdate: Date; businessKey?: string; isSelected?: boolean; errorMessage?: string; @@ -106,7 +105,6 @@ export interface Job { repeatLimit: number; scheduledId: string; retries: number; - lastUpdate: Date; executionCounter?: number; endpoint?: string; nodeInstanceId?: string; diff --git a/plugins/orchestrator/src/__fixtures__/fakeLongProcessInstanceList.ts b/plugins/orchestrator/src/__fixtures__/fakeLongProcessInstanceList.ts index 0d3f014245..cceba3db19 100644 --- a/plugins/orchestrator/src/__fixtures__/fakeLongProcessInstanceList.ts +++ b/plugins/orchestrator/src/__fixtures__/fakeLongProcessInstanceList.ts @@ -51,7 +51,6 @@ export const generateFakeProcessInstances = ( state: randomState, endpoint: 'enpoint/foo', start: valuesGenerator.getNextDate(), - lastUpdate: valuesGenerator.getNextDate(), nodes: [], variables: {}, isOpen: false, diff --git a/plugins/orchestrator/src/__fixtures__/fakeProcessInstance.ts b/plugins/orchestrator/src/__fixtures__/fakeProcessInstance.ts index 9fca34521c..ab97a21d24 100644 --- a/plugins/orchestrator/src/__fixtures__/fakeProcessInstance.ts +++ b/plugins/orchestrator/src/__fixtures__/fakeProcessInstance.ts @@ -18,7 +18,6 @@ export const fakeProcessInstance1: ProcessInstance = { state: ProcessInstanceState.Error, start: baseDate, end: new Date(baseDate.getTime() + 13 * HOUR), - lastUpdate: new Date(baseDate.getTime() + DAY), nodes: [], endpoint: 'enpoint/foo', serviceUrl: 'service/bar', @@ -55,7 +54,6 @@ export const fakeCompletedInstance: ProcessInstance = { state: ProcessInstanceState.Completed, start: new Date(baseDate.getTime() + HOUR), end: new Date(baseDate.getTime() + DAY), - lastUpdate: new Date(baseDate.getTime() + DAY), nodes: [], variables: {}, endpoint: 'enpoint/foo', @@ -71,7 +69,6 @@ export const fakeActiveInstance: ProcessInstance = { processId: fakeWorkflowOverviewList[2].workflowId, state: ProcessInstanceState.Active, start: new Date(baseDate.getTime() + 2 * HOUR), - lastUpdate: new Date(baseDate.getTime() + DAY), nodes: [], variables: {}, endpoint: 'enpoint/foo', @@ -87,7 +84,6 @@ export const fakeProcessInstance4: ProcessInstance = { processId: fakeWorkflowOverviewList[3].workflowId, state: ProcessInstanceState.Suspended, start: baseDate, - lastUpdate: new Date(baseDate.getTime() + 2 * DAY), nodes: [], variables: {}, endpoint: 'enpoint/foo',