You can use the SystemCaller transformer to execute the DOS Delete statement for removing the file.
My first choice would be to use a FeatureWriter (rather than a regular writer) to publish to ArcGIS Portal. Then connect a SystemCaller (as suggested by @erik_jan) to the Summary port to delete the shape file.
My second choice, if you prefer keeping the regular writer, would be to delete the file in the Python shutdown script.
You can use the SystemCaller transformer to execute the DOS Delete statement for removing the file.
Hi @erik_jan thanks for your answer - do i need to create a new reader for the shape file i want to delete then connect the system caller? Also should the delete command in the system caller be something like this:
DELETE D:]\\GIS\\common\\Test\\Test\\Test.gdb]DataTest_data
Sorry for all the questions I am new to fme so any help would be really appreciated.
You can use the SystemCaller transformer to execute the DOS Delete statement for removing the file.
I would use a FeatureWriter transformer to write the Shape file instead of an actual writer. That transformer has an output port (Summary) that contains an attribute with the Shape file name. (Also mentioned by @david_r)
Another way is, create a temporary directory with the TempPathnameCreator and write the Shapefile files there. The temporary directory created by the TempPathnameCreator and every file within it will be removed automatically by FME when the translation has completed.