Я могу успешно отменить существующий таймер, а также могу установить новый таймер, но новый таймер, похоже, не срабатывает.
Мой метод onEvent в моей оркестрации находит необходимый обработчик событий на основе входных данных, а затем вызывает метод HandleProcess.
Код: Выделить всё
public override async void OnEvent(OrchestrationContext context, string eventName, string input)
{
IEventHandler eventHandler = await context.ScheduleTask(typeof(GetEventHandler), eventName);
EventHandlerInput eventInput = new EventHandlerInput(context, customState, input);
customState = eventHandler.HandleProcess(eventInput);
}
Код: Выделить всё
public CustomOrchestrationState HandleProcess(T input)
{
EventHandlerInput customInput = (input as EventHandlerInput);
if (!customInput.CustomOrchestrationState.AllowActionDateChange)
{
//date change not allowed
throw new Exception();
}
DateTime newDate = new DateTime();
try
{
newDate = Convert.ToDateTime(customInput.EventInput);
}
catch (Exception ex)
{
//Invalid Date format
}
CancellationTokenSource newToken = new CancellationTokenSource();
customInput.OrchestrationContext.CreateTimer(newDate, customInput, newToken.Token);
customInput.CustomOrchestrationState.TimerCancelationToken?.Dispose();
CancelCurrentTimer(customInput.CustomOrchestrationState);
customInput.CustomOrchestrationState.ActionDate = newDate;
customInput.CustomOrchestrationState.TimerCancelationToken = newToken;
return customInput.CustomOrchestrationState;
}

Это ожидаемое поведение или это ошибка? Я что-то упускаю или делаю что-то не так?
Подробнее здесь: https://stackoverflow.com/questions/791 ... not-firing
Мобильная версия