OOTB Asset API Checkin method in not working | Community
Skip to main content
Level 2
February 6, 2024
Solved

OOTB Asset API Checkin method in not working

  • February 6, 2024
  • 2 replies
  • 907 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by lukasz-m

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.

2 replies

Kamal_Kishor
Community Advisor
Community Advisor
February 6, 2024

@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/checkout/AssetCheckoutService.html#canCheckIn-com.day.cq.dam.api.Asset-

thanks.

kchauraAuthor
Level 2
February 6, 2024

@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)
lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
February 6, 2024

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.

kchauraAuthor
Level 2
February 6, 2024

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