Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<!-- Version Info -->
<PropertyGroup>
<MajorVersion>0</MajorVersion>
<MinorVersion>7</MinorVersion>
<PatchVersion>1</PatchVersion>
<MinorVersion>8</MinorVersion>
<PatchVersion>0</PatchVersion>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<FileVersion>$(VersionPrefix).0</FileVersion>
<!-- FileVersionRevision is expected to be set by the CI. This is useful for distinguishing between multiple builds of the same version. -->
Expand Down
4 changes: 2 additions & 2 deletions src/DurableTask.AzureStorage/DurableTask.AzureStorage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<!-- Version Info -->
<PropertyGroup>
<MajorVersion>2</MajorVersion>
<MinorVersion>6</MinorVersion>
<PatchVersion>1</PatchVersion>
<MinorVersion>7</MinorVersion>
<PatchVersion>0</PatchVersion>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<FileVersion>$(VersionPrefix).0</FileVersion>
<!-- FileVersionRevision is expected to be set by the CI. This is useful for distinguishing between multiple builds of the same version. -->
Expand Down
5 changes: 5 additions & 0 deletions src/DurableTask.Core/Command/OrchestratorActionType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,10 @@ public enum OrchestratorActionType
/// The orchestrator completed.
/// </summary>
OrchestrationComplete,

/// <summary>
/// The orchestration was rewound.
/// </summary>
RewindOrchestration,
}
}
25 changes: 25 additions & 0 deletions src/DurableTask.Core/Command/RewindOrchestrationAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ----------------------------------------------------------------------------------
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------
#nullable enable
namespace DurableTask.Core.Command
{

/// <summary>
/// Orchestrator action for rewinding orchestrations.
/// </summary>
public class RewindOrchestrationAction : OrchestratorAction
{
/// <inheritdoc/>
public override OrchestratorActionType OrchestratorActionType => OrchestratorActionType.RewindOrchestration;
}
}
4 changes: 2 additions & 2 deletions src/DurableTask.Core/DurableTask.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<!-- Version Info -->
<PropertyGroup>
<MajorVersion>3</MajorVersion>
<MinorVersion>5</MinorVersion>
<PatchVersion>1</PatchVersion>
<MinorVersion>6</MinorVersion>
<PatchVersion>0</PatchVersion>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<FileVersion>$(VersionPrefix).0</FileVersion>
<!-- FileVersionRevision is expected to be set by the CI. This is useful for distinguishing between multiple builds of the same version. -->
Expand Down
5 changes: 5 additions & 0 deletions src/DurableTask.Core/History/EventType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,10 @@ public enum EventType
/// Orchestration was resumed event
/// </summary>
ExecutionResumed,

/// <summary>
/// Orchestration was rewound event.
/// </summary>
ExecutionRewound,
}
}
71 changes: 71 additions & 0 deletions src/DurableTask.Core/History/ExecutionRewoundEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// ----------------------------------------------------------------------------------
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------
#nullable enable
namespace DurableTask.Core.History
{
using DurableTask.Core.Tracing;
using System.Runtime.Serialization;

/// <summary>
/// Generic History event
/// </summary>
[DataContract]
public class ExecutionRewoundEvent : HistoryEvent, ISupportsDurableTraceContext
{
/// <summary>
/// Creates a new ExecutionRewoundEvent with the supplied event id and empty reason.
/// </summary>
/// <param name="eventId">The integer event id</param>
public ExecutionRewoundEvent(int eventId) : base(eventId) { }

/// <summary>
/// Creates a new ExecutionRewoundEvent with the supplied event id and reason.
/// </summary>
/// <param name="eventId">The integer event id</param>
/// <param name="reason">The reason for the rewind event</param>
public ExecutionRewoundEvent(int eventId, string? reason)
: base(eventId)
{
this.Reason = reason;
}

/// <summary>
/// Gets the event type
/// </summary>
public override EventType EventType => EventType.ExecutionRewound;

/// <summary>
/// Gets or sets the reason for the rewind event.
/// </summary>
[DataMember]
public string? Reason { get; set; }

/// <summary>
/// Gets or sets the parent execution id of the rewound suborchestration.
/// </summary>
[DataMember]
public string? ParentExecutionId { get; set; }

/// <summary>
/// Gets or sets the instance ID of the rewound orchestration.
/// </summary>
[DataMember]
public string? InstanceId { get; set; }

/// <summary>
/// Gets or sets the parent trace context of the rewound suborchestration.
/// </summary>
[DataMember]
public DistributedTraceContext? ParentTraceContext { get; set; }
}
}
25 changes: 25 additions & 0 deletions src/DurableTask.Core/History/ExecutionStartedEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,31 @@ internal ExecutionStartedEvent()
{
}

/// <summary>
/// Creates a new ExecutionStartedEvent with the same fields as <paramref name="other"/>.
/// A deep copy is performed on all non-base class fields.
/// </summary>
internal ExecutionStartedEvent(ExecutionStartedEvent other)
{
// Copy base class fields
EventId = other.EventId;
Timestamp = other.Timestamp;
ExtensionData = other.ExtensionData;
IsPlayed = other.IsPlayed;

// Deep copy all other fields
OrchestrationInstance = other.OrchestrationInstance?.Clone();
ParentInstance = other.ParentInstance?.Clone();
ParentTraceContext = other.ParentTraceContext?.Clone();
Input = other.Input;
Name = other.Name;
Version = other.Version;
Tags = other.Tags != null ? new Dictionary<string, string>(other.Tags) : null;
Correlation = other.Correlation;
ScheduledStartTime = other.ScheduledStartTime;
Generation = other.Generation;
}

/// <summary>
/// Gets the event type
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@ public SubOrchestrationInstanceCreatedEvent(int eventId)
{
}

/// <summary>
/// Creates a new ExecutionStartedEvent with the same fields as <paramref name="other"/>.
/// </summary>
internal SubOrchestrationInstanceCreatedEvent(SubOrchestrationInstanceCreatedEvent other)
{
// Copy base class fields
EventId = other.EventId;
Timestamp = other.Timestamp;
ExtensionData = other.ExtensionData;
IsPlayed = other.IsPlayed;

// Copy all other fields
Name = other.Name;
Version = other.Version;
InstanceId = other.InstanceId;
Input = other.Input;
ClientSpanId = other.ClientSpanId;
}

/// <summary>
/// Gets the event type
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/DurableTask.Core/OrchestrationStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ public enum OrchestrationStatus
/// <summary>
/// Orchestration state of suspended
/// </summary>
Suspended,
Suspended
}
}
Loading
Loading