2012-02-20 4 views
7

ワークフローのプロセス履歴の85,000エントリを削除するための迅速な方法がありますか? GUIから試してみるとストレージの問題が発生し、この問題を解決するにはボックスをバウンスする必要があります。大きなワークフロープロセス履歴スタックを簡単に削除する方法はありますか?

また、長時間経過してもPowerToolがクラッシュすることがあります。より広いコミュニティに尋ねる考え。あなたの考えに感謝します。

おかげ ヴィン

+1

使用しているTridionのバージョンは?私は通常、コアサービスでサンプルコードを書いています。これは、<2011年のときにはうまくいきません。 –

答えて

4

Tridionのバージョン? 2011年?

これを定期的に実行するCoreServiceクライアントアプリケーションを使用すると、おそらく離れてしまう可能性があります。 「PowerTool」とは、パージツールのことですか?

また、表示されるエラーについては、カスタマーサポートに連絡したり、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)); 
     } 
    } 
} 

N

1

を、使用して説明しthis blog entryを見て、持っていますPowershellは、ワークフロープロセスを強制終了させます。非常に小さな変更を加えても、ワークフロープロセスを削除する場合と同じテクニックが有効です。

関連する問題