public Task HandleAsync(WorkflowInstance workflow, WorkflowDelegate next) { if (workflow.Data is IDescriptiveWorkflowParams descriptiveParams) { workflow.Description = descriptiveParams.Description; } return(next()); }
public async Task HandleAsync(WorkflowInstance workflow, WorkflowDelegate next) { StartTime = DateTime.UtcNow; await Task.Delay(Delay); await next(); await Task.Delay(Delay); EndTime = DateTime.UtcNow; }
/// <summary> /// Save deletegate task fromuser touser. /// </summary> /// <param name="model">The information delegate task.</param> /// <returns></returns> public ResultViewModel SaveDelegateFromInbox(WorkflowDelegateRequestModel model) { var result = new ResultViewModel(); using (TransactionScope scope = new TransactionScope()) { var data = new WorkflowDelegate { FromUser = _token.AdUser, ToUser = model.ToUser, StartDate = UtilityService.ConvertToDateTime(model.StartDate, ConstantValue.DateTimeFormat), EndDate = UtilityService.ConvertToDateTime(model.EndDate, ConstantValue.DateTimeFormat) }; _unitOfWork.GetRepository <WorkflowDelegate>().Add(data); _k2Service.SetOutofOffice(data.FromUser, data.ToUser, ConstantValue.K2SharingCreate, data.StartDate.Value, data.EndDate.Value); _unitOfWork.Complete(scope); } return(result); }
public Task HandleAsync(WorkflowInstance workflow, WorkflowDelegate next) { if (!workflow.CompleteTime.HasValue) { return(next()); } var duration = workflow.CompleteTime.Value - workflow.CreateTime; _log.LogInformation($@"Workflow {workflow.Description} completed in {duration:g}"); foreach (var step in workflow.ExecutionPointers) { var stepName = step.StepName; var stepDuration = (step.EndTime - step.StartTime) ?? TimeSpan.Zero; _log.LogInformation($" - Step {stepName} completed in {stepDuration:g}"); } return(next()); }