public void Process() { try { using (var enumerator = _workflow.GetItemEnumerator(_currentWorkflowIndex)) { while (enumerator.MoveNext()) { _currentState = enumerator.Current.Execute(this); _currentWorkflowIndex++; if (_currentState != WorkUnitState.Run) { return; } } } } catch (Exception ex) { OnException(ex, string.Empty); } }
private void OnException(Exception ex, string empty) { _currentState = WorkUnitState.Fail; }