0

I am uploading a xml file to /content/dam/asset folder, this time my workflow would triggering. Inside my workflow java service I need to read XML data


My Workflow Java Service Here:-

public void execute(WorkItem arg0, WorkflowSession arg1, MetaDataMap arg2)
        {
        Session session = arg1.getSession();
        String updatedAsset =arg0.getWorkflowData().getPayload().toString();
        ResourceResolver resolver;
        resolver = resolverFactory.getAdministrativeResourceResolver(null);
        Resource resource = resolver.getResource(updatedAsset);
        }
Hanin Jazi
  • 1
  • 2
  • 4

1 Answers1

0

What you got within your updatedAsset variable is actually the assets path so

Edit:

you'd need to get the stream out of it which is on the jcr:content of the original rendition

/conten/dam/myapp/myExample.xml/jcr:content/renditions/original/jcr:content

your data is in property jcr:data

how to get it? with Node::getProperty().getStream()

Get File Out of JCR File Node

Community
  • 1
  • 1
ub1k
  • 1,674
  • 10
  • 14