Hello to everyone
I'm facing a problem when i try to identify when dam events my requirement is that when an asset is being copied, moved or created we need to add a new property into the metadata of that asset, the method that i have is the next one, this method is in a class that implements EventHandler, DAMEventService.
public void handleEvent(Event event) {
DamEvent damEvent = DamEvent.fromEvent(event);
LOGGER.debug("********** EventType=" + damEvent.getType() + " === " + damEvent.getAssetPath());
/* Use case when Creating Assets and Versioning Assets after DAM Update Asset Workflow finished processing */
if(DamEvent.Type.DAM_UPDATE_ASSET_WORKFLOW_COMPLETED == damEvent.getType() ||
/* Use case when Moving and Copying Assets after DAM Update Asset Workflow finished processing */
DamEvent.Type.DAM_METADATA_WRITEBACK_WORKFLOW_COMPLETED == damEvent.getType() ||
DamEvent.Type.ASSET_CREATED == damEvent.getType() ||
DamEvent.Type.ASSET_MOVED == damEvent.getType() ||
DamEvent.Type.VERSIONED == damEvent.getType()){
this.callProcessNodeFromPath(damEvent);
}
}
the workflows events are used to identify when an asset is begin uploaded and it was processed by DAM Update Asset workflow, but there is not a specific case for copy so I add create but that create a new problem, because asset_created is also trigger when an asset is uploaded and that is a problem because my listener and the workflow is trying to write the metadata properties at the same time and I get an exception.
metadataNode.setProperty(metadata_field, Value);
session.save();
if I delete the ASSET_CREATED everything works fine but that leaves out of the scope the copied and this is required in my development.
I also try a refresh on my session but and it didn't work and that would only solve the problem with two classes writing at the same time but not my problem identifying the copy case.
so my question are
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @arturoar ,
One way would be that instead of creating a handler, you can customize the DAM update Asset workflow model to add custom process. You can add another process to add the custom property once the asset workflow completes its work.
Notably, The default workflow DAM Asset Update is no longer available in Asset as a cloud Service, in case if there is any future plan to use.
https://experienceleague.adobe.com/docs/experience-manager-cloud-service/assets/assets-cloud-changes...
BTW, it is always recommended to have either a listener or workflow configured on a node else synchronization problem might occur.
Hi @arturoar ,
One way would be that instead of creating a handler, you can customize the DAM update Asset workflow model to add custom process. You can add another process to add the custom property once the asset workflow completes its work.
Notably, The default workflow DAM Asset Update is no longer available in Asset as a cloud Service, in case if there is any future plan to use.
https://experienceleague.adobe.com/docs/experience-manager-cloud-service/assets/assets-cloud-changes...
BTW, it is always recommended to have either a listener or workflow configured on a node else synchronization problem might occur.
Views
Replies
Total Likes
Views
Likes
Replies