/// <inheritdoc/>
        public virtual async Task HandleAsync(V1WorkflowActivityStartedDomainEvent e, CancellationToken cancellationToken = default)
        {
            var metrics = await this.GetOrCreateV1OperationalReportsForAsync(e.CreatedAt, cancellationToken);

            metrics.RunningActivities++;
            await this.OperationalReports.UpdateAsync(metrics, cancellationToken);

            await this.OperationalReports.SaveChangesAsync(cancellationToken);
        }
Exemple #2
0
        /// <inheritdoc/>
        public virtual async Task HandleAsync(V1WorkflowActivityStartedDomainEvent e, CancellationToken cancellationToken = default)
        {
            var activity = await this.GetOrReconcileProjectionAsync(e.AggregateId, cancellationToken);

            activity.LastModified = e.CreatedAt.UtcDateTime;
            activity.StartedAt    = e.CreatedAt.UtcDateTime;
            activity.Status       = V1WorkflowActivityStatus.Running;
            await this.Projections.UpdateAsync(activity, cancellationToken);

            await this.Projections.SaveChangesAsync(cancellationToken);

            await this.UpdateParentWorkflowInstanceAsync(activity, cancellationToken);

            await this.PublishIntegrationEventAsync(e, cancellationToken);
        }
 /// <summary>
 /// Handles the specified <see cref="V1WorkflowActivityStartedDomainEvent"/>
 /// </summary>
 /// <param name="e">The <see cref="V1WorkflowActivityStartedDomainEvent"/> to handle</param>
 protected virtual void On(V1WorkflowActivityStartedDomainEvent e)
 {
     this.LastModified = e.CreatedAt;
     this.StartedAt    = e.CreatedAt;
     this.Status       = V1WorkflowActivityStatus.Running;
 }