Creating document lifecycles

You can set up document lifecycles, or states that the document goes through during its life. Lifecycles consist of lifecycle policies and lifecycle actions.

Document lifecycles are states that the document goes through during its life. Document lifecycles consist of two objects:

  • Lifecycle policy: Defines the document's states. The policy also identifies the lifecycle action that executes in response to state changes.
  • Lifecycle action: User-implemented action that the system performs when a document moves from one state to another. A lifecycle action is typically coded by a developer, but managed by an administrator.

Document lifecycles

Document lifecycles are states that the document goes through during its life. Document lifecycles consist of two objects:

  • Lifecycle policy: Defines the document's states. The policy also identifies the lifecycle action that executes in response to state changes.
  • Lifecycle action: User-implemented action that the system performs when a document moves from one state to another. A lifecycle action is typically coded by a developer, but managed by an administrator.

Lifecycle action

A lifecycle action is a user-implemented Java™ class. Its methods handle the following state changes:

  • Promote: Moves a document forward to its next lifecycle state.
  • Demote: Returns document to its previous lifecycle state.
  • Reset: Returns document to its first lifecycle state with each new version.
  • Set in exception mode: Prevents the document from changing lifecycle states.
  • Clear from exception mode: Enables the document change lifecycle states.

Lifecycle promote and demote actions are unrelated to document versioning promote and demote actions. The reset state change is available only if the Reset option on the document lifecycle policy is selected.

Document lifecycles are always sequential. For example, the lifecycle status of a loan application occurs in the following order:
  1. Application
  2. Approval
  3. Funding
  4. Servicing
  5. Closed

The states reflect the order that an actual loan application moves from one process to another. As the document moves from one state to the next, the lifecycle state is updated. For example, upon approval, the document is promoted to its second state (Approval). After the bank finances the loan, the document is promoted again to its Funding state.

As you configure each state, define whether the document can be demoted from that state. For example, even after an application is approved, you can allow the application to be demoted if the customer is unhappy with the finance rate. You can demote the loan document to the Application state to gain approval under different terms. After the application has reached its final state (Closed), you can prevent it from being demoted by disabling the Demotion allowed option for the Closed state.

A lifecycle action implements the Content Engine API DocumentLifecycleActionHandler interface. For more information, see Lifecycle Actions. To view a sample source code implementation of DocumentLifecycleActionHandler, see LCAHandler.java in this Content Engine directory: drive:/Program Files/Filenet/Content Engine/samples. LCAHandler writes the name of the method that is invoked when the lifecycle state of a document changes.

Lifecycle policy assignment

You can assign a lifecycle policy to individual documents or to the Document class or its subclasses. When you create a document that uses a class with an associated lifecycle policy, the document uses it as a default lifecycle policy. You can override the default policy by choosing another lifecycle policy when you create the document or edit its properties.

Assigning the Document class or subclass to a document automatically attaches the lifecycle policy. For example, add a loan application to the object store as a document and assign it to the document class that includes a lifecycle policy for loan applications.

When you assign a lifecycle policy to a new document, a Lifecycle Policy tab is added to the document property sheet. Use the options on this tab to promote, demote, reset, or place the document in an exception state. Use this method to change a document state manually when you design and test your lifecycle policies. When you place the lifecycle policy onto a production server, custom Content Engine API programs make state changes to the documents to which the lifecycle policy is assigned.

Permissions on lifecycle policies

A user must have the Link a document access right on the lifecycle policy to check out documents associated with the lifecycle policy. If the user does not have this access right to the lifecycle policy, an InsufficientPermissionsException occurs when checking out the document, even if the user has full control permissions to the document and is the owner.

See Document lifecycle policies and lifecycle actions access rights for more information.

Lifecycle policies or workflow definitions

Lifecycle policies are best suited for defining simple lifecycle processes. For more complex document lifecycle processes, use the workflow applications to launch workflows that use workflow definitions.

Checklist: Lifecycles

Table 1. A checklist of steps and links to more information.
  Step Reference
Become familiar with lifecycle concepts and how they apply to Content Platform Engine objects. See Document lifecycles.
Identify the actions you want taken on documents. Use the Content Engine Java API to code a document lifecycle action handler. See Creating a Lifecycle Action Handler.
Create an action and specify the lifecycle action handler coded in the previous step. See Create a lifecycle action.
Create a lifecycle policy. When creating a policy, you assign an action to the policy. See Create a lifecycle policy.
Assign a policy to a document class. See Assign the lifecycle policy to a document class.
Test the lifecycle policy on a test document. See Test a lifecycle policy assigned to a class.
If the test (performed in the previous step) finds errors, modify the lifecycle action and repeat the test. See Changing a code module handler.