Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Passing Values between AEM Workflow Steps

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

18-04-2016

You can develop a custom Adobe Experience Manager (AEM) workflow step that sets a value that can be retrieved by another step in the same workflow. For example, assume you read a property of a payload and you need that value in a later step. You can store the value and retrieve it in a later step.

To read and write values in an AEM workflow, you need to write custom steps. A custom workflow step is implemented as an OSGi bundle that you can build using Maven and the AEM Workflow APIs that belong to the com.adobe.granite.workflow.exec package. For information, see Package com.adobe.granite.workflow.exec.

To demonstrate how to pass values in a workflow between steps, this article uses the following workflow model.

To read this development article, click   https://helpx.adobe.com/experience-manager/using/creating-custom-aem-workflow-pass-data.ht ml.

Replies

Avatar

Avatar
Validate 50
Level 5
askdctm
Level 5

Likes

48 likes

Total Posts

476 posts

Correct Reply

7 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Boost 5
View profile

Avatar
Validate 50
Level 5
askdctm
Level 5

Likes

48 likes

Total Posts

476 posts

Correct Reply

7 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Boost 5
View profile
askdctm
Level 5

18-04-2016

Hi Scott,

Thank you for sharing this across.

Avatar

Avatar
Validate 1
Level 2
Qian416
Level 2

Likes

6 likes

Total Posts

39 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Qian416
Level 2

Likes

6 likes

Total Posts

39 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Qian416
Level 2

21-04-2016

Hi Scott,

I have tried to this example on AEM 6.1 Service Pack 1 server, and I got some error when I deploy and start the bundle.

21.04.2016 17:28:05.384 *ERROR* [FelixStartLevel] ERROR: Error starting inputstream:demobundle-bundle-1.0-SNAPSHOT.jar
(org.osgi.framework.BundleException: Unresolved constraint in bundle com.dsa.demo.demobundle-bundle [470]: Unable to resolve 470.0:
missing requirement [470.0] osgi.wiring.package; (&(osgi.wiring.package=com.adobe.granite.workflow)(version>=1.0.0)(!(version>=2.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle com.dsa.demo.demobundle-bundle [470]:
Unable to resolve 470.0: missing requirement [470.0] osgi.wiring.package; (&(osgi.wiring.package=com.adobe.granite.workflow)(version>=
1.0.0)(!(version>=2.0.0)))
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4095)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2114)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1368)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.lang.Thread.run(Thread.java:745)

Thanks.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

21-04-2016

can you try on an fresh version of AEM. We have had many community members get this working., Did you use all of the Dependencies in the POM in the artilce and follow it exactly? 

Avatar

Avatar
Validate 25
MVP
Ratna_Kumar
MVP

Likes

158 likes

Total Posts

755 posts

Correct Reply

134 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile

Avatar
Validate 25
MVP
Ratna_Kumar
MVP

Likes

158 likes

Total Posts

755 posts

Correct Reply

134 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile
Ratna_Kumar
MVP

21-04-2016

Hi Qian,

This(Passing Values between AEM Workflow Steps) got working for me in AEM 6.1 without SP1 and also I don't think so, it is problem with the SP1 pack.

Please see this attached screenshots

Thanks,
Ratna Kumar.

Avatar

Avatar
Give Back 10
Level 2
mkumar
Level 2

Likes

3 likes

Total Posts

32 posts

Correct Reply

5 solutions
Top badges earned
Give Back 10
Give Back 5
Give Back 3
Give Back
Ignite 1
View profile

Avatar
Give Back 10
Level 2
mkumar
Level 2

Likes

3 likes

Total Posts

32 posts

Correct Reply

5 solutions
Top badges earned
Give Back 10
Give Back 5
Give Back 3
Give Back
Ignite 1
View profile
mkumar
Level 2

21-04-2016

Restart the instance, redeploy the bundle again and refresh the packages of workflow bundle.

Avatar

Avatar
Validate 1
Level 2
Qian416
Level 2

Likes

6 likes

Total Posts

39 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Qian416
Level 2

Likes

6 likes

Total Posts

39 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Qian416
Level 2

21-04-2016

I have to re-install a fresh version of AEM 6.1 with SP1, and test the bundle, it works. 

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

22-04-2016

When bundle issues occur like that - its typically something in environment that causes it,  All HELPX articles have been tested many times by community members.  I am glad it's working for you! 

Avatar

Avatar
Validate 50
Level 4
nsvsrk
Level 4

Likes

21 likes

Total Posts

229 posts

Correct Reply

5 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Ignite 5
View profile

Avatar
Validate 50
Level 4
nsvsrk
Level 4

Likes

21 likes

Total Posts

229 posts

Correct Reply

5 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Ignite 5
View profile
nsvsrk
Level 4

23-04-2016

Very practical example, required often in the real world.

An installable package of this would help people, who want to quickly install and test, before digging deep..

Thanks,

Rama.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

23-04-2016

Good feedback - we will package up this example.