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.

4 comments:

  1. According to the latest essay writer review, it is found that students are mostly choosing Best Dissertation Writing Services for their unmatched quality of service. There are lots of positive reviews that add to MyAssignmentHelp.com review.
    This assignment help service is the best in the market according to students’ review. It has been found that most of the students prefer their service because of the quality, price and other beneficial aspects. By analyzing some of the top reviews, let us know why this service has been considered as the best one for the help seekers.
    The only way to get a detailed insight of the site is to go through the reviews that are posted on the best essay writing service,
    Before selecting a homework help websites, students must read the reviews. Reading reviews is necessary as the students get to know which service providers are genuine and which is fake.
    To mislead the visitors, a lot of My assignment help Review are posted in review writing websites.
    For students who are going to write and looking for topics. Which side of the problem are you going to write about and what solution can you offer? You should know the objective of your essay, topic like- Hamlet’s Tragedy Persuasive Essay samples.

    ReplyDelete
  2. Hey, Your blog is very informative. It is nice to read such high-quality content. Attractive information on your blog, thank you for taking the time and share with us. Myassignmenthelp delivers high-quality content related to student essay writing.

    ReplyDelete
  3. 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