Validation Failure

While running some of my preprocessors, following exception is happening. It happens when I try to add an item to the slot of another item.

2009-11-10 11:53:46,460 INFO [STDOUT] com.percussion.webservices.PSErrorException: Validation failed due to the item id ‘36,059’ is not checked out by user ‘test.user’.
2009-11-10 11:53:46,461 INFO [STDOUT] at com.percussion.webservices.PSWebserviceUtils.validateItemCheckoutByUser(Unknown Source)
2009-11-10 11:53:46,461 INFO [STDOUT] at com.percussion.webservices.content.impl.PSContentWs.addContentRelations(Unknown Source)
2009-11-10 11:53:46,461 INFO [STDOUT] at com.percussion.webservices.content.impl.PSContentWs.addContentRelations(Unknown Source)

thanks
Manvinder

Is there any way we can put the item in check out state programmatically?



IPSContentWs cws = PSContentWsLocator.getContentWebservice();
cws.prepareForEdit(mycontentidList)


Does that not work? Of course make sure to catch the exception as well…
From documentation:

List<PSItemStatus> prepareForEdit(List<IPSGuid> ids)
                                  throws PSErrorResultsException
Prepares all items for the supplied ids to be edited for the requesting user. The user may call this multiple times for the same item but he is responsible to keep the correct PSItemStatus that this service returned with the first call.
Parameters:
ids - a list of item ids to be prepared for edit, not null or empty. It is an error if no item exists for any supplied ids. This must be a content guid obtained from one of the IPS*Ws interfaces or from the IPSGuidManager.
Returns:
a list of item status in the same order as requested. The item status will hold the status of an item in which it was before we prepared it for edit. Use this to call the releaseFromEdit service.
Throws:
PSErrorResultsException - if any item fails to be prepared for edit.