4

I'm polling the Publish Queue and using the following code to get a list of Publish Transactions. I want to find out when the publish action started - so then I can compare it with the current time and if it has the same publish state (Waiting or Rendering) for too long, I alert some people and log it.

Can I get more info about the Publish Transaction item via Core Service? I recall being able to get extensive info in the Event System via .Net. Is that available here?

  XElement publishTransactions = client.GetSystemWideListXml(pubQueueFilter);

The XML of an item is:

<tcm:Item ID="tcm:0-879-66560" Title="page86" Allow="24576" 
 Deny="67108864" Icon="T64L0P0" ItemType="64" 
 ItemID="tcm:5-86-64" State="5" StateChangeDate="2015-10-01T09:04:48" 
Publication="002 Web" PublicationTarget="Staging" ItemPath="\002 Web\Root" 
Action="0" ScheduleDate="" UserId="tcm:0-11-65552" User="DEV2011\Admin"
Priority="4" Managed="0" xmlns:tcm="http://www.tridion.com/ContentManager/5.0" /> 

2 Answers 2

3

You can probably use the StateChangeDate. This is the time publish transaction state was changed for the last time. It basically shows you, for how long is you publish transaction in rendering or waiting. Just be careful with scheduled transactions.

2
  • OK, so I can compare the StateChange to the Current Time and then use that as my 'max value allowed' for that state?
    – robrtc
    Commented Oct 1, 2015 at 8:43
  • 2
    Yes, just be careful with the scheduled transactions as they might be in the state for a long time, but are completely fine Commented Oct 1, 2015 at 9:47
2

You can of course get the PublishTransactionData object from Core Service, but for your use case I don't think it will provide you with any additional useful information.

As Andrey says, you'll want to filter the publish transactions by state and then look at their StateChangeDate to see how long they've been in that state.

When comparing State you can use the PublishTransactionState enumeration instead of using numerical values. Waiting == 1 and Rendering == 9, but there are possibly some others that you might be interested in so check out the enum in the API docs. I would also watch out for time differences between the server and the local system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.