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

Proper way of iteration of MetadataMap and convert all values to Aem

Avatar

Avatar
Validate 1
Level 2
DIPEN1
Level 2

Likes

2 likes

Total Posts

40 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
DIPEN1
Level 2

Likes

2 likes

Total Posts

40 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
DIPEN1
Level 2

09-01-2019

I am trying to iterate workflow metadatamap and convert all items into string. I found then metadatamap.get(key) returns an object of javax.jcr.Value. So I have written a code to get values and check the type and convert accordingly.

It was working fine until I put one string value to Metadata Map in one process step using MetadataMap.put("somekey","some string value").So in next process step while iteration it is directly returning string instead of javax.jcr.Value. But in between these two step if I add one participant step or task , it's returning Value object.

Why is this behaviour?

Replies

Avatar

Avatar
Validate 1
Level 2
DIPEN1
Level 2

Likes

2 likes

Total Posts

40 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
DIPEN1
Level 2

Likes

2 likes

Total Posts

40 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
DIPEN1
Level 2

10-01-2019

Yes, we are using AssetManager api but not copyAsset() and removeAsset(). We are using moveAsset(oldPath, newPath).

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

10-01-2019

To get the Map - are you reading the assets metadata. That should return a map.

However (regardless of how you get the Map) - what sounds strange to me is the fact that you need a part step to properly read the map in subsequent steps.

Avatar

Avatar
Validate 1
Level 2
DIPEN1
Level 2

Likes

2 likes

Total Posts

40 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
DIPEN1
Level 2

Likes

2 likes

Total Posts

40 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
DIPEN1
Level 2

10-01-2019

Its not asset metadata. Asset metadata returns ValueMap and I am able to iterate complete valueMap. I am trying to iterate Workflow metadata i.e. com.adobe.granite.workflow.metadata.MetaDataMap

As MetaDataMap implementation is not public, it is very difficult to understand what is happening inside.

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

10-01-2019

I am gonig to setup this up and see if i can reproduce your results. This is interesting.