Skip to content

Commit

Permalink
chore(orchestrator): decommission the ProcessInstance.lastUpdate field
Browse files Browse the repository at this point in the history
  • Loading branch information
jkilzi committed Feb 20, 2024
1 parent 65a5fd1 commit a408f27
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
8 changes: 4 additions & 4 deletions plugins/orchestrator-backend/src/service/DataIndexService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class DataIndexService {

public async fetchProcessInstances(): Promise<ProcessInstance[] | undefined> {
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, {});

Expand Down Expand Up @@ -163,7 +163,7 @@ export class DataIndexService {
limit: number,
offset: number,
): Promise<ProcessInstance[]> {
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, {});

Expand All @@ -180,7 +180,7 @@ export class DataIndexService {
public async fetchProcessInstanceJobs(
instanceId: string,
): Promise<Job[] | undefined> {
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, {});

Expand Down Expand Up @@ -214,7 +214,7 @@ export class DataIndexService {
public async fetchProcessInstance(
instanceId: string,
): Promise<ProcessInstance | undefined> {
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, {});

Expand Down
2 changes: 0 additions & 2 deletions plugins/orchestrator-common/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export interface ProcessInstance {
childProcessInstances?: ProcessInstance[];
error?: ProcessInstanceError;
addons?: string[];
lastUpdate: Date;
businessKey?: string;
isSelected?: boolean;
errorMessage?: string;
Expand Down Expand Up @@ -106,7 +105,6 @@ export interface Job {
repeatLimit: number;
scheduledId: string;
retries: number;
lastUpdate: Date;
executionCounter?: number;
endpoint?: string;
nodeInstanceId?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export const generateFakeProcessInstances = (
state: randomState,
endpoint: 'enpoint/foo',
start: valuesGenerator.getNextDate(),
lastUpdate: valuesGenerator.getNextDate(),
nodes: [],
variables: {},
isOpen: false,
Expand Down
4 changes: 0 additions & 4 deletions plugins/orchestrator/src/__fixtures__/fakeProcessInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down

0 comments on commit a408f27

Please sign in to comment.