Wednesday, 14 December 2016

SOA Service Client : Expand GRM Relation

How to Expand GRM Relation for Primary object ?

private static void expandGRMRelationsForPrimary(ModelObject[] modelObject, String sRelationName)
    {
        com.teamcenter.services.strong.core.DataManagementService dms = com.teamcenter.services.strong.core.DataManagementService.getService(connection);

        ExpandGRMRelationsPref expandGRMRelationsPref = new ExpandGRMRelationsPref();
        expandGRMRelationsPref.expItemRev = false;
        expandGRMRelationsPref.info = new RelationAndTypesFilter[1];
        expandGRMRelationsPref.info[0] = new RelationAndTypesFilter();
        expandGRMRelationsPref.info[0].relationName  = "IMAN_requirement";

        ExpandGRMRelationsResponse expandGRMRelations = null;

        expandGRMRelations = dms.expandGRMRelationsForPrimary(modelObject, expandGRMRelationsPref);

    }

2 comments:

  1. which library i should use for ExpandGRMPref ?

    ReplyDelete
  2. Sometimes the wording of things obfuscates the value. What "expand GRM relation" means is how to find all the related objects to an object, as well as fetch the relation objects as well. This means you can find UGMASTER datasets related to an Item Revision and see that they use a Specification relation. This is one of the most powerful tools in the SOA arsenal. There is also a method called expandGRMRelationsForSecondary that acts like a "Impact analysis->where referenced", with the additional effect of fetch the involved ImanRelation objects.

    ReplyDelete