def execute(self, parameters, messages):
        AddMessage('{}; {}; {};'.format(
            parameters[reproject_from_db].valueAsText,
            parameters[reproject_to_db].valueAsText,
            parameters[reproject_projection].valueAsText))
        from_db = parameters[reproject_from_db].valueAsText
        to_db = parameters[reproject_to_db].valueAsText
        projection = parameters[reproject_projection].valueAsText

        #run the functions
        Geodatabase.clean(to_db)
        if not Exists(projection):
            AddMessage('Projection file {} does not exist'.format(projection))
            return

        def foreach_layer(from_dataset_path, to_dataset_path, feature_class):
            from_feature_path = '{}/{}'.format(from_dataset_path, feature_class)
            to_feature_path = '{}/{}'.format(to_dataset_path, feature_class)
            AddMessage('Reprojecting Featureclass: {}'.format(from_feature_path))

            if Exists(to_feature_path):
                AddMessage('Skipping feature class {} because it already exists'.format(to_feature_path))
                return
            FeatureClassToFeatureClass_conversion(from_feature_path, to_dataset_path, feature_class)

        #call the create datasets function passing the foreach layer function to it
        Geodatabase.process_datasets(from_db,
            to_db,
            projection,
            foreach_layer = foreach_layer)
    def execute(self, parameters, messages):
        AddMessage('{}; {}; {};'.format(
            parameters[clip_from_db].valueAsText,
            parameters[clip_to_db].valueAsText,
            parameters[clip_projection].valueAsText))
        from_db = parameters[clip_from_db].valueAsText
        to_db = parameters[clip_to_db].valueAsText
        projection = parameters[clip_projection].valueAsText
        clip_layer = parameters[clip_clip_layer].valueAsText

        #run the functions
        Geodatabase.clean(to_db)

        if not Exists(projection):
            AddMessage('Projection file {} does not exist'.format(projection))
            return
        def foreach_layer(from_dataset_path, to_dataset_path, feature_class):
            from_feature_path = '{}/{}'.format(from_dataset_path, feature_class)
            to_feature_path = '{}/{}'.format(to_dataset_path, feature_class)
            AddMessage('Copying Featureclass: {}'.format(from_feature_path))

            if Exists(to_feature_path):
                AddMessage('Skipping feature class {} because it already exists'.format(to_feature_path))
                return

            AddMessage('Clipping Featureclass: {}'.format(from_feature_path))
            Clip_analysis('{}/{}'.format(from_dataset_path, feature_class),
                clip_layer, 'in_memory/{}'.format(feature_class))
            FeatureClassToFeatureClass_conversion(
                'in_memory/{}'.format(feature_class), to_dataset_path, feature_class)
            Delete_management('in_memory/{}'.format(feature_class))

        Geodatabase.process_datasets(from_db,
            to_db,
            projection,
            foreach_layer=foreach_layer)