Exemplo n.º 1
0
        public static void RecalcInbox()
        {
            using (var context = new DataModelDataContext())
            {
                foreach (var d in WF.Sample.Business.Helpers.DocumentHelper.GetAll())
                {
                    Guid id = d.Id;
                    try
                    {
                        if (_runtime.IsProcessExists(id))
                        {
                            _runtime.UpdateSchemeIfObsolete(id);
                            context.DropWorkflowInbox(id);
                            FillInbox(id, context);

                            context.SubmitChanges();
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(string.Format("Unable to calculate the inbox for process Id = {0}", id), ex);
                    }
                }
            }
        }