private void SelectErrorStrategy(WorkflowErrorHandling errorOption, WorkflowInstance workflow, WorkflowDefinition def, ExecutionPointer pointer, WorkflowStep step) { switch (errorOption) { case WorkflowErrorHandling.Retry: if (pointer.RetryCount >= def.DefaultErrorRetryLimit) { workflow.Status = WorkflowStatus.Suspended; break; } pointer.RetryCount++; pointer.SleepUntil = Clock.Now.ToUniversalTime().Add(step.RetryInterval ?? def.DefaultErrorRetryInterval ?? _options.ErrorRetryInterval); step.PrimeForRetry(pointer); break; case WorkflowErrorHandling.Suspend: workflow.Status = WorkflowStatus.Suspended; break; case WorkflowErrorHandling.Terminate: workflow.Status = WorkflowStatus.Terminated; break; case WorkflowErrorHandling.Compensate: Compensate(workflow, def, pointer); break; } }
public void Handle(WorkflowInstance workflow, WorkflowDefinition def, ExecutionPointer pointer, WorkflowStep step, Exception exception, Queue <ExecutionPointer> bubbleUpQueue) { workflow.Status = WorkflowStatus.Suspended; _eventPublisher.PublishNotification(new WorkflowSuspended { EventTimeUtc = _datetimeProvider.UtcNow, Reference = workflow.Reference, WorkflowInstanceId = workflow.Id, WorkflowDefinitionId = workflow.WorkflowDefinitionId, Version = workflow.Version }); step.PrimeForRetry(pointer); }
public void Handle(WorkflowInstance workflow, WorkflowDefinition def, ExecutionPointer pointer, WorkflowStep step, Exception exception, Queue <ExecutionPointer> bubbleUpQueue) { pointer.RetryCount++; pointer.SleepUntil = _datetimeProvider.UtcNow.Add(step.RetryInterval ?? def.DefaultErrorRetryInterval ?? _options.ErrorRetryInterval); step.PrimeForRetry(pointer); }