I want to rollback the published content in workflow process when the approver reassign workflow to Editor. is there any default way to do that in tridion with event listener?.

if yes, is this the only way i can do ?.


  • The undo feature is indeed meant for reverting changes delivery-side by "undoing" the results of a recent publishing transaction in Workflow. But you would use it an automatic activity rather than when (just) reassigning an activity. Undo might not fit your use case, though. What should happen to the Content Manager-side minor version that the "approver" rejects? – Alvin Reyes Dec 2 '15 at 22:40

As Alvin suggested, I also think automatic activity is the best way to fulfill your requirement -

When your approver reject the item instead of reassign it to editor, assign it to a automatic activity.Then write a script which will un publish your item first and then send your activity back to editor. The whole thing is manageable from the script itself. I have implemented the below code for your reference. It is only applicable for pages. You can modify as per your requirement -

 protected override void Execute()
        UnPublishInstructionData unPublishInstruction = new UnPublishInstructionData();
        unPublishInstruction.ResolveInstruction = new ResolveInstructionData();

        //Needed for publishing workflow revision/version
        unPublishInstruction.ResolveInstruction.IncludeWorkflow = true;
        ActivityInstanceData activityInstance = ActivityInstance;
        IList<String> itemsToPublishList = new List<String>();

        //Staging publication target URI
        String[] targets = new[] { "<specify your target type>" };
        foreach (WorkItemData wid in activityInstance.WorkItems)
            int value = Convert.ToInt32(Enum.Parse(typeof(ItemType), "Page"));
            if (wid.Subject.IdRef.EndsWith(value.ToString()))

        //PublishTransactionData requires reference to System.ServiceModel
        PublishTransactionData[] publishTransactions = CoreServiceClient.UnPublish(itemsToPublishList.ToArray<String>(), unPublishInstruction, targets, PublishPriority.Normal, null);

        //Store the publish transaction id so that we can undo if needed!
        ProcessInstance.Variables.Add("PublishTransaction", publishTransactions[0].Id);

        CoreServiceClient.FinishActivity(ActivityInstance.Id, new ActivityFinishData { Message = "Reassign the activity to Editor" }, null);


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.