7

有没有什么快速的方法/技巧可以删除大约 85K 的工作流程历史记录?从 GUI 尝试会出现存储问题,要解决此问题需要弹回盒子。

也尝试了 PowerTool 在很长一段时间后崩溃。想问问更广泛的社区。感谢您的想法。

谢谢文

4

2 回答 2

4

哪个版本的 Tridion?2011 年?

您可能会使用定期为您执行此操作的 CoreService 客户端应用程序。通过“PowerTool”,我假设您是指 Purge 工具?

另外 - 我可能会就您看到的错误联系客户支持,似乎使用 GUI 或清除工具应该失败。

如果您使用的是 2011 SP1,则可以使用以下代码:

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));
        }
    }
}

ñ

于 2012-02-20T19:55:51.607 回答
1

如果您无法使用核心服务,请查看此博客条目,其中描述了使用 Powershell 强制完成工作流流程。通过一些非常小的修改,相同的技术将适用于删除工作流程过程。

于 2012-03-27T09:17:11.510 回答