Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Folder structure for our product:
Design
Manufacturing
Design Engineer creates part in Design Folder.
MBOM Creator open the part in Manufacturing Associate Part Structure Browser (MPSAB) and then creates a New Downstream Branch of the part. The default location for this is /Default of the Product which can be changed manually by browsing to required location.
We want to change this Default location to /Default/Manufacturing.
Please suggest steps.
It is controlled by a preference.
If you like, you can also write a delegate that uses a logic for number, location and so on.
Hi Binesh,
We already tried that preference. This preference sets a fixed location for creation of Downstream parts i.e a folder where downstream parts from all the products will be stored. What we need is that Downstream parts of each product should be stored in the Manufacturing folder of that particular product itself.
Regards,
Prasad
Hi Prasad, I know it is not easy to set this preference in each of the products. I think writing your own delegate overriding DefaultDownstreamLocationDelegate is the elegant. I wish this is more configurable
We need exactly the same functionality. Setting the downstream location to a default Manufacturing folder in each product.
@BineshKumar1 Do you happen to have an example on how to create such a custom delegate?
hi
you can see on the online help
regards
Thank you Gregory,
I was looking for this forever!!!
Hi,
PFB custom delegate to achieve this functionality,
public class MyCustomDelegateLocation extends DefaultDownstreamLocationDelegate{
private static final String LOCATION_PATH_SEPARATOR = "/";
@Override
public STAInitialLocationValueBean getSTAInitialLocationValueBean(List<ObjectReference> refs){
//Returns the location of the passed objects
STAInitialLocationValueBean locationBean = new STAInitialLocationValueBean();
for (final ObjectReference ref : refs) {
WTContained persistable = (WTContained) ref.getObject();
final Identifier associative_identifier = EntityUtils.toIdentifier(persistable);
if (persistable instanceof Associative) {
locationBean.addFolderIdForLocation(LOCATION_PATH_SEPARATOR + persistable.getContainerName(),Manufacturing)
locationBean.addInitialLocationForAssociative(associative_identifier, LOCATION_PATH_SEPARATOR + persistable.getContainerName());
}
}
return locationBean;
}
}
Thanks and Regards,
Thiagarajan
Hello Thiagarajan,
We tested this example but unfortunately the code is not working properly. Did you test it or adjusted it? Is it working at your system? If yes, can you share the working code?
Hi Arjen,
Have you tested other code to work properly with DefaultDownstreamLocationDelegate?
Thanks!
See this article: https://www.ptc.com/en/support/article/CS278477
Maybe that helps you further.
Thank you for your article, but unfortunately the code is not working properly.
BR,
Hi @IViana
You need to be more descriptive. What does it mean the code does not work properly?
PetrH