1
  1. I am doing some external operations if they get failed I have to mark a 'ScheduledForPublish' item to 'Failed' in publishing queue. I don't want to delete the item from Publishing queue. how can I do it with Tridion Core service.
  2. I have an Item 'ScheduledForPublish'. To force the publish there is 'ExecuteTask' option in GUI. Is there anything like that in core service API?
2
  • Pretty sure only the Publisher process can change the status of a publishing action. You'll have to fail it on the render or resolving phase, not from "outside" the publishing process.
    – Nuno Linhares
    Jul 16 '13 at 12:55
  • Nuno, I have commented on Bart's answer about my requirement. Can you please look at that and suggest me.
    – AlokBhatt
    Jul 16 '13 at 16:25
1

You cannot set a publish action to failed yourself, but you can make sure that something in the rendering (template code) or deployment process fails, which will mark the transaction as failed.

You mention a scheduled publish item and that you are doing some external operations, what is triggering these external operations? If you trigger them through the event system on the publish action, then that is something you might also want to use for raising the error which will fail the publish transaction.

If your external process is completely separate from the publish transaction, then you cannot have that interact with the publish transaction (other than deleting it from the queue while it hasn't been started yet). But you could consider implementing something in the template code which would check your external process and see if it needs to fail this transaction. Not an optimal process, but that is about the maximum you can get out of it (given that you want to fail a scheduled transaction which hasn't even started yet).

As for your #2 question, try changing the scheduled date to the current date and time, that should make it execute directly (not sure if that can be done through the core service, but worth a shot, I'm pretty sure the UI also uses something like that for the execute task option).

5
  • External operations are out of publish transaction it's not in event system. How can I update a transaction's publishing time
    – AlokBhatt
    Jul 16 '13 at 14:59
  • probably by deleting the existing one and creating a new one with the same data (but not scheduled) Jul 16 '13 at 15:24
  • According to my requirement, I have to make the publish status success/fail as external operations fail/success. These operations were taking too much time so I didn't did them in Storage extension. I am doing these operation from external application while keeping my item in scheduledForPublish state. I thought to show the user that the operation is failed or success by failing the item publish in queue. Is there any other way to show user, these failure or success messages in Tridion instead of the fail/success status in publishing queue.
    – AlokBhatt
    Jul 16 '13 at 16:19
  • That's probably worth a different question - here you're asking about failing Publish transactions, and now suddenly it's a UI question.
    – Nuno Linhares
    Jul 16 '13 at 21:20
  • Failing the publish transaction will let the user know that some thing happened to either Publish Process or to External Operations. Clear thing is that if external operations do not get successful I want to show a failed transaction in publishing queue to user.
    – AlokBhatt
    Jul 17 '13 at 4:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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