Hi,Below is the code snippet I am trying to get the taskid using getRelatedTaskIds.While doing so I am getting the cstaskid length as 0,even though the file is attached in workflow and running.Kindly suggest where i am going wrong ?String csvPath="/international/main/common/****/WORKAREA/ALL/templatedata/yyy/test/data/fileNamefolder/fileName";logger.debug("csvPath : "+csvPath);CSVPath csvpath=new CSVPath(csvPath);logger.debug("after constructing csvpath");CSFile csfile=client.getFile(csvpath);logger.debug("CSFile : "+csfile.getName());int[] cstaskid;cstaskid=csfile.getRelatedTaskIds();logger.debug("cstaskid length : "+cstaskid.length);for(int m=0...){logger.debug("Task Id(s) : "+cstaskid);}CSTask cst = client.getTask(cstaskid[0]);logger.debug("CST getName : "+cst.getName());Thanks!Channaveer
io bet you are not getting the CSFile value. It should be null in your case.
If the CSFile was null, he'd get a Null Pointer Exception when he attempts to print out the CSFile's name.
DEBUG csvPath : /international/main/common/****/WORKAREA/ALL/templatedata/yyy/test/data/fileNamefolder/fileName DEBUG after constructing csvpath DEBUG CSFile : fileName DEBUG cstaskid length : 0 ERROR java.lang.ArrayIndexOutOfBoundsException: 0
CSFile doesn't throw null pointer exception.I am able to print the CSFile name in the loggerlogger.debug("CSFile : "+csfile.getName()); I am getting the length of the related task ids as 0,so in the for loop it throws an exception.Please check the below logger and kindly suggest DEBUG csvPath : /international/main/common/****/WORKAREA/ALL/templatedata/yyy/test/data/fileNamefolder/fileName DEBUG after constructing csvpath DEBUG CSFile : fileName DEBUG cstaskid length : 0 ERROR java.lang.ArrayIndexOutOfBoundsException: 0
If you run the CLT iwgetfilejobs using that same path, does it return anything?
I think you are trying to get task ids of the file which is not attached to your workflow. Check your file properties and it should have the attribute called workflow with the values of Job & Task ids(Workflow: Job 18930 > Task 18931)Are you executing this code from workflow task?