CentraSite 10.7 | CentraSite Developer's Guide | API for JAXR | Service that Uses Another Service
 
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.findClassificationSchemeByNam
e(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 is now the source object of the association
callingService.addAssociation(usesAssociation);
 
ArrayList associationList = new ArrayList();
associationList.add(usesAssociation);
 
// save association and related modified objects
lcManager.saveAssociations(associationList, false);