Using change context resources

Most nonversioned artifacts implement the CqContextResource interface.

Some examples of the CqContextResource types:
  • The cq package includes CqAttachment, CqQuery, and CqRecord interfaces.
The process of modifying context resources involves three steps:
  1. Initiate®: The client specifies the action to be used in the modification (if needed), which declares the business rules to be followed in making the modifications. The proxy that initiates the modification determines the change context for the modification.
  2. Modify: The modifications are made to the resources and verified according to the business rules.
  3. Deliver: When all resources have been modified, all the changed resources in the change context are returned to their respective repositories.

This modification process allows the user to work with the client to coordinate changes to multiple resources, with the option of altering or abandoning at any time the changes to any of those resources.

After a user has initiated a modification, the changes made to the resources are not visible to other users or clients until the modifications are returned to their respective projects. The changes are confined to the change context used and visible only through proxies obtained from the Provider of that change context.

When the modification of a resource is initiated, a writable version of the resource is created in the change context associated with the proxy used. Unless the resource is being created, the properties of the original resource are copied to this new version. Subsequent operations that target the original resource through a proxy from the same change context are redirected to the version cached by the change context. Only those proxies obtained directly or indirectly from the provider for that specific change context see the changes before they are delivered.

For more information, see the Javadoc information for the CqContextResource interface.