What version of Tridion? 2011?
You will probably succeed using the CoreService client application, which will do this regularly for you. "PowerTool" I assume you mean the Purge tool?
Also - Iβm most likely contacting Customer Support regarding the errors you see, it doesnβt seem like using the GUI or the Purge Tool should fail.
If you are using 2011 SP1, you can use the following code:
using System; using System.ServiceModel; using System.Xml; using Tridion.ContentManager.CoreService.Client; namespace DeleteWorkflowHistory { class Program { private const string NetTcpEndpoint = "net.tcp://localhost:2660/CoreService/2011/netTcp"; private static readonly EndpointAddress EndpointAddress = new EndpointAddress(NetTcpEndpoint); static void Main(string[] args) { var binding = new NetTcpBinding { MaxReceivedMessageSize = 2147483647 }; var quota = new XmlDictionaryReaderQuotas { MaxStringContentLength = 2147483647, MaxArrayLength = 2147483647 }; binding.ReaderQuotas = quota; var client = new SessionAwareCoreServiceClient(binding, EndpointAddress); Log("Connected to Tridion Content Manager version: " + client.GetApiVersion()); ProcessesFilterData filter = new ProcessesFilterData { BaseColumns = ListBaseColumns.IdAndTitle, ProcessType = ProcessType.Historical }; foreach (IdentifiableObjectData data in client.GetSystemWideList(filter)) { var processHistory = data as ProcessHistoryData; if (processHistory != null) { Log("Deleting history: " + processHistory.Id + " / " + processHistory.Title); client.Delete(processHistory.Id); } } client.Close(); } private static void Log(string message) { Console.WriteLine(string.Format("[{0}] {1}", DateTime.Now.ToString("HH:mm:ss.fff"), message)); } } }
N
Nuno linhares
source share