Skip to main content

I've created different user parameters for my workspace. Some specific combinations will lead to an error. The user has to choose the output format (Geotiff, JPEG or JPEG2000) and the color depth (Gray8, RGB24 or palette). JPEG and JPEG2000 don't support palettes, so those combinations will lead to an error. How can I configure the workspace to respond to invalid combinations of output format and color depth with a costum error message in the log file?

 

Thanks in advance!

You can use a TestFilter to check the parameters and a Logger to write something to the log file.

 

If you set up your workspace with FeatureReader(s) instead of regular readers you can do that testing/logging beforehand and only trigger the FeatureReader(s) if the parameter settings are ok (trigger that TestFilter with a Creator)


PythonCreator can be used also using the following code template. Workspace is attached for your reference.

        error = fmeobjects.FMELogFile().logMessageString("Invalid parameter combination")
 
        if FME_MacroValues/'PARAMETER'] == "Geotiff":
            if FME_MacroValuesf'PARAMETER_2'] == "Gray8":
                return error
        elif FME_MacroValuesÂ'PARAMETER'] == "JPEG2000":
            if FME_MacroValues 'PARAMETER_2'] == "RGB24":
                return error
        else:
            pass

 


Reply