UpdateStateRecord Activity

UpdateRecordState changes the state of the record, such as unconfirmed to confirmed.

The table ATTRIBUTEHISTORY tracks the changes to attributes. When the state is changed, an entry is created in ATTRIBUTEHISTORY to note this. Similarly when a record is deleted, the ACTIVE flag change is noted down.

If attributeHistory is maintained, the same table can note the record state change. However, record state change does not change the ownership of record (event and process log). To generate the correct record change, the step that did the state change (process log ID) must be passed into the method.

When rollback is being executed and the activity associated with the step is updateRecordState, the attribute history is looked up. In this case, the repository metadata must have the attribute history enabled. The history identifies the older state to revert the state of the record.

You cannot reverting the state, if the attribute history is not saved (attribute history is not enabled in repository metadata). In this case, rollback only works if the workflow step that created the versions roll back the state that was changed.

The following is how the record state is reverted:

  1. If step action = UpdateRecordState, state reversal is needed.
  2. Get affected record versions using UpdateRecordState.
    Note:
    • There can be more than one version of the record in same step (reject all versions).
    • There can be a floated and merged, floated, or merged version of the record.
  3. Get only those records which have state change and process them separately. A later pass handles versions that were created in this step.
  4. For each version, get attribute history of state change. Find the older state and update the version.
  5. If there is any impact on the golden copy, index and cache. Then update accordingly.