AnsweredAssumed Answered

Exception while invoking TaskListener: null

Question asked by praveenshanmugam on Apr 17, 2017
Latest reply on Apr 20, 2017 by gdharley

I implement the TaskListener, i gotr the exception while task being created.

code are

 

long workflowTaskId=0l;
long compId=0l;
@Override
public void notify(DelegateTask arg0) {
// TODO Auto-generated method stub
workflowTaskId=Long.parseLong(arg0.getId());
compId=Long.parseLong(arg0.getTenantId());

 

System.out.println("Company ID "+compId);

System.out.println("%%%%%%%Activiti Working*****************"+ arg0.getProcessInstanceId()+" "+arg0.getName()+arg0.getId());

getMethod();
}

private void getMethod(){

try{
Company company = CompanyLocalServiceUtil.getCompanyByMx(PropsUtil.get(PropsKeys.COMPANY_DEFAULT_WEB_ID));
//compId = company.getGroup().getGroupId();
}catch(PortalException e){}
catch (SystemException se) {
// TODO: handle exception
}

try{

System.out.println("workflowTaskId "+workflowTaskId);
System.out.println(WorkflowTaskManagerUtil.getWorkflowTask(compId, workflowTaskId));
System.out.println(WorkflowTaskManagerUtil.getWorkflowTask(compId, workflowTaskId).getOptionalAttributes());
System.out.println(WorkflowTaskManagerUtil.getWorkflowTask(compId, workflowTaskId).getOptionalAttributes().get("entryClassPK"));

String classPk= WorkflowTaskManagerUtil.getWorkflowTask(compId, workflowTaskId).getOptionalAttributes().get("entryClassPK").toString();
System.out.println("classPk "+classPk);
long fileEntryId=DLFileVersionLocalServiceUtil.getFileVersion(Long.parseLong(classPk)).getFileEntryId();
System.out.println("fileEntryId "+fileEntryId);
String name=DLFileVersionLocalServiceUtil.getFileVersion(Long.parseLong(classPk)).getTitle();
System.out.println("name "+name);
long chapfoldId=DLFileVersionLocalServiceUtil.getFileVersion(Long.parseLong(classPk)).getFolderId();
System.out.println("chapfoldId "+chapfoldId);
long bkfoldId=DLFolderLocalServiceUtil.fetchFolder(chapfoldId).getParentFolderId();

System.out.println("MytaskcreateListener Called \nworkflowTaskId "+workflowTaskId+"\nclassPk "+classPk+"\nfileEntryId "+fileEntryId+"\tname " +name+"\tbook "+bkfoldId );

}catch(PortalException p){}
catch (SystemException see) {
// TODO: handle exception
}

}
}

Outcomes