Setting the policy state

Usually, you can set the state of a policy by following the steps described in Creating the HCL OneTest API policy topic. However, in some versions of CentraSite, you must perform extra steps to set the policy state.

About this task

In this topic, the HCL OneTest API policy is used as an example. The steps to add lifecycle states to the model, connect the states to each other in a logical way, and to associate the lifecycle with a service type are described.

Procedure

  1. In CentraSite, select Administration > Life Cycles > Models. The Lifecycle Model window opens.
  2. Click and open the HCL OneTest API Model for which you are changing the policy state.
  3. Add at least three lifecycle states to the model:
    1. On the States tab, click Add State.
    2. Enter a name for the state, for example, Inactive State.
    3. Repeat these steps to create two more lifecycle states, for example, one called Active State and one more, called Retired State.
  4. Connect the states to each other by setting target states to the values that you specified in step 3. To have more than one target state, click the plus sign (+) to the right of the existing target state.
    Here is an example of how you could define the target states for the lifecycle states in step 3 (note that there are two target states for the Active state):
    State Name Target State
    Inactive State Active State
    Active State Inactive State, Retired State
    Retired State (empty)

    These definitions allow the items in the Inactive State to be set to Active State only. Items in the Active state can either be retired by setting them to the Retired state or made inactive by setting then to the Inactive State. When an item is retired, it is irreversible.

  5. Associate the life cycle with a service type. You must associate the service type with this lifecycle model so that a service's state can be changed to the states that are defined here.
    1. In the HCL OneTest API Model, click the Associated Types tab.
    2. Under Available Types, locate the appropriate service type and select it. When you select a service type that is related to other service types in the list (for example, REST Service, IS Service Interface, XML Service and their Virtual counterparts), those service types are also selected.
    3. Click the Greater Than (>) symbol to move all the selected service types to the Selected Types list.
    4. Save your changes to the lifecycle model by clicking Save in the upper right corner.
  6. Associate a lifecycle model state with the policy:
    1. In the HCL OneTest API Lifecycle model, click Policies > Design/Change-Time.
    2. Under Name, click the name of the policy (HCL OneTest API).
    3. Click the States tab.
    4. Under Before the object enters state, click Add States.
    5. Click HCL OneTest API Model > Active State, and then click OK.
    The HCL OneTest API policies are now ready to use, and you can change the state on the HCL OneTest API policy.