Hi All,
I have a workflow to which has an attachment.This attachment is attached at a particular activity through code.
Now there is a requiredment that in next activity user can add an attachment...but in this case..the prveious attachemnt should be checked out and new attachment should be added as its next version..
I am using below peice of code but it doesnt help
IDfSysObject sysobj = (IDfSysObject) idfSession.getObject(idfattachmentid);
IDfClientX clientx = new DfClientX();
Here idfDoCId is the id of previous document.
Please let me know what is the issue.
IDfCheckoutOperation checkoutOperation = clientx.getCheckoutOperation();
checkoutOperation.add(sysobj);
DfLogger.debug(this, "attachment added for checkout::!!!!", null,
null); //check and execute checkout operation
if(checkoutOperation.execute()){DfLogger.debug(
this, "attachment checked out!!!!", null,
null);
//check in the new attachment
IDfCheckinOperation checkinOperation = clientx.getCheckinOperation();checkinOperation.add(idfDoCId);int versionlabel= IDfCheckinOperation.NEXT_MAJOR;checkinOperation.setVersionLabels(
"Document from SCanning");
if(checkinOperation.execute()){DfLogger.debug(
this, "Checkin Success!",null,null);DfLogger.debug(
this, "versionlabel is!"+versionlabel,null,null);DfLogger.debug(
this, "The object name of new version is"+sysobj.getObjectName(),null,null);sysobj.mark(
"Document from Backlog SCanning");sysobj.setObjectName(strDocumentName);
sysobj.save();
DfLogger.debug(this, "The object saved::"+sysobj.getObjectName(),null,null);
}