SMILA/Project Concepts/Record Filter Concept
< SMILA | Project Concepts
Record Filter Specification
Record filtering can be useful in different parts of the system
- the Queue Router needs it to create minimzed objects to put in queue message - see SMILA/Project Concepts/Router & Listener Queue Specification
- the BPEL integration needs it to create workflow objects - see SMILA/Project Concepts/Blackboard Service Concept for details)
Therefore it should be provided as a generic functionality of the data model. Then we can
- provide a set of named record filter definition in a central place.
- refer to the names of record filters to be used in router and workflow engine configurations.
- both use the common code to actually do the filtering
An initial record filter definition could consist of the following parts:
- Name: Unique name of the filter for reference in using components (Router or workflow engine configuration)
- List of attribute names: attributes to be kept in the filtered object. Additionaly a flag could determine if annotations are to be copied, too. In an initial implementtation it would be sufficient to have only top-level attributes here which means that the whole attribute tree with this name would be copied to the filtered object. It could be extended later to support attribute paths to specify filtering of sub-objects only.
- List of annotation names: names of top level annotations of the record to be kept in filtered objects.
<RecordFilters> <Filter name="example"> <Attribute name="Mimetype"/> <Attribute name="Filesize"/> <Attribute name="Keywords" keepAnnotations="true"/> <!-- default is false --> <Annotation name="action"/> </Filter> <!-- more filters --> </RecordFilters>
Using "*" as a wildcard for "all names" could ease definition of a filter that copies all attributes or annotations:
<RecordFilters> <Filter name="all-attributes-no-anntations"> <Attribute name="*"/> </Filter> <Filter name="top-level-annotations-only"> <Annotation name="*"/> </Filter> </RecordFilters>
The Record Filter function is
Record filter(Record completeRecord)
We could also provide the RecordFilter as a service (to discuss).
Record filter(String filterName, Record completeRecord)
In each case the function would create a copy of the record containing only those attributes and annotations described by the filter definition.