Skip to content

Commit 2334eee

Browse files
from PropertyValidation to PreSaving + add DecisionOptionName to default query
1 parent 0537a93 commit 2334eee

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Signum.Engine.Extensions/Workflow/WorkflowLogic.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ from e in Database.Query<WorkflowEntity>()
297297
e.Lane,
298298
e.Lane.Pool.Workflow,
299299
e.RunRepeatedly,
300+
e.DecisionOptionName,
300301
});
301302

302303

Signum.Entities.Extensions/Workflow/WorkflowEvent.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ public class WorkflowEventEntity : Entity, IWorkflowNodeEntity, IWithModel
1919

2020
public bool RunRepeatedly { get; set; }
2121

22-
[StringLengthValidator(Min = 3, Max = 100)]
22+
[StringLengthValidator(Min = 3, Max = 100)]
2323
public string? DecisionOptionName { get; set; }
2424

25-
public WorkflowTimerEmbedded? Timer { get; set; }
25+
26+
public WorkflowTimerEmbedded? Timer { get; set; }
2627

2728
public Lite<WorkflowActivityEntity>? BoundaryOf { get; set; }
2829

@@ -62,15 +63,15 @@ public void SetModel(ModelEntity model)
6263
//WorkflowEventTaskModel.ApplyModel(this, wModel.Task);
6364
}
6465

65-
protected override string? PropertyValidation(PropertyInfo pi)
66+
protected override void PreSaving(PreSavingContext ctx)
6667
{
67-
if (pi.Name == nameof(RunRepeatedly) && RunRepeatedly && Type != WorkflowEventType.BoundaryForkTimer)
68+
if (Type != WorkflowEventType.BoundaryForkTimer && RunRepeatedly)
6869
RunRepeatedly = false;
6970

70-
if (pi.Name == nameof(DecisionOptionName) && !string.IsNullOrWhiteSpace(DecisionOptionName) && Type != WorkflowEventType.BoundaryInterruptingTimer)
71+
if (Type != WorkflowEventType.BoundaryInterruptingTimer && !string.IsNullOrWhiteSpace(DecisionOptionName))
7172
DecisionOptionName = null;
7273

73-
return base.PropertyValidation(pi);
74+
base.PreSaving(ctx);
7475
}
7576
}
7677

0 commit comments

Comments
 (0)