Skip to main content

Posts

Showing posts from November, 2019

Workflows in AEM 04 - MetaDataMap

Sometimes we are faced with a situation where we need to pass data from one workflow step to the another. AEM's workflow API provides an easy way to achieve this using MetaDataMap.

Please note that only primitive data types like Integer, String etc. can be passed from one step to the another. If you have a requirement to pass non-primitive data then use the byte[] array.

Caution: If the data to be passed is too large, refrain passing InputStream. Instead, a better approach is to save the data in a JCR node in the step and retrieve it from the JCR node in a later step.

A MetaDataMap is the data structure which acts as a value map and allows users to set and get data among the steps.
Code example Let's see a code example to demonstrate this concept. Here we will be using two process steps. In the first, we will be passing data and in the second, we will be retrieving it. FirstProcessStep.javapackageorg.redquark.demo.core.workflows;importorg.osgi.service.component.annotations.Com…