Changes the current, user-defined lifecycle state of this document, or the current state of a ICmTask object
(see TaskState for a list of the states).
The ChangeState method must be followed by a Save() or an equivalent batch operation to commit the state change.
Every state change generates a IChangeStateEvent,
to which you can subscribe or audit.
Namespace:
FileNet.Api.CoreFor documents, you cannot change the state of a document that is a reservation object. Valid lifecycle states are defined by the collection of DocumentState objects belonging to this document's associated DocumentLifecyclePolicy object.
For documents, the LifecycleChangeFlags constant can be used as follows:
- PROMOTE: Promotes the document's current lifecycle state to the next state in its document lifecycle policy and sets the document's CurrentState property to the name of the next state. Throws an error if the document is in the exception state, in the first state of its lifecycle, or does not allow demotion.
- DEMOTE: Demotes the document's current lifecycle state to the previous state in its document lifecycle policy and sets the document's CurrentState property to the name of the previous state, unless the CanBeDemoted property of the document’s current state (DocumentState object) is set to false. Throws an error if the document is in the exception state or in the first state of its lifecycle.
- SET_EXCEPTION: Places the document into the exception state and sets its IsInExceptionState property to true. Throws an error if the document's IsInExceptionState property is already set to true.
- CLEAR_EXCEPTION: Removes the document from the exception state and sets its IsInExceptionState property to false. Throws an error if the document's IsInExceptionState property is already set to false.
- RESET: Resets the lifecycle state to the initial state in its document lifecycle policy and sets the document's CurrentState property to the name of the initial state. Throws an error if the document is in the exception state.
For tasks, the LifecycleChangeFlags constant can be used as follows:
- PROMOTE: Promotes the task's current state to the next state.
- DEMOTE: Demotes the task's current state to the previous state.
- SET_EXCEPTION: Places the task into the exception state.
- CLEAR_EXCEPTION: Removes the task from the exception state.
- RESET: Not supported for tasks.
For a detailed description of task states, see Task State Machine.
Assembly: FileNet.Api (in FileNet.Api.dll)
Syntax
Visual Basic (Declaration) |
---|
Sub ChangeState ( _ flags As LifecycleChangeFlags _ ) |
C# |
---|
void ChangeState( LifecycleChangeFlags flags ) |
Visual C++ |
---|
void ChangeState( LifecycleChangeFlags flags ) |
JavaScript |
---|
function changeState(flags); |
Parameters
- flags
- Type: FileNet.Api.Constants..::.LifecycleChangeFlags
A LifecycleChangeFlags constant that specifies the type of state transition to be applied to the document or task.