Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

OOTB Asset API Checkin method in not working

Avatar

Level 3

We are using the Page Lock/Unlocked and  Assets Checkout/Checking functionality in our workflow. As per the Implementation  Checkout is working as expected  but Checkin in not working. Using the below method. Has anyone faced this issue.

 

Checkout

assetCheckoutService.checkOut(asset);

Checking

assetCheckoutService.checkIn(asset);

 

Thank you.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @kchaura,

Please make sure that after executing checkIn or checkOut method you are saving changes explicitly using:

session.save();

or

resourceResolver.commit();

In other case, result of any of above method will not be persisted.

View solution in original post

4 Replies

Avatar

Community Advisor

@kchaura : Can you please check your logs and see if there is anything related to this (maybe an error or warning).

Also, can you please share which user are you using to do this i.e. a Service User etc. and if your user has permission to check-in (edit etc.).

You can try to print the value of this in your logs and see if it prints 'true' meaning your user can check-in the Asset-

canCheckIn(Asset asset)

https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/dam/api/ch...

thanks.

Avatar

Level 3

@Kamal_Kishor  Thanks for the responding. I do not see any errors and warnings in the log file.

FYI - I am using the workflow service user and provided the full access for the time being . I also checked the below method and it is returning true only that means no issues with the permissions. Let me know the next step. Thank You.

 

canCheckIn(Asset asset)

Avatar

Correct answer by
Community Advisor

Hi @kchaura,

Please make sure that after executing checkIn or checkOut method you are saving changes explicitly using:

session.save();

or

resourceResolver.commit();

In other case, result of any of above method will not be persisted.

Avatar

Level 3

@lukasz-m Thank you very much . This part was missing. Now it is working as expected.