Expand my Community achievements bar.

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

Avatar

Level 5

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 :

varaande_0-1699152268829.png

 

Workflow Class 

varaande_1-1699152330100.png

Regards

Vara

3 Replies

Avatar

Level 2

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 

 
@Override
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");
}

 

Avatar

Administrator

@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