As part of the Relativity Services API (RSAPI) Deprecation, content on this page referring to the RSAPI and the Patient Tracker application is in the process of being deprecated and will no longer be supported. For more information and alternative APIs, see RSAPI deprecation process.

Mass operations

The Services API provides you with the ability to perform an operation on multiple items with a single API call.

This page contains the following information:

See this related page:

Use Lists of Artifacts as input to CRUD methods

Each of the CRUD methods takes a List of Artifacts so you can perform these operations on multiple objects in single call. Use the following guidelines when submitting ArtifactRequests for CRUD operations:

  • You can pass ArtifactRequests of different types. For example, you could submit a list of ArtifactRequests to the Update() method that contains Artifacts for Documents and Dynamic Objects.
  • You must pass all the parameters required by the CRUD method that you are using for each ArtifactRequest. For example, you must pass the ArtifactType and list of Fields for each ArtifactRequest when creating Artifacts.
  • No transactional guarantee exists for the method as a whole. The creation, update or deletion of each ArtifactRequest is handled individually. If the operation against a single ArtifactRequest fails, the Success flag on the Result object for the corresponding ArtifactRequest is set to False, and returned in the ResultSet. The operations on the other ArtifactRequests will proceed.

Mass create methods

You can use the MassCreate(), MassCreateWithDetails(), and MassCreateWithAPIParameters() methods to create multiple Dynamic Objects. The methods use a template to minimize the repetition of Field values that are common to all the Artifacts.

The MassCreateWithDetails() and MassCreateWithAPIParameters() methods also populate the Results property with success and failure information as part of the object creation process. This information is provided even when a partial failure occurs.

Additionally, MassCreateWithAPIParameters() can be used to link to single- or multi-object instances by ArtifactIDs. In order to do so, you must pass a comma-delimited list of corresponding Field ArtifactIDs.

The mass create methods take the Fields specified for each Artifact included in the List of Artifacts passed as a parameter.

The mass create methods are subject to the following restrictions:

  • Only Dynamic Objects can be created with this method.
  • All Artifacts to be created must be of the same ArtifactType, and all Fields must be specified by Name. Don't use the ArtifactID.
  • Each Field in the template must have a value, and be specified by Name. Don't use NULL values or specify Fields by ArtifactID.
  • All required Fields must have values.

Note: The Instance setting table contains the MaxNumberOfArtfactsToMassCreate setting, which controls the maximum number of Dynamic Objects that can be create with this method. The default value is currently 1,000,000.

MassEdit() method

You can use the MassEdit() method to apply the same set of Field updates to multiple Documents in a single call. This method uses a template Document as an ArtifactRequest, which determines how the call updates other documents. It also takes a list of ArtifactIDs that identify the Documents for editing. You can only update Documents with this method, and updates aren't propagated to related documents as they are in the Relativity web UI.

Note: The Instance setting table contains the MaxNumberOfArtfactsToMassEdit setting, which controls maximum number of documents edited in a single call. The default value is 1,000,000. In addition, the MassEdit() method updates the documents in batches. MassEditBatchAmount is the configuration setting that controls the number of documents in each batch, and it is also used by the Relativity web UI. The default and recommended value is 1,000.

ExecuteBatch() method

You can use the ExecuteBatch() method to combine multiple operations in a single database transaction. For example, you could create a set of Artifacts and update a set of Documents using a single round-trip to the Services API.

Use the following guidelines when calling this method:

  • Input to the ExecuteBatch() method is a List of Command objects.
  • All operations execute within a database transaction. If an error occurs, the entire batch is rolled-back.
  • Executing a large number of create, update, and delete operations may take considerable time and result in table locking.

Note: The Instance setting table contains the MaxArtifactBatchSizeForExecuteBatch setting, which controls the number of Artifacts processed in a single method call. The default value is 2000, but you can update it as necessary. This setting has been implemented to limit the length of time that database transaction opened by ExecuteBatch() method holds locks on tables, preventing Relativity users from experiencing errors.