Hello All,
Is there a way to identify the workflow status of the asset, i.e> if renditions have been generated etc. I tried uploading an asset using assetManager.createAsset(), passing an inputstream, and then tried to identify the workflow status using the
WorkflowStatus wfStatus=assetResource.adaptTo(WorkflowStatus.class);
boolean isinWF = wfStatus.isInRunningWorkflow(false);
this always returned false.
I tried to use, thread.sleep(5000), but looks like thread.sleep(10000) works, but i want to use thread.sleep based on the workflow status.
Scenario, After successfully uploading the asset if the asset's hash value is different since the first upload, then assetmanager.createAsset should upload the new asset with the renditions displayed,
Please help
Solved! Go to Solution.
Views
Replies
Total Likes
NitroHazeDev wrote...
Yes Sham i pointed it to /jcr:contnt/renditions/original and got the status though gotta wait until the workflow kicks in, got some help on that, and that works for the initial upload,
But now for the second upload, with same name but different hash, if the asset hash value is different , i wanted to have a condition check with workflow status to check if workflow is complete, since the renditions would already be present by he first upload and can't think of a way to figure out if the renditions for the second asset upload is complete or not.
Now using just isInWorkflow status, i tried recreating the asset, but now for some reason it complains with "Version Exception Node is checked in", cannot create renditions for the asset.
Appreciate advice
What happened with first approach ? Is assetResource pointing to right resource? This should solve your problem.
Alternate how about custom workflow step added to dam_update_ workflow?
Views
Replies
Total Likes
Usage looks right to me. Make sure assetResource pointing to right resource. Example at /libs/cq/workflow/components/inbox/list/json.jsp
alternative though not recommended you can check at jcr node <path>/jcr:content/rendition/<name>
Views
Replies
Total Likes
Yes Sham i pointed it to /jcr:contnt/renditions/original and got the status though gotta wait until the workflow kicks in, got some help on that, and that works for the initial upload,
But now for the second upload, with same name but different hash, if the asset hash value is different , i wanted to have a condition check with workflow status to check if workflow is complete, since the renditions would already be present by he first upload and can't think of a way to figure out if the renditions for the second asset upload is complete or not.
Now using just isInWorkflow status, i tried recreating the asset, but now for some reason it complains with "Version Exception Node is checked in", cannot create renditions for the asset.
Appreciate advice
Views
Replies
Total Likes
NitroHazeDev wrote...
Yes Sham i pointed it to /jcr:contnt/renditions/original and got the status though gotta wait until the workflow kicks in, got some help on that, and that works for the initial upload,
But now for the second upload, with same name but different hash, if the asset hash value is different , i wanted to have a condition check with workflow status to check if workflow is complete, since the renditions would already be present by he first upload and can't think of a way to figure out if the renditions for the second asset upload is complete or not.
Now using just isInWorkflow status, i tried recreating the asset, but now for some reason it complains with "Version Exception Node is checked in", cannot create renditions for the asset.
Appreciate advice
What happened with first approach ? Is assetResource pointing to right resource? This should solve your problem.
Alternate how about custom workflow step added to dam_update_ workflow?
Views
Replies
Total Likes
Sham HC wrote...
NitroHazeDev wrote...
Yes Sham i pointed it to /jcr:contnt/renditions/original and got the status though gotta wait until the workflow kicks in, got some help on that, and that works for the initial upload,
But now for the second upload, with same name but different hash, if the asset hash value is different , i wanted to have a condition check with workflow status to check if workflow is complete, since the renditions would already be present by he first upload and can't think of a way to figure out if the renditions for the second asset upload is complete or not.
Now using just isInWorkflow status, i tried recreating the asset, but now for some reason it complains with "Version Exception Node is checked in", cannot create renditions for the asset.
Appreciate advice
What happened with first approach ? Is assetResource pointing to right resource? This should solve your problem.
Alternate how about custom workflow step added to dam_update_ workflow?
So the first approach, used the payloadResource- path to the original file , and then obtained the status having a thread.sleep for a while, that solved the problem, you are right,
We are actually parsing an XML which contains image references along with other data and we are persisting all in AEM, so asset upload and versioning is also a part, hence if on second upload if the sha1 or hash values don't match then upload the new asset streaming it and generate renditions, i don't want to delete the old asset since it has version history associated to it. Once streamed i have to upversion the asset
Views
Replies
Total Likes
NitroHazeDev wrote...
Sham HC wrote...
NitroHazeDev wrote...
Yes Sham i pointed it to /jcr:contnt/renditions/original and got the status though gotta wait until the workflow kicks in, got some help on that, and that works for the initial upload,
But now for the second upload, with same name but different hash, if the asset hash value is different , i wanted to have a condition check with workflow status to check if workflow is complete, since the renditions would already be present by he first upload and can't think of a way to figure out if the renditions for the second asset upload is complete or not.
Now using just isInWorkflow status, i tried recreating the asset, but now for some reason it complains with "Version Exception Node is checked in", cannot create renditions for the asset.
Appreciate advice
What happened with first approach ? Is assetResource pointing to right resource? This should solve your problem.
Alternate how about custom workflow step added to dam_update_ workflow?
So the first approach, used the payloadResource- path to the original file , and then obtained the status having a thread.sleep for a while, that solved the problem, you are right,
We are actually parsing an XML which contains image references along with other data and we are persisting all in AEM, so asset upload and versioning is also a part, hence if on second upload if the sha1 or hash values don't match then upload the new asset streaming it and generate renditions, i don't want to delete the old asset since it has version history associated to it. Once streamed i have to upversion the asset
When you upload an asset with same name and different hash, You will have option to 'Create Version' or replace. If you use create version nothing will be deleted. Hash comes to picture during internal storage & workflow will not have any effect since payload path is same. The workflow status api will work & rendition will automatically of new one. You do not need any custom implementation here and happens out of the box. Not able to see the picture of custom implementation trying to implement. File a daycare ticket if above is not happening.
Views
Replies
Total Likes
So,Here i am programmatically tried to upload bulk assets(not using the GUI), and used assetManager.createAsset(), but what happens is that few assets get the renditions complete but the rest don't. assetManager.createAsset works for few assets but assets in count of 10 , few have updated renditions and few don't
Views
Replies
Total Likes
NitroHazeDev wrote...
So,Here i am programmatically tried to upload bulk assets(not using the GUI), and used assetManager.createAsset(), but what happens is that few assets get the renditions complete but the rest don't. assetManager.createAsset works for few assets but assets in count of 10 , few have updated renditions and few don't
You should see in logs why rendition was not created
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies