0

With the reference to this thread: https://tridion.stackexchange.com/a/4597/1556

I am looking for a similar answer where I need to fetch a list of publishing purposes(BPT) instead of PublicationTargets.

Could someone please suggest me this?

1
  • what you are trying to achieve explain a bit more detail?
    – Velmurugan
    Apr 12, 2021 at 7:32

2 Answers 2

2

For Core Service, read the BPT from the Publication and then you can get to TargetTypes and their Purpose:

var pub = (PublicationData)client.Read("tcm:0-x-1", null);  
var bpt = (BusinessProcessTypeData)client.Read(pub.BusinessProcessType.IdRef, null);
bpt.TargetTypes.Select(tt => tt.Purpose);
1
  • Thanks @Neil, this provides list of purpose using coreservice Apr 12, 2021 at 15:23
1

A Publication/Repository has a BusinessProcessType property which tells you what the selected Business Process Type (BPT) is for that Publication/Repository (if any).

A Business Process Type contains a set of Target Types which each have a distinct Purpose.

So, if you are working with TOM.NET and want to get a list of publishing purposes for a given context Publication, your code could look like this:

contextPublication.BussinessProcessType?.TargetTypes.Select(tt => tt.Purpose);

2
  • Hi Rick, thanks for suggestion, code is currently using coreservice reference and I am not able to figure out similar code in coreservice, let me check whether TOM.NET can be fit in my code, Apr 12, 2021 at 9:08
  • The domain model is the same for Core Service, but you will need more code: Read Publication, check its BusinessProcessType property (which is a Link containing the BPT ID), read the BPT and then obtain the Target Type purposes (the Target Types are part of the BPT). Apr 13, 2021 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.