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);