Sorry my mistake
if(primaryBusinessObject instanceof wt.doc.WTDocument) { wt.doc.WTDocument doc = (wt.doc.WTDocument) primaryBusinessObject; if(wt.vc.wip.WorkInProgressHelper.isCheckedOut(doc)) throw new wt.workflow.WfException("Document " + wt.identity.IdentityFactory.getDisplayIdentifier(primaryBusinessObject) + " in c/o state"); }