private void PersistMessage()
            {
                var cached = _graph.Caches[_message.GetType()].Locate(_message);

                _graph.Persist();
                _graph.SelectTimeStamp();
                var cache = _graph.Caches[_message.GetType()];

                _message = (EPActivity)cache.CreateCopy(cached);
            }
            private void PersistException(Exception ex)
            {
                this._graph.Clear();
                if (_message == null || _message.TaskID < 0)
                {
                    return;
                }

                _message = PXSelect <EPActivity, Where <EPActivity.taskID, Equal <Required <EPActivity.taskID> > > > .SelectWindowed(_graph, 0, 1, _message.TaskID);

                if (_message != null)
                {
                    _message           = (EPActivity)_graph.Caches[_message.GetType()].CreateCopy(_message);
                    _message.Exception = ex.Message;
                    _message.MPStatus  = MailStatusListAttribute.Failed;
                    UpdateMessage();
                    PersistMessage();
                }
            }