Customizing Lifecycle States

About this task

The Lifecycle Management of APIs and Packages section explains the default lifecycle and the possible transition that Developer Portal offers. However, you can modify the names of those states, the default state that must be assigned to an API or package, and the transition of the states.

To customize the default states names and their transition

  1. Go to the following location in the installation folder and open application-lcm.yml in Edit mode.
    SAGInstallDir/DeveloperPortal/workspace/webapps/portal.war/WEB-INF/classes
    applications-lcm YAML file with sample values
  2. Change according to your requirement in the corresponding section:
    • Add, edit, or remove the available states from the states section.
    • Specify the initial state of an API or package in the initial-state section.
    • Specify the state that must be applied to an API or package to make it active (expose it to consumers) in the active-state section.
    • Specify the flow of states from one state in the allowed-transitions section.
  3. If you add a state or modify a state, add the custom label under the Properties section of your active theme. For information on adding a label, see Adding new UI Labels.
  4. Save the changes. Restart Developer Portal for the changes to take effect.

Sample scenario

About this task

Consider adding a state called Review. This new state must be in between Draft and Live states.

To add the new state

Procedure

  1. Go to the following location in the installation folder and open application-lcm.yml in Edit mode.
    SAGInstallDir/DeveloperPortal/workspace/webapps/portal.war/WEB-INF/classes
  2. Add Review in the states section under the api and package sections.
  3. Add the states for the possible transitions from the Review state as shown in the following image:
    application-lcm YAML file with sample values
  4. Save the changes and restart Developer Portal.
  5. Click the menu options icon Menu options icon from the title bar and select Administration.
  6. From the Manage themes page, click the customize icon Customize icon next to the active theme.
  7. Select Properties and select Custom.
  8. Click the Click here link.
    The Add property screen appears.
  9. In the Key field, provide the new state name with the prefix as base.lifecycle.state and suffix as .LBL.
    For the example considered, you must provide base.lifecycle.state.review.LBL.
  10. Provide REVIEW in the Key field.
  11. Click Ok.
    The label is added to the lifecycle states.
    Important: Ensure that you add the custom label in the active theme for the changes to take effect.