Executing custom code after checkin process

Hi!

I am new to java and DFC development.
We have developed a custom code that is ideally executed after the checkin process is completed. We use the below if statement to trigger the custom code:

if (strAction.equalsIgnoreCase("checkin"))

{ //custom code here

}

unfortunately, the code is executed when the checkin process is initiated. This results in the custom code using the old r_object_id instead of the new r_object_id of the checked in document . What's the best way to ensure that the checkin process is completed before the custom code is executed?

Thanks!

Tagged:

Answers

  • Michael McCollough
    Michael McCollough E Community Moderator

    Has been a looooong time since I have done WDK/Webtop but I believe what you are looking for is in the WDK Development guide. You want to extend and register the checkin action class but use your own IActionCompleteListener. That will allow you to put code once the action (checkin) has completed. The map returned should have the new objectId after the check (or same object id if checkin as same version).

    An online version (older but this implementation has not changed I do not beleive): http://www.jouvinio.net/wiki/images/b/bb/Web-Development-Kit-65-Development-Guide.pdf

    Snippet:

  • Hello Michael,

    Thanks for the response! The example in the WDK guide is using copy operation. I think it may be a bit different for checkin since it is defined as a repository operation vs UI action like copy. Can you share an example I can use to start with?

    Thanks!
    Lericho

  • T_G
    T_G E Member

    You can do a TBO and perform you action after the checkin is complete.

  • Michael McCollough
    Michael McCollough E Community Moderator

    @lericho5326

    WDK uses checkin action driven from menu so the listener can be done on this functionality. You can find the action definition I believe in {wdkapp}/webcomponent/actions/dm_sysobject_actions.xml.

    as @T_G suggests you can use a TBO to do this as well. Just depends on if you want to intercept and do something at the service/dfc layer or you need to do something at the UI layer (wdk action intercept). You could also extend the action, creating your own override/implimentation as well. There are quite a few ways to do this just depends on your overall desired end result/need.