Is there a quick way to delete a large stack of Workflow process history?

Is there any quick way / trick to delete about 85K entries for workflow process history? Trying from the graphical user interface gives a problem with the repository, and to solve this problem, you must drop the window.

Also, the PowerTool attempt crashes after a long time. Thought to ask the wider community. rate your thoughts.

Thanks vin

+7
source share
2 answers

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

+4
source

If you can’t use the basic service, check out this blog post that describes how to use Powershell to force processes to complete the process. With some very minor changes, the same method will work to remove workflow processes.

+1
source

All Articles