CentraSite Developer's Guide : Application Framework : Lifecycle Management
Lifecycle Management
The Application Framework supports the Lifecycle Model (LCM) functionality. The LCM provides the ability to define and track the life-cycle of a service and also provides a way to define and enforce policies that govern the path of an asset through the lifecycle. As a result, these policies can be automated or enforced consistently. Using registry beans, we now support lifecycle-aware registry beans.
The definition of an LC Model starts with the definition of an LC Model taxonomy. The state model of an LC Model is a standard state model (deterministic finite automaton, DFA). The model itself is represented as the concepts of the LC Model taxonomy. A taxonomy is not defined for this, so associations are used to represent the state transitions. The states themselves are just concepts within the taxonomy.
In order to create a lifecycle-aware registry bean, the user must create a registry bean that extends com.softwareag.centrasite.appl.framework.lcm.beans.LifeCycleAware. Also, the implementation of this registry bean must extend the com.softwareag.centrasite.appl.framework.lcm.beans.LCAwareDynamicRegistryBean. This ensures that the registry bean is lifecycle-aware and is ready to use for lifecycle operations.
In order to manage the lifecycle models and states, the LCM Manager must first be initialized:
com.softwareag.centrasite.appl.framework.SessionContext
sessionContext = initSessionContext();
com.softwareag.centrasite.appl.framework.lcm.LCMAdminManager
lcmAdminManager = sessionContext.getLCMAdminManager();
The com.softwareag.centrasite.appl.framework.lcm.LCMAdminManager provides all operations for creating, modifying and deleting LCModels. State models for Lifecycle Management models can theoretically be complex and encompass multiple machines and LCStates.
LCModels are state machines for Lifecycle Management and the state machines may not have any states that cannot be reached. The com.softwareag.centrasite.appl.framework.lcm.LCModel provides methods for all operations that can be performed on an LCModel. When the LCModel becomes active, no changes to the LCModel are possible; instead, a new version of the LCModel can be created using LCModel.createVersion().
The com.softwareag.centrasite.appl.framework.lcm.LCState provides access to the LCState and state specific operations.
For more information about the methods and functionality supported by LCModel, check the Javadoc of the framework.
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- 2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback