Skip to main content
8-Gravel
Nov 21, 2023 12:27 PM UTC
Solved

Buildrule execution validation via API

I am using Windchill PDMLink Release 12.0 and Datecode with CPS 12.0.2.14

Is there a way to check if the buildrules have been executed on a given WTPart and its linked EPMDocuments?

handers-2Answer
8-Gravel
Nov 22, 2023 6:18 AM UTC

Problem solved with this solution:


Map<Persistable, Persistable> paramMap = new HashMap<Persistable, Persistable>();
paramMap.put(part, pers);
EPMBuildHistoryStatusHelper buildHelper = new EPMBuildHistoryStatusHelper();
Map<Persistable, EPMBuildHistoryStatus> resultBuildStatus = buildHelper.getBuildHistoryStatus(paramMap);
for (Persistable partKey : resultBuildStatus.keySet()) {
     EPMBuildHistoryStatus buildStatus = resultBuildStatus.get(partKey); // possible values IN_SYNC, OUT_OF_SYNC, NOT_RELATED, NOT_BUILT;
      logger.debug("buildStatus on "+part.getIdentity() +" and "+pers+" is: "+buildStatus.name());

3 replies

HelesicPetr
22-Sapphire II
Nov 21, 2023 1:42 PM UTC

Hi @handers-2 

In the system there is definitely that API because it is used in the compare functionHelesicPetr_0-1700573917015.png

but it has not to be just one function it can be a several functions together that compares build status and others information. 

 

You just need to find that API. 

 

PetrH 

Translate
handers-28-GravelAuthor
8-Gravel
Nov 21, 2023 2:04 PM UTC

Hi  HelesicPetr,
I know this compare, I decompiled already a lot OOTB files. I dont find a way.
com.ptc.windchill.enterprise.dsb.client.controller    DSBController.java -> the result is stored in compareSummaries

I thought this could be an option: BuildHelper.isMarkedAsBuilt((BuildableLink) link))
But the buildable link looks like it has to be a WTPartDescribeLink which for me does not make sense.
EPMDocs are not linked with it. And BuildRule or BinaryLink is not castable to "BuildableLink"


 
Translate
handers-28-GravelAuthorAnswer
8-Gravel
Nov 22, 2023 6:18 AM UTC

Problem solved with this solution:


Map<Persistable, Persistable> paramMap = new HashMap<Persistable, Persistable>();
paramMap.put(part, pers);
EPMBuildHistoryStatusHelper buildHelper = new EPMBuildHistoryStatusHelper();
Map<Persistable, EPMBuildHistoryStatus> resultBuildStatus = buildHelper.getBuildHistoryStatus(paramMap);
for (Persistable partKey : resultBuildStatus.keySet()) {
     EPMBuildHistoryStatus buildStatus = resultBuildStatus.get(partKey); // possible values IN_SYNC, OUT_OF_SYNC, NOT_RELATED, NOT_BUILT;
      logger.debug("buildStatus on "+part.getIdentity() +" and "+pers+" is: "+buildStatus.name());

Translate