@@ -224,21 +224,7 @@ public void Validate(List<WorkflowIssue> issuesContainer, Action<WorkflowGateway
224224
225225 if ( e . Type . IsTimer ( ) )
226226 {
227- if ( e . Type == WorkflowEventType . BoundaryInterruptingTimer )
228- {
229- var activity = Activities . GetOrThrow ( e . BoundaryOf ! ) ;
230- if ( string . IsNullOrWhiteSpace ( e . DecisionOptionName ) && activity . Type == WorkflowActivityType . Decision )
231- issues . AddError ( e , WorkflowValidationMessage . BoundaryTimer0OfActivity1ShouldHave2BecauseActivityIs3 . NiceToString ( e , activity , e . NicePropertyName ( a => a . DecisionOptionName ) , WorkflowActivityType . Decision . NiceToString ( ) ) ) ;
232-
233- if ( ! string . IsNullOrWhiteSpace ( e . DecisionOptionName ) && activity . Type != WorkflowActivityType . Decision )
234- issues . AddError ( e , WorkflowValidationMessage . BoundaryTimer0OfActivity1CanNotHave2BecauseActivityIsNot3 . NiceToString ( e , activity , e . NicePropertyName ( a => a . DecisionOptionName ) , WorkflowActivityType . Decision . NiceToString ( ) ) ) ;
235-
236- if ( ! string . IsNullOrWhiteSpace ( e . DecisionOptionName ) && ! activity . DecisionOptions . Any ( a => a . Name == e . DecisionOptionName ) )
237- issues . AddError ( e , WorkflowValidationMessage . BoundaryTimer0OfActivity1HasInvalid23 . NiceToString ( e , activity , e . NicePropertyName ( a => a . DecisionOptionName ) , e . DecisionOptionName ) ) ;
238- }
239-
240227 var boundaryOutput = NextConnections ( e ) . Only ( ) ;
241-
242228 if ( boundaryOutput == null || boundaryOutput . Type != ConnectionType . Normal )
243229 {
244230 if ( e . Type == WorkflowEventType . IntermediateTimer )
@@ -252,6 +238,19 @@ public void Validate(List<WorkflowIssue> issuesContainer, Action<WorkflowGateway
252238
253239 if ( e . Type == WorkflowEventType . IntermediateTimer && ! e . Name . HasText ( ) )
254240 issues . AddError ( e , WorkflowValidationMessage . IntermediateTimer0ShouldHaveName . NiceToString ( e ) ) ;
241+
242+ if ( e . Type == WorkflowEventType . BoundaryInterruptingTimer )
243+ {
244+ var parentActivity = Activities . Values . Where ( a => a . BoundaryTimers . Contains ( e ) ) . SingleEx ( ) ;
245+ if ( string . IsNullOrWhiteSpace ( e . DecisionOptionName ) && parentActivity . Type == WorkflowActivityType . Decision )
246+ issues . AddError ( e , WorkflowValidationMessage . BoundaryTimer0OfActivity1ShouldHave2BecauseActivityIs3 . NiceToString ( e , parentActivity , e . NicePropertyName ( a => a . DecisionOptionName ) , WorkflowActivityType . Decision . NiceToString ( ) ) ) ;
247+
248+ if ( ! string . IsNullOrWhiteSpace ( e . DecisionOptionName ) && parentActivity . Type != WorkflowActivityType . Decision )
249+ issues . AddError ( e , WorkflowValidationMessage . BoundaryTimer0OfActivity1CanNotHave2BecauseActivityIsNot3 . NiceToString ( e , parentActivity , e . NicePropertyName ( a => a . DecisionOptionName ) , WorkflowActivityType . Decision . NiceToString ( ) ) ) ;
250+
251+ if ( ! string . IsNullOrWhiteSpace ( e . DecisionOptionName ) && ! parentActivity . DecisionOptions . Any ( a => a . Name == e . DecisionOptionName ) )
252+ issues . AddError ( e , WorkflowValidationMessage . BoundaryTimer0OfActivity1HasInvalid23 . NiceToString ( e , parentActivity , e . NicePropertyName ( a => a . DecisionOptionName ) , e . DecisionOptionName ) ) ;
253+ }
255254 }
256255 } ) ;
257256
0 commit comments