Expand my Community achievements bar.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

Fetch workflowStages assigned to any workflow step in AEM6.4

Avatar

Level 2

I' using AEM 6.4 where I've implemented the custom workflow step functionality as an OSGi Service and trying to determine which workflow step I'm currently based on the custom- 'Workflow Stages' created and assigned to each step. (refer screenshot below).

1621231_pastedImage_1.png

I'm able to see the correct workflow stages assigned to each workflow step in debug mode but I'm unable to fetch the actual string value from the JcrPropertyMap(i guess).

Below is the code which I believe I need to fix to get the correct property value-              

;-/

1621246_pastedImage_19.png

PropertyMap when copied from the debug mode contains expected workflowStage value.1621248_pastedImage_20.png

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

Check your imports

import com.day.cq.workflow.metadata.MetaDataMap;

and try metadatamap2.get("KEY_WORKFLOW_STAGE", String.class);

Arun Patidar

AEM LinksLinkedIn

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi,

Check your imports

import com.day.cq.workflow.metadata.MetaDataMap;

and try metadatamap2.get("KEY_WORKFLOW_STAGE", String.class);

Arun Patidar

AEM LinksLinkedIn

Avatar

Level 2

Hi Arun,

Thanks for a quick response, yups that's correct..!

Solution : metadatamap2.get("KEY_WORKFLOW_STAGE", String.class);

I also found this same method from JcrValueMap class just sometime after posting this question, tried it & it worked.

Also, my import is - 'import com.adobe.granite.workflow.metadata.MetaDataMap;' and it works just fine.

FYI, I'm using AEM 6.4.

Regards,