You can use policies to verify whether conditions have
been met so that you can more efficiently manage and govern the assets
in your repository.
To watch a free movie about creating custom lifecycles and configuring
policies, see this On Demand Demo on ibm.com.
Policies for managing assets
Policies are
scripts that you can use to manage assets. You can configure policies
to run at specific times in a lifecycle, such as when an asset enters
or leaves a state. Broadly, when a policy runs, it performs one of
these actions:
Policies for managing lifecycles
With policies,
you can check for various conditions during the lifecycle of an asset
at the repository or community level. Although some policies duplicate
the features in
Asset types, you might want to use policies
for the following purposes:
- Limiting asset types: You can use policies instead of asset types
to limit the number of asset types in your repository. If you limit
the number of asset types, other users can submit assets more easily.
- Submitting assets: If you do not meet the constraints
for an asset type, you cannot submit a new asset. While policies
might prevent you from changing the state of an asset, they do not
prevent you from submitting a new asset to the repository.
- Restricting categories of assets: Because policies are configured
with lifecycles, policies can apply to assets that are of a certain
category.
- Restricting at certain points of a lifecycle: You can set policies
to run at specific states and at certain times, such as when the asset
enters a state.
- Restricting at a regular interval: You can set policies to repeat
at an interval of your choosing.
- Providing warnings instead of full errors: When a policy fails,
it can issue either a warning or an error.
- Automatically modifying assets: Instead of running tests, some
policies automatically modify assets for you. For example, you can
use the Categorize asset policy to assign categories to
an asset. You can use the Modify asset owner policy to change the owners of
an asset.
When policies can run during lifecycles
You
can assign policies to run at the following times while an asset is
in a particular state of a lifecycle:
- Asset save
- The policy runs every time that the asset is modified while it
is in that state.
- Entrance to state
- The policy runs when the asset first enters that state.
- Action
- The policy runs when a user attempts to manually change the lifecycle
state of the asset. For example, you might attempt to move the asset
from a Draft state to an Approved state.
- Delete
- The policy runs only if someone attempts to delete the asset while
it is in that state. If the policy reports a Pass or
a Warning, the asset is deleted. If the policy reports
an Error, the asset is not deleted.
- Timer
- The policy runs one time after a specified amount of time has
passed. The timer begins when the asset enters the state of the lifecycle.
In previous versions, the pending policies ran every 30 seconds. Beginning
in version 7.5.1, you can specify a time interval at which to run
a pending policy.
Display names for policies
For all policies, you can configure the
display name. In the Policy display name field,
you can specify a more descriptive label for a policy that you have
configured. For example, to describe what the policy does when it
runs, you can change from the default label of Default Policies
> Artifact Validation Policy to Check that there is a WSDL
file.
The policy display name must be unique for all policies
in the lifecycle. The display name for the policy is shown when you
configure transitions between asset states.