//Add Case Comments in Case Client (IBM Case Manager API)
public void addCaseCommentInHistory() throws Exception {
String caseFolderGUID = //GUID of Case Folder
String comment = "Hi"
CaseMgmtContext oldCmc = null;
log.info("Inside [WorkFlowHoldUnholdServices]addCaseComment():.............");
ICMManager icmManager=new ICMManager();
Connection conn=null;
DomainReference domainRef=null;
ObjectStoreReference osRef=null;
Folder folder=null;
try{
conn=// Establish Connection
if(conn!=null){
domainRef=ICMManager.getDomainReference(conn);
if(domainRef!=null){
osRef=ICMManager.getTargetOSReference(domainRef, fnObjectStoreName);
if(osRef!=null){
// retrieve case folder
folder = Factory.Folder.fetchInstance(osRef.getFetchlessCEObject(), caseFolderGUID, null);
// retrieve case using GUID
Id folderGUID = folder.get_Id();
Case cs = Case.getFetchlessInstance(osRef, folderGUID);
cs.addCaseComment(CommentContext.CASE, comment);
cs.save(RefreshMode.REFRESH, null, ModificationIntent.MODIFY);
log.info("History updated in Case");
}else{
log.info("History Not updated As Target OS Ref is NULL");
}
}
}
}catch (Exception e) {
log.error("addCaseCommentInHistory(String, String) - exception:"+ e,e); //$NON-NLS-1$
e.printStackTrace();
}
}
//for connection please click on below link
public void addCaseCommentInHistory() throws Exception {
String caseFolderGUID = //GUID of Case Folder
String comment = "Hi"
CaseMgmtContext oldCmc = null;
log.info("Inside [WorkFlowHoldUnholdServices]addCaseComment():.............");
ICMManager icmManager=new ICMManager();
Connection conn=null;
DomainReference domainRef=null;
ObjectStoreReference osRef=null;
Folder folder=null;
try{
conn=// Establish Connection
if(conn!=null){
domainRef=ICMManager.getDomainReference(conn);
if(domainRef!=null){
osRef=ICMManager.getTargetOSReference(domainRef, fnObjectStoreName);
if(osRef!=null){
// retrieve case folder
folder = Factory.Folder.fetchInstance(osRef.getFetchlessCEObject(), caseFolderGUID, null);
// retrieve case using GUID
Id folderGUID = folder.get_Id();
Case cs = Case.getFetchlessInstance(osRef, folderGUID);
cs.addCaseComment(CommentContext.CASE, comment);
cs.save(RefreshMode.REFRESH, null, ModificationIntent.MODIFY);
log.info("History updated in Case");
}else{
log.info("History Not updated As Target OS Ref is NULL");
}
}
}
}catch (Exception e) {
log.error("addCaseCommentInHistory(String, String) - exception:"+ e,e); //$NON-NLS-1$
e.printStackTrace();
}
}
//for connection please click on below link