Skip to content

Commit

Permalink
Merge pull request #485 from PHOENIXCONTACT/fix/dead-end-validation
Browse files Browse the repository at this point in the history
Port: Allow DeadEndValidator to pass on workplans with disconnected connectors
  • Loading branch information
1nf0rmagician authored Nov 21, 2024
2 parents 792247f + 6baccdb commit a6eff35
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Moryx/Workflows/Validation/DeadEndValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public bool Validate(IWorkplan workplan, ICollection<ValidationError> errors)
if(connector.Classification.HasFlag(NodeClassification.Exit))
continue;

// or if it is not used as an output anywhere and is not a start connector
if (!workplan.Steps.Any(step => step.Outputs.Contains(connector)) && !connector.Classification.HasFlag(NodeClassification.Entry))
continue;

errors.Add(new DeadEndValidationError(connector.Id));
}
return errors.Count == 0;
Expand Down

0 comments on commit a6eff35

Please sign in to comment.