Skip to content

Commit

Permalink
fix(orchestrator): do not show duration when ProcessInstance.end time…
Browse files Browse the repository at this point in the history
… is n/a (#1112)

* chore(orchestrator): renames errorUtils.tsx

* fix(orchestrator): do not show duration when ProcessInstance.end time is n/a
  • Loading branch information
jkilzi authored Jan 24, 2024
1 parent ad11fdf commit 75e6bbe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
executeWorkflowWithBusinessKeyRouteRef,
workflowInstanceRouteRef,
} from '../../routes';
import { getErrorObject } from '../../utils/errorUtils';
import { getErrorObject } from '../../utils/ErrorUtils';
import { BaseOrchestratorPage } from '../BaseOrchestratorPage';
import JsonTextAreaForm from './JsonTextAreaForm';
import StepperForm from './StepperForm';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ import { WorkflowVariablesViewer } from './WorkflowVariablesViewer';
export const mapProcessInstanceToDetails = (
instance: ProcessInstance,
): WorkflowRunDetail => {
const start = moment(instance.start);
const end = moment(instance.end?.toString());
const duration = moment.duration(start.diff(end));
const name = instance.processName || instance.processId;
const businessKey = instance.businessKey;
const name = instance.processName || instance.processId;
const start = moment(instance.start);
let duration: string = VALUE_UNAVAILABLE;
if (instance.end) {
const end = moment(instance.end);
duration = moment.duration(start.diff(end)).humanize();
}

let variables: Record<string, unknown> | undefined;
if (typeof instance?.variables === 'string') {
Expand All @@ -46,7 +49,7 @@ export const mapProcessInstanceToDetails = (
name,
workflow: name,
started: start.toDate().toLocaleString(),
duration: duration.humanize(),
duration,
category: instance.category,
status: instance.state,
description: instance.description,
Expand Down

0 comments on commit 75e6bbe

Please sign in to comment.