Exemplo n.º 1
0
        /// <summary>
        /// Configure mapper and finds process manager data using configured ProcessManagerFinder
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        public virtual IPersistanceData <T> FindProcessManagerData(Message message)
        {
            // FindProcessManagerData is always called on new instance of ProcessManager<T>
            _mapper = new ProcessManagerPropertyMapper();

            ConfigureHowToFindProcessManager(_mapper);

            // Default mapping
            _mapper.ConfigureMapping <IProcessManagerData, Message>(m => m.CorrelationId, pm => pm.CorrelationId);

            return(ProcessManagerFinder.FindData <T>(_mapper, message));
        }
Exemplo n.º 2
0
        protected virtual void RequestTimeout(TimeSpan timeout)
        {
            var timeoutData = new TimeoutData
            {
                Destination      = Context.Headers["DestinationAddress"].ToString(),
                ProcessManagerId = Data.CorrelationId,
                Headers          = Context.Headers,
                Id   = Guid.NewGuid(),
                Time = DateTime.UtcNow.Add(timeout)
            };

            ProcessManagerFinder.InsertTimeout(timeoutData);
        }