Skip to content

Commit

Permalink
Refactor conditionals and class names
Browse files Browse the repository at this point in the history
Adjusted logical conditions in ParameterizedQueryBuilderExtensions and For activity to work as expected. The former's conditional for IsLatestAndPublished now correctly uses 'and' while the latter properly increments currentValue. Renamed BulkCancel Endpoint class in WorkflowInstances to more accurately represent its purpose.
  • Loading branch information
sfmskywalker committed Jan 3, 2024
1 parent 1d366a5 commit 8e73d7a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public static ParameterizedQuery Is(this ParameterizedQuery query, VersionOption
if (options.IsLatest) sql.AppendLine("and IsLatest = 1");
if (options.IsPublished) sql.AppendLine("and IsPublished = 1");
if (options.IsLatestOrPublished) sql.AppendLine("and (IsLatest = 1 or IsPublished = 1)");
if (options.IsLatestAndPublished) sql.AppendLine("and IsLatest = 1 or IsPublished = 1");
if (options.IsLatestAndPublished) sql.AppendLine("and IsLatest = 1 and IsPublished = 1");
if (options.Version > 0)
{
sql.AppendLine(query.Dialect.And("Version"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Elsa.Workflows.Api.Endpoints.WorkflowInstances.BulkCancel;

public class Endpoint : ElsaEndpoint<Request, Response>
public class BulkCancel : ElsaEndpoint<Request, Response>
{
public override void Configure()
{
Expand Down
2 changes: 1 addition & 1 deletion src/modules/Elsa.Workflows.Core/Activities/For.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private async ValueTask HandleIteration(ActivityExecutionContext context)
var inclusive = context.Get(OuterBoundInclusive);
var increment = step >= 0;

currentValue = currentValue == null ? start : (currentValue + step);
currentValue = currentValue == null ? start : currentValue + step;

var isBreaking = context.GetIsBreaking();

Expand Down

0 comments on commit 8e73d7a

Please sign in to comment.