Пример #1
0
        private async Task <bool> DoWorkAsync(ProcessBase process, WorkItemBase currentItem)
        {
            try
            {
                WorkLog workLog = await process.DoWorkAsync(this._completedWorkLogs, currentItem);

                // Processo executado mas retorno identifica que o resultado não obteve sucesso, Aborta o fluxo.
                if (workLog.Result.Success == false)
                {
                    this.IsAborted = true;
                    return(CaptureBrokenStep(process, "Cancel Step Based on result."));
                }

                this._doneWorkLogs.Push(workLog);
                this._completedWorkLogs.Add(workLog);

                // Próximo processo será executado
                return(true);
            }
            catch (Exception e)
            {
                this._hasExceptionOccured = true;
                return(CaptureBrokenStep(process, e.Message));
            }
        }