Fetch workflowStages assigned to any workflow step in AEM6.4 | Community
Skip to main content
Level 2
November 14, 2018
Solved

Fetch workflowStages assigned to any workflow step in AEM6.4

  • November 14, 2018
  • 2 replies
  • 1069 views

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.
Best answer by arunpatidar

Hi,

Check your imports

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

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

2 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
November 14, 2018

Hi,

Check your imports

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

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

Arun Patidar
Level 2
November 14, 2018

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,