/// <inheritdoc/> public virtual async Task HandleAsync(V1WorkflowActivityExecutedDomainEvent e, CancellationToken cancellationToken = default) { var metrics = await this.GetOrCreateV1OperationalReportsForAsync(e.CreatedAt, cancellationToken); metrics.RunningActivities--; metrics.ExecutedActivities++; switch (e.Status) { case V1WorkflowActivityStatus.Completed: metrics.CompletedActivities++; break; case V1WorkflowActivityStatus.Faulted: metrics.FaultedActivities++; break; case V1WorkflowActivityStatus.Cancelled: metrics.CancelledActivities++; break; case V1WorkflowActivityStatus.Skipped: metrics.SkippedActivities++; break; } await this.OperationalReports.UpdateAsync(metrics, cancellationToken); await this.OperationalReports.SaveChangesAsync(cancellationToken); }
/// <summary> /// Handles the specified <see cref="V1WorkflowActivityExecutedDomainEvent"/> /// </summary> /// <param name="e">The <see cref="V1WorkflowActivityExecutedDomainEvent"/> to handle</param> protected virtual void On(V1WorkflowActivityExecutedDomainEvent e) { this.LastModified = e.CreatedAt; this.ExecutedAt = e.CreatedAt; }
/// <inheritdoc/> public virtual async Task HandleAsync(V1WorkflowActivityExecutedDomainEvent e, CancellationToken cancellationToken = default) { await this.PublishIntegrationEventAsync(e, cancellationToken); }