@@ -48,6 +48,7 @@ internal static void Enrich(WorkflowInstance workflow, string action)
48
48
}
49
49
}
50
50
51
+
51
52
internal static void Enrich ( WorkflowStep workflowStep )
52
53
{
53
54
var activity = Activity . Current ;
@@ -57,10 +58,18 @@ internal static void Enrich(WorkflowStep workflowStep)
57
58
? "inline"
58
59
: workflowStep . Name ;
59
60
60
- activity . DisplayName += $ " step { stepName } ";
61
+ if ( string . IsNullOrEmpty ( activity . DisplayName ) )
62
+ {
63
+ activity . DisplayName = $ "step { stepName } ";
64
+ }
65
+ else
66
+ {
67
+ activity . DisplayName += $ " step { stepName } ";
68
+ }
69
+
61
70
activity . SetTag ( "workflow.step.id" , workflowStep . Id ) ;
62
71
activity . SetTag ( "workflow.step.name" , stepName ) ;
63
- activity . SetTag ( "workflow.step.type" , workflowStep . BodyType . Name ) ;
72
+ activity . SetTag ( "workflow.step.type" , workflowStep . BodyType ? . Name ) ;
64
73
}
65
74
}
66
75
@@ -69,10 +78,10 @@ internal static void Enrich(WorkflowExecutorResult result)
69
78
var activity = Activity . Current ;
70
79
if ( activity != null )
71
80
{
72
- activity . SetTag ( "workflow.subscriptions.count" , result . Subscriptions . Count ) ;
73
- activity . SetTag ( "workflow.errors.count" , result . Errors . Count ) ;
81
+ activity . SetTag ( "workflow.subscriptions.count" , result ? . Subscriptions ? . Count ) ;
82
+ activity . SetTag ( "workflow.errors.count" , result ? . Errors ? . Count ) ;
74
83
75
- if ( result . Errors . Count > 0 )
84
+ if ( result ? . Errors ? . Count > 0 )
76
85
{
77
86
activity . SetStatus ( Status . Error ) ;
78
87
activity . SetStatus ( ActivityStatusCode . Error ) ;
@@ -85,10 +94,10 @@ internal static void Enrich(Event evt)
85
94
var activity = Activity . Current ;
86
95
if ( activity != null )
87
96
{
88
- activity . DisplayName = $ "workflow process { evt . EventName } ";
89
- activity . SetTag ( "workflow.event.id" , evt . Id ) ;
90
- activity . SetTag ( "workflow.event.name" , evt . EventName ) ;
91
- activity . SetTag ( "workflow.event.processed" , evt . IsProcessed ) ;
97
+ activity . DisplayName = $ "workflow process { evt ? . EventName } ";
98
+ activity . SetTag ( "workflow.event.id" , evt ? . Id ) ;
99
+ activity . SetTag ( "workflow.event.name" , evt ? . EventName ) ;
100
+ activity . SetTag ( "workflow.event.processed" , evt ? . IsProcessed ) ;
92
101
}
93
102
}
94
103
0 commit comments