IBM FileNet P8, Version 5.2.1            

Starting a Background Search

The following Java™ and C# code examples demonstrate how to start a background search by instantiating a subclass of the CmBackgroundSearch class and setting its property values.
Each code example performs the following steps:
  1. Create an instance of the CmBackgroundSearch subclass that represents the search.
  2. Supply a value to the parameter-defining custom property of the CmBackgroundSearch object that you created.
  3. Save the CmBackgroundSearch object. The server then starts the background search automatically.

Java Example

// Instantiate CmBackgroundSearch subclass that was previously defined.
CmBackgroundSearch objBkSearch = Factory.CmBackgroundSearch.createInstance(objObjectStore, "objClassDefBkSearchSub");

// Set value of the custom property for the StartDate parameter.
objBkSearch.set_StartDate("2014-01-01T00:00:00Z");

// Save background search object to start the search.
objBkSearch.save(RefreshMode.REFRESH);

C# Example

// Instantiate CmBackgroundSearch subclass that was previously defined.
ICmBackgroundSearch objBkSearch = Factory.CmBackgroundSearch.CreateInstance(objObjectStore, "objClassDefBkSearchSub");

// Set value of the custom property for the StartDate parameter.
objBkSearch.StartDate = "2014-01-01T00:00:00Z";

// Save background search object to start the search.
objBkSearch.Save(RefreshMode.REFRESH);


Last updated: October 2015
backgroundsearch_snip3.htm

© Copyright IBM Corporation 2015.