Wednesday, October 7, 2015

How to extend Replication Page Process for workflow in AEM

Use Case: You want to extend existing replication page process and add your own logic during workflow step. Some of common use case could be,
1) Activate Asset as soon as it is uploaded to DAM

Solution:

Here is sample code you can use for this,

What this code is doing is trying to find DAM asset path from workflow item and then activating DAM asset instead of activating just original node when OOTB activate page workflow is used.



Once you add your code, you can add this as workflow step in your workflow. If you are extending model.xml for workflow then it will look something like this,

        <node
            jcr:primaryType="cq:WorkflowNode"
            description="A process to activate a page or asset"
            title="Activate Original Asset"
            type="PROCESS">
            <metaData
                jcr:primaryType="nt:unstructured"
                PROCESS="com.wemblog.ActivateAssetFromOriginalProcess"
                PROCESS_AUTO_ADVANCE="true"/>
        </node>

Also you have to make sure that you have right dependency in your pom.xml. If you are using AEM6.1 then you need to use

<dependency>
    <groupId>com.adobe.aem</groupId>
    <artifactId>uber-jar</artifactId>
    <version>6.1.0</version>
    <classifier>apis</classifier>
    <scope>provided</scope>
</dependency>

As usual if you have any question or comment please let me know.

2 comments:

  1. I am a freelancer and have been helping a lot of students in providing assistance to students who frequently gets worried about their assessment tasks and went online to search for assignment help service terms.
    We at My Assignment Services have potentially recognized the need way back and started what we are an enlarged version of then. With many assignment helper companies in the market, no one has quite able to match the standard that we follow. We give utmost priority to students by strictly adhering to the assignment requirements as well as marking rubrics to score high grades. Our programming assignment help writers are well-proficient in not only comprehending your assessment tasks but also to give an expert finish to it.
    Provided a well-written assignment suitable to your needs, your search for professional essay writers will now end with My Assignment Services. You just have to visit our website for more information.

    ReplyDelete