Skip to main content
2 of 4
deleted 43 characters in body
Anthony
  • 36.4k
  • 51
  • 185
  • 290

How to send the asset to an external service?

I am trying to write a workflow process step for the DAM update asset such that the uploaded asset will be sent to an external service that will modify the asset and then the modified asset can be sent to the Metadata extraction step. So I've added my process step to the DAM update asset like this:

enter image description here

And my code looks like this so far:

public void execute(WorkItem item, WorkflowSession wfsession,MetaDataMap args) throws WorkflowException { try { log.info("Here in execute method"); final Map<String, Object> map = new HashMap<String, Object>(); map.put( "user.jcr.session", wfsession.getSession()); ResourceResolver rr = resolverFactory.getResourceResolver(map); String path = item.getWorkflowData().getPayload().toString(); Resource resource = rr.getResource(path); Asset asset = resource.adaptTo(Asset.class); } catch (Exception e) { log.info("Here Error"); e.printStackTrace(); } } 

Question

  • How can I send the asset to the external service? Is there a way I can get the absolute path to where the asset is saved on the file system?
  • Once the external service modifies the asset, what should I do so that the Metadata extraction step reads the modified asset instead of the original?
Anthony
  • 36.4k
  • 51
  • 185
  • 290