コード例 #1
0
        /// <summary>
        /// 删除流程已活动过的所有的节点
        /// </summary>
        /// <param name="process"></param>
        public void DeleteProcessActivities(WfProcessCurrentInfoCollection processes)
        {
            processes.NullCheck("processes");

            InSqlClauseBuilder builder = new InSqlClauseBuilder("PROCESS_ID");

            processes.ForEach(p => builder.AppendItem(p.InstanceID));

            if (builder.Count > 0)
            {
                string sql = string.Format("DELETE WF.PROCESS_CURRENT_ACTIVITIES WHERE PROCESS_ID {0}",
                                           builder.AppendTenantCodeSqlClause(typeof(WfProcessCurrentActivity)).ToSqlString(TSqlBuilder.Instance));

                DbHelper.RunSql(sql, GetConnectionName());
            }
        }
コード例 #2
0
        public void DeletePersistQueue(WfProcessCurrentInfoCollection processesInfo)
        {
            processesInfo.NullCheck("processesInfo");

            InSqlClauseBuilder builder = new InSqlClauseBuilder("PROCESS_ID");

            processesInfo.ForEach(pi => builder.AppendItem(pi.InstanceID));

            if (builder.IsEmpty == false)
            {
                ORMappingItemCollection mappingInfo = ORMapping.GetMappingInfo(typeof(WfPersistQueue));

                string sql = string.Format("DELETE {0} WHERE {0}",
                                           mappingInfo.TableName, builder.ToSqlStringWithInOperator(TSqlBuilder.Instance));

                DbHelper.RunSql(sql, GetConnectionName());
            }
        }