How do I query the AEM content path associated with a delivery. I understand this might be a javascript code. What should go in this code? So far all I have is a simple workflow with a query object that is just querying for 1 delivery Id against the delivery schema. I am outputting the delivery Id in the query result.
Views
Replies
Total Likes
Hi @rntrp
Here is a typical code snippet you would use in a JavaScript activity after your initial query (assuming your workflow variable vars.deliveryId
holds the queried delivery ID):
// Load the delivery record by its ID
var dlv = NLWS.nmsDelivery.load(vars.deliveryId);
// Read the linked AEM path
var aemPath = dlv.remoteContent.@remotePath;
// Output to the workflow journal for visibility
logInfo("The AEM path for Delivery " + vars.deliveryId + " is: " + aemPath);
vars.aemPath = aemPath;
NLWS.nmsDelivery.load(id)
is the standard API to load a delivery schema object by ID.@remotePath
attribute gives you the path to the linked AEM content.Views
Replies
Total Likes
Thanks @NiteshPandey for your response. That was super helpful. I want to build on this use case. Now that I have the path, is there any way to retrieve the actual content via AC workflow?
Views
Replies
Total Likes
Hi @rntrp,
You can retrieve the content using a JS activity with an HTTP request to the AEM API, once you have the AEM path. Take into account that you will need to have network access to AEM and be able to manage authentication if it is necessary.
Best,
Celia
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies