Exemplo n.º 1
0
        public async Task <Result> BulkDeleteDrafts(List <string> id)
        {
            int    count  = 0;
            Result result = new Result();

            try
            {
                foreach (string tempId in id)
                {
                    Document doc = _repo.GetById <Document>(Convert.ToInt32(tempId));
                    _repo.Delete(doc);

                    WorkflowInbox wf = await _repo.GetFirstAsync <WorkflowInbox>(
                        filter : f => f.DocumentId == tempId);

                    _repo.Delete(wf);
                    _repo.Save();
                    count++;
                    result.Success = true;
                }
            }
            catch (Exception e)
            {
                result.Message   = "Error deleting draft.";
                result.ErrorCode = ErrorCode.EXCEPTION;
                _logger.LogError("Error calling BulkDeleteDrafts: {0}", e.Message);
            }

            return(result);
        }
Exemplo n.º 2
0
        private static void FillInbox(Guid processId, DataModelDataContext context)
        {
            var newActors = Runtime.GetAllActorsForDirectCommandTransitions(processId);

            foreach (var newActor in newActors)
            {
                var newInboxItem = new WorkflowInbox()
                {
                    Id = Guid.NewGuid(), IdentityId = new Guid(newActor), ProcessId = processId
                };
                context.WorkflowInboxes.InsertOnSubmit(newInboxItem);
            }
        }
        private static void FillInbox(Guid processId, Raven.Client.IDocumentSession session)
        {
            var newActors = Runtime.GetAllActorsForDirectCommandTransitions(processId);

            foreach (var newActor in newActors)
            {
                var newInboxItem = new WorkflowInbox()
                {
                    IdentityId = newActor, ProcessId = processId
                };
                session.Store(newInboxItem);
            }
        }
Exemplo n.º 4
0
        public void FillInbox(Guid processId, WorkflowRuntime workflowRuntime)
        {
            var newActors = workflowRuntime.GetAllActorsForDirectCommandTransitions(processId);

            foreach (var newActor in newActors)
            {
                var newInboxItem = new WorkflowInbox()
                {
                    Id = Guid.NewGuid(), IdentityId = newActor, ProcessId = processId
                };
                _sampleContext.WorkflowInboxes.Add(newInboxItem);
            }
            _sampleContext.SaveChanges();
        }
Exemplo n.º 5
0
        public void FillInbox(Guid processId, WorkflowRuntime workflowRuntime)
        {
            var pi        = WorkflowInit.Runtime.GetProcessInstanceAndFillProcessParameters(processId);
            var newActors = WorkflowInit.Runtime.GetAllActorsForAllCommandTransitions(processId, true, pi.CurrentActivityName);

            foreach (var newActor in newActors)
            {
                var newInboxItem = new WorkflowInbox()
                {
                    Id = Guid.NewGuid(), IdentityId = newActor, ProcessId = processId
                };
                _sampleContext.WorkflowInboxes.Add(newInboxItem);
            }
            _sampleContext.SaveChanges();
        }
 private static void FillInbox(Guid processId, DataModelDataContext context)
 {
     var newActors = Runtime.GetAllActorsForDirectCommandTransitions(processId);
     foreach (var newActor in newActors)
     {
         var newInboxItem = new WorkflowInbox() { Id = Guid.NewGuid(), IdentityId = new Guid(newActor), ProcessId = processId };
         context.WorkflowInboxes.InsertOnSubmit(newInboxItem);
     }
 }