This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to retrieve all baseline for specific project using pcms api ?

Hi all,

I have a problem to get all baseline for specfic project.

I have several baselines which are attached to different projects of a given product. Below, I managed to filter all the baselines of a given product but not of a project too. How can we filter by a product and a project please?

const char* product = "71_BWN00"; const char* project = "N6.LL"; PcmsObjStruct obj = { 0 }; obj.objType = PCMS_BASELINE; obj.noAttrs = 1; //obj.noAttrs = 2; obj.attrs = (PcmsObjAttrStruct*)PcmsEvntCalloc(sizeof(PcmsObjAttrStruct)); obj.attrs[0].attr = PCMS_ATTR_PRODUCT_ID; //obj.attrs[1].attr = PCMS_ATTR_PROJECT; PcmsSvaSetVal(obj.attrs[0].value, product, 0); //PcmsSvaSetVal(obj.attrs[1].value, project, 0); int noUids = 0; int* uids = NULL; if (PcmsQuery(conId, &obj, 0, &noUids, &uids) == PCMS_OK && noUids) { for (int i = 0; i < noUids; i ) { if (PcmsInitUid(conId, uids[i], PCMS_BASELINE, &obj) != PCMS_OK) continue; // use "obj" to get details of Product printf("%s \n", (_TCHAR*)obj.objId); } } PcmsObjFree(&obj); PcmsEvntFree(uids);
Parents Reply Children
  • 0   in reply to 

    Hello,

    You could try to using PcmsObjGetRels() with objType=PCMS_WORKSET and options=PCMS_BASELINE. First obtain the project uid (fromObjUid parameter), then invoke PcmsObjGetRels() and then get baseline uids (ptrPcmsRelStruct->uid).

    Alternatively if baselines related to project have similar unique ID’s, f.e.: PRJ1_BLN1,PRJ1_BL2… etc. in PcmsQuery () you can specify sql pattern for baseline id in PCMS_ATTR_OBJ_ID, f.e.:  PRJ1_BLN%