Version 9.6
 —  CentraSite API for JAXR  —

A Service that Uses Another Service

If a service calls another service, this should be modeled with the pre-defined "Uses" association.

Service callingService = ...;
Service calledService = ...;

// find the "Uses" concept
ClassificationScheme associationType 
      = bqManager.findClassificationSchemeByName(Collections.singleton(FindQualifier.EXACT_NAME_MATCH), "AssociationType"); 
Concept usesConcept 
      = bqManager.findConceptByPath("/" + associationType.getKey().getId() + "/Uses");

// create association of type "Uses"
Association usesAssociation = lcManager.createAssociation(calledService, usesConcept);

callingService.addAssociation(usesAssociation);  // callingService is now the
                                                 // source object of the association

ArrayList associationList = new ArrayList();
associationList.add(usesAssociation);
lcManager.saveAssociations(associationList, false);  // save association and
                                                     // related modified objects

Top of page