I'm trying to write a Documentum DFC executable that will check out an object from a given docbase. I've been able to establish a session with the docbase, retrieve the object to be checked out and verify that it is not already checked out. But when I try to add the object to the DfCheckoutOperation in the following code
IDfCheckoutOperation checkoutOperation = new DfCheckoutOperation();
Exception in thread "main" java.lang.NullPointerException
The problem I ran into stemmed from me utilizing old sample code that is now obsolete. The example I found online was apparently pre-Documentum-6.x, so where I was instantiating the DfCheckoutOperation via a
new() method call, I should have been using the following code instead:
IDfClientX clientX = new DfClientX(); IDfCheckoutOperation checkoutOperation = clientX.getCheckoutOperation();
(The version of Documentum I'm using is 6.7) I figured out my problem by looking around the EMC Community forum and finding a post with a similar operations issue.
Note that the way I was instantiating my DfCheckoutOperation object was not generating a null reference; the NPE I experienced stemmed from some other object within the implementation of the
add() method for the 6.x release. Also note that the example of the checkout operation in the whitepaper cited in the comments is up-to-date, so use that to avoid the situation I found myself in.