Exemplo n.º 1
0
        public string deleteProcess(int P_ProcessId, bool deleteDBEntries)
        {
            InFlowDb _db       = new InFlowDb(cfgSQLConnectionString);
            var      p_Process = _db.P_Processes.Find(P_ProcessId);


            WorkflowManagementClient client = new WorkflowManagementClient(new Uri(cfgWFMBaseAddress + p_Process.WFM_RootScope + p_Process.WFM_ProcessScope + "/"), credentials);

            client.CleanUp();

            if (deleteDBEntries)
            {
                var p_ProcessInstances = _db.P_ProcessInstance.Where(result => result.P_Process_Id == p_Process.Id).ToList();
                foreach (var i in p_ProcessInstances)
                {
                    _db.T_Tasks.RemoveRange(_db.T_Tasks.Where(result => result.P_ProcessInstance_Id == i.Id));
                    _db.M_Messages.RemoveRange(_db.M_Messages.Where(result => result.ProcessInstance_Id == i.Id));
                }

                _db.P_ProcessInstance.RemoveRange(p_ProcessInstances);

                var p_ProcessSubjects = _db.P_ProcessSubjects.Where(result => result.Process_Id == p_Process.Id).ToList();
                foreach (var ps in p_ProcessSubjects)
                {
                    _db.P_WorkflowInstances.RemoveRange(_db.P_WorkflowInstances.Where(result => result.ProcessSubject_Id == ps.Id));
                }
                _db.P_ProcessSubjects.RemoveRange(p_ProcessSubjects);
                _db.P_Processes.Remove(p_Process);

                _db.SaveChanges();
            }

            return(p_Process.WFM_RootScope + p_Process.WFM_ProcessScope);
        }
Exemplo n.º 2
0
        private void initService()
        {
            if (connectionString == null)
            {
                connectionString = ConfigurationSettings.AppSettings["repositoryConnectionString"].ToString();

                wfmBaseAddress = ConfigurationSettings.AppSettings["wfmBaseAddress"].ToString();
                wfmUsername    = ConfigurationSettings.AppSettings["wfmUsername"].ToString();

                wfmPassword = ConfigurationSettings.AppSettings["wfmPassword"].ToString();

                taskStore    = StoreHandler.getTaskStore(connectionString);
                processStore = StoreHandler.getProcessStore(connectionString);
                userStore    = StoreHandler.getUserStore(connectionString);
                messageStore = StoreHandler.getMessageStore(connectionString);

                _db = new InFlowDb();
            }
        }
Exemplo n.º 3
0
 public SqlProcessStore(string databaseConnectionString)
 {
     db = new InFlowDb(databaseConnectionString);
     connectionString = databaseConnectionString;
 }
Exemplo n.º 4
0
 public SqlConfigStore(InFlowDb db)
 {
     this.db = db;
 }
Exemplo n.º 5
0
 public SqlMessageStore(InFlowDb db)
 {
     this.db = db;
 }