7

I am trying to create a custom deployer module which runs AFTER the content (in this case a page) has been committed to the broker database. I know that in UDP there are different pipelines, each representing a different stage in the deployment process (called Verbs in the code). By debugging the code and by looking at the deployer-conf.xml that SDL provides, I found out that there are at least the following Verbs (stages):

  • Prepare
  • Process
  • Content
  • PreCommit
  • Commit
  • Rollback

However, as far as I can tell, ALL these stages take place before the database transaction is committed.

I've tried the following XML configurations:

Verb=Process (added my steps to the steps that were already there)

<Pipeline Id="Tridion-Process-Deploy" Action="Deploy" Verb="Process">
            <Steps>
                <Step Id="PageDeploy" Factory="com.sdl.delivery.deployer.steps.TridionExecutableStepFactory">
                    <Module Class="com.tridion.deployer.modules.PageDeploy" Type="PageDeploy"/>
                </Step>
<!-- removed other steps for clarity's sake -->
 <Step Id="PageDeployFast" Factory="com.sdl.delivery.deployer.steps.TridionExecutableStepFactory">
                    <Module Type="PageDeploy" Class="com.tridion.storage.extension.deployer.SolrPageDeploy" />
                </Step>
</Steps>
</Pipeline>

Verb=Commit (new pipeline created specifically for my module)

<Pipeline Id="Tridion-Commit-Deploy" Action="Deploy" Verb="Commit">
    <Steps>
        <Step Id="PageDeployFast" Factory="com.sdl.delivery.deployer.steps.TridionExecutableStepFactory">
            <Module Type="PageDeploy" Class="com.tridion.storage.extension.deployer.SolrPageDeploy" />
        </Step>
    </Steps>
</Pipeline>

Verb=PreCommit (also a new pipeline)

<Pipeline Id="Tridion-PreCommit-Deploy" Action="Deploy" Verb="PreCommit">
    <Steps>
        <Step Id="PageDeployFast" Factory="com.sdl.delivery.deployer.steps.TridionExecutableStepFactory">
            <Module Type="PageDeploy" Class="com.tridion.storage.extension.deployer.SolrPageDeploy" />
        </Step>
    </Steps>
</Pipeline>

In all cases, my module got triggered AFTER the out of the box page deploy module, but unfortunately BEFORE the database transaction had been committed.

I also tried the verb 'PostCommit' but that doesn't seem to exist. My module does not get triggered at all when I use that.

Is there any way to trigger my custom deployer module AFTER the database transaction has been committed?

==== ANSWER ====

Raimond and Andrew both put me on the right track. The key thing to note is that the pipelines are executed in the order in which they occur in the deployer-conf.xml. There is one pipeline which contains the step to perform the database commit, namely Tridion-Commit-TX. To run a module post commit, just insert a pipeline after this one. Be careful though: you must put it BEFORE the Tridion-Cleanup pipeline, else your module cannot be instantiated anymore because the files on which it is based are gone.

  • what are you looking for? the markup for a deployer pipeline with custom module in it? tridion.stackexchange.com/questions/18757/… – Andrew William Ross Apr 2 at 13:42
  • I have the markup, and I am able to trigger my module. But it comes too soon in the process, when the database commit has not yet been issued. – Quirijn Apr 2 at 13:47
  • Wait, isn't the XO post commit? – Marko Milic Apr 2 at 13:48
  • I updated the question with the various XML configurations I tried. – Quirijn Apr 2 at 13:55
  • oh so you require transaction to finish, get final state, and after that execute something? – Marko Milic Apr 2 at 13:57
8

You should be able to add a pipeline element after the "Tridion-Commit-TX" pipeline and before the Cleanup Step, which then should act as a PostCommit. In XO, the same happens:

<!-- Add the following pipelines after the existing "Tridion-Commit-TX" pipelines -->
<Pipeline Id="Tridion-Process-PostCommit" Action="Deploy" Verb="Process">
    <Steps>
        <Step Id="XoContentFragmentDeploy">
            <Transformer Class="com.tridion.transformer.TCDLDefaultTransformer"/>
        </Step>
    </Steps>
</Pipeline>
  • hahah raimond you had quicker fingers. :D in any case, here is the link: docs.sdl.com/LiveContent/content/en-US/… – Marko Milic Apr 2 at 13:54
  • I guess in my case I should have a Module instead of a Transformer in that step? And does the Id of the Step matter? – Quirijn Apr 2 at 14:22
  • You can create a module or a step if I'm not mistaken. I don't think the Id matters indeed. – Raimond Apr 2 at 18:00
  • 3
    It works! Only one thing: if your step contains a Module instead of a Transformer (like mine does), you must put it BEFORE the step with the ID Tridion-Cleanup. Otherwise the zip folder is cleaned up, and you will get an NullPointerException during the instantiation of your module. So put it ALMOST at the end, but before the cleanup step! – Quirijn Apr 3 at 8:47
  • True! Good to see it's solved. – Raimond Apr 3 at 13:09
4

https://docs.sdl.com/LiveContent/content/en-US/SDL%20Tridion%20Sites-v1/GUID-93347DFB-D6EB-4398-A78D-220B7FD685E3

Go to your Content Deployer's config\ folder, and open deployer-conf.xml for editing. Find the last Pipeline section in the file, and add the following two Pipeline sections below the last Pipeline section in the file:

<Pipeline Id="Tridion-Process-PostCommit" Action="Deploy" Verb="Process">
 <Steps>
   <Step Id="XoContentFragmentDeploy">
    <Transformer Class="com.tridion.transformer.TCDLDefaultTransformer"/>
   </Step>
 </Steps>
</Pipeline>
<Pipeline Id="Tridion-Undeploy-PostCommit" Action="Undeploy" Verb="Process">
 <Steps>
  <Step Id="XoContentFragmentUnDeploy" />
 </Steps>
</Pipeline>
  • 1
    Hi Andrew, I think the first <Pipeline...> element went missing in your answer. Could you add that? Meanwhile, I will try it out. – Quirijn Apr 2 at 14:04
  • thanks did from my phone.. tricky ;) – Andrew William Ross Apr 2 at 14:23
  • Thanks for your help. You were correct, just like Raimond, but I marked his answer as correct because it had the additional discussion which might be helpful to people in the future. I upvoted your answer too. – Quirijn Apr 3 at 8:49

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.