Skip to main content
1-Visitor
October 31, 2018
Question

creating change activity using java api

  • October 31, 2018
  • 1 reply
  • 1888 views

I am trying to create a change activity object using java api and im getting the following error when i run it,

this error is occuring at FolderHelper.assignLocation(changeTask, folder_path_in_windchill);

 

wt.folder.FolderException:
A cabinet member must be assigned to a cabinet, not a subfolder. Cabinet member: "(Default task) Modify affected objects". Subfolder: "(Default task) Modify affected objects=.
at wt.folder.FolderHelper.assignLocations(FolderHelper.java:838)
at wt.folder.FolderHelper.assignLocation(FolderHelper.java:142)

1 reply

1-Visitor
October 31, 2018

Change activity is not folder based object. It's a CabinetMember instead, so you can only assign it to the root folder. 

Try to get the root folder first (containerRef is the context ref):

Folder folder = FolderHelper.service.getFolder("/Default", containerRef);

And then call the assignLocation:

FolderHelper.assignLocation((FolderEntry) changeActivity, folder);