IBM Enterprise Records, Version 5.1.2    

Performing bulk operations

You use bulk operations to perform a specific operation on multiple objects. This ensures that objects are updated in the same way and at the same time.

For example, you might want to relocate a number of records existing in a record folder. Instead of moving each record individually, you can move all the records in a single operation. This section provides information about the following types of bulk operations.

Close/Reopen

You can perform the close operation on multiple objects in an object store by calling the close method on an RMBulkOperationsUtil object. Specify the GUID of each object to close in the asArrObjectIDs string array parameter. However, all the objects specified in the string array must extend the ClosableObject interface. You must also specify a reason for closing the objects. The following code fragment calls the Close method to close multiple objects.
//Closes multiple objects 
public void close(RMObjectStore aoRMOS)
{
   //Constructs a String array of GUIDs of the object to close
   String[] lsArrIDs = {"{5F5EA7FD-D257-42DC-B268-A6CAC8098393}",
      "{07840AA1-7C11-4A4A-8CF8-D57FA4F9D875}",
      "{715DDEFC-529B-4E49-B562-BB7A22DC2BB6}",
      "{1E4108CB-E428-4282-8760-33599B13D759}"};

   // Calls the Close method
   RMBulkOperationResults loResults 
      = new RMBulkOperationsUtil().close(aoRMOS, lsArrIDs, "Test close");
}
To reopen multiple closed objects, call the reOpen method on an RMBulkOperationsUtil object. The following code fragment calls the reOpen method.
//Reopens multiple objects 
public void reOpen(RMObjectStore aoRMOS) 

{ 
   //Constructs a String array of GUIDs of the objects to reopen
   String[] lsArrIDs = {"{5F5EA7FD-D257-42DC-B268-A6CAC8098393}",
      "{07840AA1-7C11-4A4A-8CF8-D57FA4F9D875}",
      "{715DDEFC-529B-4E49-B562-BB7A22DC2BB6}",
      "{1E4108CB-E428-4282-8760-33599B13D759}"}; 

   //Calls the Reopen method
   RMBulkOperationResults loResults = 
      new RMBulkOperationsUtil().reOpen(aoRMOS, lsArrIDs, true, "test"); 
}

For more information about closing and reopening the state of an object, refer to Performing operations on container objects.

InActivate/Activate

You can inactivate multiple objects in an object store by calling the inActivate method on an RMBulkOperationsUtil object. Specify the GUID of each object to inactivate in the asArrObjectIDs string array parameter. However, all the specified objects should extend the ActivableObject interface. You must also specify a reason for inactivating the objects. The following code fragment calls the inActivate method:
//Inactivates multiple objects 
public void inActivate(RMObjectStore aoRMOS) 

{ 
   //Constructs a String array of GUIDs of the objects to inactivate
   String[] lsArrIDs = {"{5F5EA7FD-D257-42DC-B268-A6CAC8098393}",
      "{07840AA1-7C11-4A4A-8CF8-D57FA4F9D875}",
      "{715DDEFC-529B-4E49-B562-BB7A22DC2BB6}",
      "{1E4108CB-E428-4282-8760-33599B13D759}"}; 

   // Calls the inActivate method 
   RMBulkOperationResults loResults = 
      new RMBulkOperationsUtil().inActivate (aoRMOS, lsArrIDs, "TEST - inactivate"); 
}
You can activate multiple objects in an object store by calling the activate method on the RMBulkOperationsUtil interface. Specify the GUID of each object to activate in the asArrObjectIDs string array parameter. However, all the specified objects should extend the ActivableObject interface. The following code fragment activates multiple objects:
//Activates multiple objects 
public void activate(RMObjectStore aoRMOS) 

{ 
   //Constructs a String array of GUIDs of the objects to activate
   String[] lsArrIDs = {"{5F5EA7FD-D257-42DC-B268-A6CAC8098393}",
   "{07840AA1-7C11-4A4A-8CF8-D57FA4F9D875}",
   "{715DDEFC-529B-4E49-B562-BB7A22DC2BB6}",
   "{1E4108CB-E428-4282-8760-33599B13D759}"}; 

   //Calls the activate method and passes the appropriate parameters 
   RMBulkOperationResults loResults = 
      new RMBulkOperationsUtil().activate(aoRMOS, lsArrIDs, "TEST - activate"); 
}

For more information about activating and inactivating the state of an object, refer to Performing operations on container objects.

Hold/Unhold

You can place multiple objects on multiple holds in an object store by calling the hold method on an RMBulkOperationsUtil object. Specify the GUID of each object to place on hold in the asArrObjectIDs string array parameter. However, the specified objects must extend the HoldableObject interface. In addition, you specify the Hold objects that are to be associated with the entities in the aoHolds parameter, which is a Holds collection. You can specify multiple Hold objects in this collection. The following code fragment shows how to place multiple objects on hold:
//Places multiple objects on hold 
public void holds(RMObjectStore aoRMOS) 

{ 
   //Constructs a String array of GUIDs of objects 
   String[] lsArrIDs = {"{C316112D-EFCE-47C0-9934-2B7954D51305}", 
      "{64722BC8-8BE3-4821-AC51-D76F91ED2DDC}",
      "{5F5EA7FD-D257-42DC-B268-A6CAC8098393}",
      "{6F796A6E-61D1-4CEA-9BDE-4FB57802F0D5}",
      "{F8C2B2E0-ABEC-4462-BB1F-47E09F1CE2AD}"}; 

   //Constructs a Hold collection 
   Hold loHold = (Hold)aoRMOS.getObject(RMType.RM_TYPE_HOLD, 
      "{E2A62FD8-9B6E-45CB-B8C9-3D7976FC5449}"); 
   Hold loHold_1 = (Hold)aoRMOS.getObject(RMType.RM_TYPE_HOLD, 
      "{4D6F2789-7C42-4C1D-890D-641BCA91F645}"); 

   // Get an empty collection of RMObjects 
   RMObjects loHolds = aoRMOS.getRMObjects(); 
   loHolds.add(loHold); 
   loHolds.add(loHold_1); 

   //Calls the hold method 
   RMBulkOperationResults loResults = 
      new RMBulkOperationsUtil().hold (aoRMOS, lsArrIDs, loHolds); 
}

To dissociate multiple objects from the Hold object or from multiple Hold objects, call the unHold method on an RMBulkOperationsUtil object. Specify the GUID of each object to dissociate from the Hold object(s) in the asArrObjectIDs string array parameter, as shown in the following code fragment:

//Dissociates multiple objects from multiple Hold objects
public void unhold(RMObjectStore aoRMOS) 

{ 
   String[] lsArrIDs = {"{C316112D-EFCE-47C0-9934-2B7954D51305}", 
      "{64722BC8-8BE3-4821-AC51-D76F91ED2DDC}",
      "{5F5EA7FD-D257-42DC-B268-A6CAC8098393}", 
      "{6F796A6E-61D1-4CEA-9BDE-4FB57802F0D5}",
      "{F8C2B2E0-ABEC-4462-BB1F-47E09F1CE2AD}"}; 

   // Constructs a Hold collection 
   Hold loHold = (Hold)aoRMOS.getObject(RMType.RM_TYPE_HOLD, 
      "{E2A62FD8-9B6E-45CB-B8C9-3D7976FC5449}"); 
   Hold loHold_1 = (Hold)aoRMOS.getObject(RMType.RM_TYPE_HOLD, 
      "{4D6F2789-7C42-4C1D-890D-641BCA91F645}");

   // Get an empty collection of RMObjects 
   RMObjects loHolds = aoRMOS.getRMObjects(); 
   loHolds.add(loHold); 
   loHolds.add(loHold_1); 

   // Calls the unHold method 
   RMBulkOperationResults loResults = 
      new RMBulkOperationsUtil().unHold (aoRMOS, lsArrIDs, loHolds); 
}

For more information about placing objects on hold, refer to Performing operations on container objects.

Relocate

To relocate multiple objects in a file plan, call the move method on an RMBulkOperationsUtil object. Specify the GUID of each object to move in the asArrObjectIDs string array parameter. In addition, you must specify the source and destination parameters. However, the source parameter will be ignored if you are moving a RecordCategory or RecordFolder object. This parameter is used only for a RecordInfo object. You also must specify a reason for relocating the objects, and you must set the disposition schedule to be assigned to the entities after the move. The following code fragment calls the move method to change the location of multiple objects.
// Relocates multiple records
public void move(RMObjectStore aoRMOS) 

{ 
   // Constructs a String array of GUIDs of the objects to relocate
   String[] lsArrIDs = {"{5F5EA7FD-D257-42DC-B268-A6CAC8098393}", 
      "{07840AA1-7C11-4A4A-8CF8-D57FA4F9D875}",
      "{715DDEFC-529B-4E49-B562-BB7A22DC2BB6}",
      "{1E4108CB-E428-4282-8760-33599B13D759}"}; 
   RMRecordContainer loSource = (Volume) aoRMOS.getObject(RMType.RM_TYPE_VOLUME, 
      "{5446B4C2-3719-416D-833F-7BBFDD53E939}"); 
   RMRecordContainer loDestination = 
      (RMRecordContainer) aoRMOS.getObject(RMType.RM_TYPE_RECORDCATEGORY, 
      "{5F5EA7FD-D257-42DC-B268-A6CAC8098393}"); 

   // Calls the move method 
   RMBulkOperationResults loResults = 
      new RMBulkOperationsUtil().move (aoRMOS, lsArrIDs, loSource,
      loDestination, "TEST", null); 
} 

For more information about relocating an object, refer to Performing operations on container objects.

File

You can perform the file operation on multiple records by calling the file method on an RMBulkOperationsUtil object. Specify a string array containing the GUIDs of all the RecordInfo objects to file in the asArrObjectIDs parameter. In addition, you need to specify the destination record container where the RecordInfo objects are filled in, as shown in the following code:
//Files multiple records
public void file(RMObjectStore aoRMOS) 

{ 
   // Construct a String array of GUIDs of the objects to file
   String[] lsArrIDs = {"{E6A8147E-4258-4328-BAEC-2733EEE52935}"}; 
   RMRecordContainer loDestination = (RecordCategory) aoRMOS.getObject(RMType.RM_TYPE_RECORDCATEGORY, 
      "{5F5EA7FD-D257-42DC-B268-A6CAC8098393}"); 

   // Calls the file method 
   RMBulkOperationResults loResults = 
      new RMBulkOperationsUtil().file(aoRMOS, lsArrIDs, loDestination); 
}

Register External Events

You can register an external event with multiple objects by calling the registerExternalEvent method on an RMBulkOperationsUtil object. Specify a string array containing the GUIDs of all the disposal triggers to update in the asArrObjectIDs parameter. You must also specify a Date object; all the disposal triggers are updated with the specified Date value. The following code snippet calls the registerExternalEvent method.
//Registers an external event with multiple objects 
public void regExtEvent(RMObjectStore aoRMOS) 

{ 
   // Constructs a String array of GUIDs of objects 
   String[] lsArrIDs = {"{5F5EA7FD-D257-42DC-B268-A6CAC8098393}", 
      "{07840AA1-7C11-4A4A-8CF8-D57FA4F9D875}", 
      "{715DDEFC-529B-4E49-B562-BB7A22DC2BB6}", 
      "{1E4108CB-E428-4282-8760-33599B13D759}"}; 
   String lsArrEventIds[] = new String[]{"{CE1D0BC1-B223-4BC9-AB72-2C5C573BDDCB}93}"}; 

   // Calls the registerExternalEvent method
   RMBulkOperationResults loResults = 
      new RMBulkOperationsUtil().registerExternalEvent (aoRMOS, lsArrEventIds, 
      new Date()); 
} 


Feedback

Last updated: November 2013
ierdg019.htm

© Copyright IBM Corporation 2013