SOA Governance and API Management : CentraSite Developers Guide : Application Framework : Lifecycle Management : Usage Sample for LCM
Usage Sample for LCM
// initialize SessionContext
SessionContext sessionContext = initSessionContext();
 
// get the LCMAdminManager
LCMAdminManager lcmAdminManager = sessionContext.getLCMAdminManager();
 
// Create a LCModel
LCModel lcModel = lcmAdminManager.createLCModel();
lcModel.setDisplayName("DisplayName");
lcModel.setDescription("Description");
 
// the LCModel must set a standard mapping Organization:
//com.softwareag.centrasite.appl.framework.beans.standard.Organization
lcModel.setOrganization((Organization)organization, false);
 
// Create LCStates
LCState lcStateA = lcModel.createLCState();
String stateAName = "State A";
lcStateA.setName(stateAName);
lcStateA.setDescription("stateADesc");
Collection<LCState> states = new ArrayList<LCState>();
states.add(lcStateA);
 
// add LCStates to lcModel
lcModel.addStates(states);
 
//lcModel must set an initial State
lcModel.setInitialState(lcStateA);
 
// add the keys of all Types that should be enabled for LCM
Collection<String> typesToBeEnabledForLCM = new ArrayList<String>();
typesToBeEnabledForLCM.add(typeToEnableForLCMKeys);
lcModel.addEnabledTypes(typesToBeEnabledForLCM);
 
//Save the lcModel using the LCMAdminManager
lcmAdminManager.saveLCModel(lcModel);
 
//Find existing LCModel.
//The result will contain all LCModels (active and inactive)
//that have the corresponding display name.
List<LCModel> listOfModels =
  lcmAdminManager.findLCModelByDisplayName("DisplayName",false);
Copyright © 2015- 2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback