Create an import strategy for each new data column resolver

About this task

The import strategy defines how (and whether) to create and delete entities during an import operation. To create an import strategy:

Procedure

  1. In Studio, navigate to configuration > gsrc and define a new class in gw.exportimport.entityimport. Name the class to reflect the entity you are configuring. For example, if you are configuring the PersonalVehicle entity for import and export, name the new class PersonalVehicleImportStrategy.
  2. Implement the deleteEntity and createEntity methods as needed, using return values that are appropriate to the entity.
  3. Specify a true or false return value for the AllowCreate and AllowDelete properties. If the entity you are configuring has complex deletion requirements, consider prohibiting delete during import.

    Examine the CPLocationImportStrategy.gs and CPBuildingImportStrategy.gs as models for creating new import strategies.

    • CPLocationImportStrategy illustrates how to allow creation of new entities and prevent deletion. Deleting locations is prohibited. PolicyCenter does not allow deleting a location that is in use, and there is no easy way to determine if a location is in use during an import operation.
    • CPBuildingImportStrategy.gs illustrates a somewhat more complex scenario of creating buildings within a location as well as the scenario of deleting a building.