Please let me know how fetch the value of AEM Workflow Variable | Community
Skip to main content
Level 5
November 5, 2023

Please let me know how fetch the value of AEM Workflow Variable

  • November 5, 2023
  • 2 replies
  • 694 views

Hi Team,

 

we had created the workflow variable at AEM Workflow Model which type as "Document" which holding the pdf file ,

 

Wow to fetch the Variable values as document to process step to enable us to push same to S3 bucket 

 

Here Workflow Model Variable :

 

Workflow Class 

Regards

Vara

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

arunpatidar
Community Advisor
Community Advisor
November 5, 2023
Level 2
November 6, 2023

Hi  arunpatidar

I had already referred same link but not covered if workflow variable type is "Document"

 

Here log statements  I tried but not getting the value what i am looking for 

 
@9944223
public void execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap) throws WorkflowException {

log.info("AWS document upload Workflow Process class is running");

if (null != awsOperationsService){
log.info("AWSOperationsService class is resolved");
}

for (Map.Entry entry : metaDataMap.entrySet()){
log.info("Key : {}", entry.getKey());
log.info("Value : {}", entry.getValue());
log.info("Value : {}", entry.getValue().getClass());
}
log.info("Class type for pdfdemo is {}", workItem.getWorkflowData().getMetaDataMap().get("pdfdemo").getClass().toString());
log.info("Class type for xmldemo is {}", workItem.getWorkflowData().getMetaDataMap().get("xmldemo").getClass().toString());
Document xmlData = workItem.getWorkflowData().getMetaDataMap().get("xmldemo", Document.class);
log.info("XML Data is : {}", xmlData.toString());
Document pdfDoc = workItem.getWorkflowData().getMetaDataMap().get("pdfdemo", Document.class);
log.info("PDF Doc is : {}", pdfDoc.toString());
log.info("AWS document upload Workflow Process class execution complete");
}

 

kautuk_sahni
Community Manager
Community Manager
November 6, 2023

@varaande  Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni