mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
647db9635a
* Renaming Microsoft.Agent.Workflows to Microsoft.Agents.AI.Workflows * Removing local settings. * Removing remining old files from merge.
32 lines
1017 B
C#
32 lines
1017 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System.Text.Json.Serialization;
|
|
using Microsoft.Agents.AI.Workflows.Execution;
|
|
|
|
namespace Microsoft.Agents.AI.Workflows.Checkpointing;
|
|
|
|
/// <summary>
|
|
/// Represents a fan-out <see cref="Edge"/> in the <see cref="Workflow"/>.
|
|
/// </summary>
|
|
public sealed class FanOutEdgeInfo : EdgeInfo
|
|
{
|
|
internal FanOutEdgeInfo(FanOutEdgeData data) : this(data.EdgeAssigner is not null, data.Connection) { }
|
|
|
|
[JsonConstructor]
|
|
internal FanOutEdgeInfo(bool hasAssigner, EdgeConnection connection) : base(EdgeKind.FanOut, connection)
|
|
{
|
|
this.HasAssigner = hasAssigner;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets a value indicating whether this fan-out edge has an edge-assigner associated with it.
|
|
/// </summary>
|
|
public bool HasAssigner { get; }
|
|
|
|
internal override bool IsMatchInternal(EdgeData edgeData)
|
|
{
|
|
return edgeData is FanOutEdgeData fanOutEdge
|
|
&& this.HasAssigner == (fanOutEdge.EdgeAssigner is not null);
|
|
}
|
|
}
|