diff --git a/src/core/Elsa.Core/Handlers/WriteWorkflowExecutionLog.cs b/src/core/Elsa.Core/Handlers/WriteWorkflowExecutionLog.cs index 2abe8b6b5..f1297d92e 100644 --- a/src/core/Elsa.Core/Handlers/WriteWorkflowExecutionLog.cs +++ b/src/core/Elsa.Core/Handlers/WriteWorkflowExecutionLog.cs @@ -55,7 +55,7 @@ namespace Elsa.Handlers var data = new { - exception = exceptionModel + Exception = exceptionModel }; await WriteEntryAsync("Faulted", exception.Message, notification.ActivityExecutionContext, data, cancellationToken); diff --git a/src/designer/elsa-workflows-studio/src/components/screens/workflow-instance-viewer/elsa-workflow-instance-journal/elsa-workflow-instance-journal.tsx b/src/designer/elsa-workflows-studio/src/components/screens/workflow-instance-viewer/elsa-workflow-instance-journal/elsa-workflow-instance-journal.tsx index 00d982fb3..791826629 100644 --- a/src/designer/elsa-workflows-studio/src/components/screens/workflow-instance-viewer/elsa-workflow-instance-journal/elsa-workflow-instance-journal.tsx +++ b/src/designer/elsa-workflows-studio/src/components/screens/workflow-instance-viewer/elsa-workflow-instance-journal/elsa-workflow-instance-journal.tsx @@ -4,7 +4,7 @@ import moment from 'moment'; import {enter, leave, toggle} from 'el-transition' import { ActivityBlueprint, - ActivityDescriptor, PagedList, WorkflowBlueprint, WorkflowExecutionLogRecord, WorkflowModel, + ActivityDescriptor, PagedList, SimpleException, WorkflowBlueprint, WorkflowExecutionLogRecord, WorkflowModel, } from "../../../../models"; import {activityIconProvider} from "../../../../services/activity-icon-provider"; import {createElsaClient} from "../../../../services/elsa-client"; @@ -238,21 +238,14 @@ export class ElsaWorkflowInstanceJournal { const recordClass = record.id === selectedRecordId ? 'elsa-border-blue-600' : 'hover:elsa-bg-gray-100 elsa-border-transparent'; const recordData = record.data || {}; const filteredRecordData = {}; + const wellknownDataKeys = {State: true, Input: null, Outcomes: true, Exception: true}; for (const key in recordData) { if (!recordData.hasOwnProperty(key)) continue; - const lowerKey = key.toLowerCase(); - - if (lowerKey == 'state') - continue; - - if (lowerKey == 'input') - continue; - - if (lowerKey == 'outcomes') + if (!!wellknownDataKeys[key]) continue; const value = recordData[key]; @@ -276,6 +269,20 @@ export class ElsaWorkflowInstanceJournal { const deltaTimeText = durationToString(deltaTime); const outcomes = !!recordData.Outcomes ? recordData.Outcomes || [] : []; + const exception = !!recordData.Exception ? recordData.Exception : null; + + const renderExceptionMessage = (exception: any) => { + //const exceptionList = flattenExceptions(exception); + return ( +
+
+ {exception.Type} + {exception.Message} +
+ {!!exception.InnerException ?
{renderExceptionMessage(exception.InnerException)}
: undefined} +
+ ); + } return (
  • @@ -327,15 +334,7 @@ export class ElsaWorkflowInstanceJournal { ) : undefined} - {collection.map(filteredRecordData, (v, k) => ( -
    -
    {k}
    -
    -
     clip(e.currentTarget)}>{v}
    -
    -
    - ))} - {record.message ? ( + {!!record.message && !exception ? (
    Message @@ -345,6 +344,32 @@ export class ElsaWorkflowInstanceJournal {
    ) : undefined} + {!!exception ? ( + [
    +
    + Exception +
    +
    + {renderExceptionMessage(exception)} +
    +
    , +
    +
    + Exception Details +
    +
    +
     clip(e.currentTarget)}>{JSON.stringify(exception, null, 1)}
    +
    +
    ] + ) : undefined} + {collection.map(filteredRecordData, (v, k) => ( +
    +
    {k}
    +
    +
     clip(e.currentTarget)}>{v}
    +
    +
    + ))}