Fetch workflowStages assigned to any workflow step in AEM6.4 | Community
Skip to main content
Level 2
Nov 14, 2018 8:25 AM UTC
Solved

Fetch workflowStages assigned to any workflow step in AEM6.4

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).

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-              

;-/

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Nov 14, 2018 9:27 AM UTC

Hi,

Check your imports

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

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

Arun Patidar

2 replies

Level 2
Nov 14, 2018 10:18 AM UTC

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,

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
Nov 14, 2018 9:27 AM UTC

Hi,

Check your imports

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

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

Translate
Arun Patidar