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
-
In Studio, navigate to 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. -
Implement the
deleteEntityand createEntity methods as needed, using return values that are appropriate to the entity. -
Specify a true or false return value for the
AllowCreateandAllowDeleteproperties. 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.
CPLocationImportStrategyillustrates 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.
