ALBPM Process API

fuego.papi
Interface Filter

All Superinterfaces:
Cloneable, Serializable

public interface Filter
extends Serializable, Cloneable

This interface is used to define a sub set of instances into a process.

The filter have two parts, the first part defines the scope of the filter, this scope will define witch instancies will be processed by the second part of the filter. The second part defines the conditions of the filter.

Ex.

     Filter filter = ProcessService.createFilter();
     filter.setSearchScope(ParticipantScope.ALL, StatusScope.ALL, null);
     filter.addAttribute(VarDefinition.getDefaultVarDefinition(VarDefinition.PRIORITY_ID),
                         Condition.IS, new Integer(Priority.HIGHEST));

     InstanceInfo[] instances = new InstanceInfo[0];
     try {
         instances = session.getInstancesByFilter(new String[] { "/MyProcess1", "/MyProcess2" }, filter);
     } catch (BatchOperationException batchException) {
         batchException.printStackTrace();
     }
     

If more than a condition for the same attribute (for example, Severity) is defined within a Filter, they will be connected to resolve the complete condition. This is accomplished using the logical operators OR and AND. Each connector is classified into a type and based on the combination of the same or different type, the OR or AND applies.

Classification I

DescriptionConnector
Is+
Is not-
Contains+
Not contains-
Using the above connectors, the following rules apply:
ConnectorConnectorOperatorDescription
++ORThe combination of two types of + will be connected by an OR
+-ANDThe combination of one type + and another type - will be connected by an AND
-+ANDThe combination of one type "-" and another type + will be connected by an AND
--ANDThe combination of two types of "-" will be connected by an AND

Ex.

ConditionsExplanation
Severity is Debug / Severity is Info Both conditions use the "is" connector, therefore results displayed in the Log Viewer will contain a severity of DebugORInfo
Severity is not Debug/ Severity is not Info Both conditions use the "is not" connector, therefore results displayed in the Log Viewer will contain a severity of DebugANDInfo

Classification II

Begin with:B
End with:E
Before:lower than sign.
After:greater than sign.
Lower than:lower than sign.
Higher than:greater than sign.
Using the above connectors, the following rules apply:
B, B: ORThe combination of two types of B will be connected by an OR
B, E: ANDThe combination of one type B and another type E will be connected by an AND
E, B: ANDThe combination of one type E and another type B will be connected by an AND
E, E: ORThe combination of two types of E will be connected by an OR
lower than, lower than: AND The combination of two types of lower than will be connected by an AND
lower than, greater than: OR (OI) The combination of one type lower than and another type greater than will be connected by an OR
greater than, lower than: AND (CI) The combination of one type greater than and another type lower than will be connected by an AND
greater than, greater than: AND The combination of two types of greater than will be connected by an AND

Ex.

ConditionsExplanation
Message Begins with "The server" / Message Ends with "successfully" The conditions will be combined using AND.
Level Higher than 2 / Level Lower than 5 The conditions will be combined using AND (CI).


Field Summary
static long serialCheck
           
static long serialVersionUID
           
 
Method Summary
 void addAttribute(FilterAttribute attribute)
          Add new FilterAttribute to the filter.
 FilterAttribute addAttribute(String variableId, int kind, Comparison operator, Object value, boolean parametric)
          Add new FilterAttribute to the filter.
 FilterAttribute addAttribute(VarDefinition variable, Comparison operator, boolean parametric)
          Add new FilterAttribute to the filter.
 FilterAttribute addAttribute(VarDefinition variable, Comparison operator, Object value)
          Add new FilterAttribute to the filter.
 FilterAttribute addAttribute(VarDefinition variable, Comparison operator, Object value, boolean parametric)
          Add new FilterAttribute to the filter.
 void addFilter(Filter subFilter)
          Add new Filter to the Filter.
 List<FilterAttribute> getAttributes()
          Returns all attributes added to the filter
 Map<String,List<FilterAttribute>> getAttributesByVariable()
          Returns a map with all attributes added to the filter.
 List<FilterAttribute> getAttributesByVariable(String variable)
          Return all attributes added to the filter for a specific variable.
 Comparator getComparator()
          Returns the java.util.Comparator generated for this filter.
 Comparator getComparator(Locale locale)
          Returns the java.util.Comparator generated for this filter and the specified locale.
 String getDescription()
          Returns all information about the filter.
 List<Filter> getFilters()
          Returns all Filters added to this filter.
 String getName()
          Return the name of this filter.
 Ordering getOrdering()
          Return the order of the instances that match with this filter.
 List<FilterAttribute> getParametricAttributes()
          Return all parametric attributes.
 SearchScope getSearchScope()
          Return the scope of the filter.
 boolean isCaseSensitive()
          Return if this filter is case sensitive or not.
 boolean isMatchAll()
          Returns if this filter has match all or not.
 boolean isParametric()
          Return if any attribute is parametric or not.
 boolean match(InstanceInfo instance, Participant participant)
          Check if this filter match with the instance or not.
 void removeAttribute(FilterAttribute attribute)
          Remove an attribute fron the filter.
 List<FilterAttribute> removeAttributes(String variable)
          Remove all attribute for an specific variable id.
 boolean removeFilter(Filter subfilter)
          Removes a filter addet to this filter.
 void setCaseSensitive(boolean caseSensitive)
          Define if this filter is case sensitive or not.
 void setMatchAll(boolean matchAll)
          Set if the instances must match with all attributes of the filter or not.
 void setName(String name)
          Define a name for this filter.
 void setOrdering(Ordering ordering)
          Set the order of the instances that match with this filter.
 void setSearchScope(SearchScope searchScope)
          Set the scope of the filter.
 

Field Detail

serialCheck

static final long serialCheck
See Also:
Constant Field Values

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values
Method Detail

addFilter

void addFilter(Filter subFilter)
Add new Filter to the Filter. This filter added will define a new condition for the filter.

Parameters:
subFilter - The Filter to add.

removeFilter

boolean removeFilter(Filter subfilter)
Removes a filter addet to this filter.

Parameters:
subfilter - Subfilter to remove.
Returns:
true if the filter contained the specified subfilter.

getFilters

List<Filter> getFilters()
Returns all Filters added to this filter.

Returns:
A List of Filter.

getAttributes

List<FilterAttribute> getAttributes()
Returns all attributes added to the filter

Returns:
A java.util.List with all FilterAttribute
See Also:
FilterAttribute, List

getAttributesByVariable

Map<String,List<FilterAttribute>> getAttributesByVariable()
Returns a map with all attributes added to the filter. The map contains a List with the attributes for the same VarDefinition.

Returns:
A Map where the key is the VarDefinition ID and the value is a List with all FilterAttributes for this VarDefinition.
See Also:
FilterAttribute, Map, List

getAttributesByVariable

List<FilterAttribute> getAttributesByVariable(String variable)
Return all attributes added to the filter for a specific variable.

Parameters:
variable - The VarDefinition ID to obtain the FilterAttributes added.
Returns:
A java.util.List with all FilterAttribute
See Also:
FilterAttribute, List

setCaseSensitive

void setCaseSensitive(boolean caseSensitive)
Define if this filter is case sensitive or not. If is case sensitive al comparations with characters will be case sensitive.

Parameters:
caseSensitive - True if is case sensitive and False if not.

isCaseSensitive

boolean isCaseSensitive()
Return if this filter is case sensitive or not.

Returns:
True if is case sensitive and False if not.

getComparator

Comparator getComparator()
Returns the java.util.Comparator generated for this filter.

Returns:
A Comparator for instances.
See Also:
Comparator

getComparator

Comparator getComparator(Locale locale)
Returns the java.util.Comparator generated for this filter and the specified locale.

Parameters:
locale - Locale to generate the Comparator
Returns:
A Comparator for instances.

getDescription

String getDescription()
Returns all information about the filter.

Returns:
A String with the description.

setMatchAll

void setMatchAll(boolean matchAll)
Set if the instances must match with all attributes of the filter or not. If you set True the connector between attributes will be AND, if you set False the connector will be OR

Parameters:
matchAll - True for AND connector between attributes and False for OR

isMatchAll

boolean isMatchAll()
Returns if this filter has match all or not. The match all attribute define if the connector between attributes is AND or OR.

Returns:
True if is match all and the connector is AND, False if not and the connector is OR.

setName

void setName(String name)
Define a name for this filter.

Parameters:
name - A String with the name of the filter.

getName

String getName()
Return the name of this filter.

Returns:
A String with the name of the filter.

setOrdering

void setOrdering(Ordering ordering)
Set the order of the instances that match with this filter.

Parameters:
ordering - The attributes to order
See Also:
Ordering

getOrdering

Ordering getOrdering()
Return the order of the instances that match with this filter.

Returns:
An Ordering with the attributes that used to order.
See Also:
Ordering

isParametric

boolean isParametric()
Return if any attribute is parametric or not.

Returns:
True if any attribute of the filter is parametric, False if not.

getParametricAttributes

List<FilterAttribute> getParametricAttributes()
Return all parametric attributes.

Returns:
A list with all FilterAttribute witch have the FilterAttribute.isParametric() in true.
See Also:
List

setSearchScope

void setSearchScope(SearchScope searchScope)
Set the scope of the filter. The scope define the environment of the instances that could be process by the filter.

Parameters:
searchScope - The SearchScope to define the environment.
See Also:
SearchScope

getSearchScope

SearchScope getSearchScope()
Return the scope of the filter. The scope define the environment of the instances that could be process by the filter.

Returns:
The SearchScope of the filter.
See Also:
SearchScope

addAttribute

FilterAttribute addAttribute(VarDefinition variable,
                             Comparison operator,
                             Object value)
Add new FilterAttribute to the filter. This FilterAttribute will define a new condition for the filter.

Parameters:
variable - VarDefinition to check.
operator - Comparison to use.
value - The value to compare with the instance value.
Returns:
The FilterAttribute generated.
See Also:
FilterAttribute

addAttribute

FilterAttribute addAttribute(VarDefinition variable,
                             Comparison operator,
                             boolean parametric)
Add new FilterAttribute to the filter. This FilterAttribute will define a new condition for the filter.

Parameters:
variable - VarDefinition to check.
operator - Comparison to use.
parametric - True if the filter attribute is parametric and False if not.
Returns:
The FilterAttribute generated.
See Also:
FilterAttribute

addAttribute

FilterAttribute addAttribute(VarDefinition variable,
                             Comparison operator,
                             Object value,
                             boolean parametric)
Add new FilterAttribute to the filter. This FilterAttribute will define a new condition for the filter.

Parameters:
variable - VarDefinition to check.
operator - Comparison to use.
value - The default value to compare with the instance value.
parametric - True if the filter attribute is parametric and False if not.
Returns:
The FilterAttribute generated.
See Also:
FilterAttribute

addAttribute

FilterAttribute addAttribute(String variableId,
                             int kind,
                             Comparison operator,
                             Object value,
                             boolean parametric)
Add new FilterAttribute to the filter. This FilterAttribute will define a new condition for the filter.

Parameters:
variableId - VariableId of the variable to use.
kind - Variable type of the variable to use.
operator - Comparison to use.
value - The default value to compare with the instance value.
parametric - True if the filter attribute is parametric and False if not.
Returns:
The FilterAttribute generated.
See Also:
FilterAttribute

addAttribute

void addAttribute(FilterAttribute attribute)
Add new FilterAttribute to the filter. This FilterAttribute will define a new condition for the filter.

Parameters:
attribute - The FilterAttribute to add
See Also:
FilterAttribute

match

boolean match(InstanceInfo instance,
              Participant participant)
Check if this filter match with the instance or not.

Parameters:
instance - The instance to check
participant - The participant witch execute the match
Returns:
True if the instance match with the filter or False if not.

removeAttribute

void removeAttribute(FilterAttribute attribute)
Remove an attribute fron the filter.

Parameters:
attribute - Attribute to remove.

removeAttributes

List<FilterAttribute> removeAttributes(String variable)
Remove all attribute for an specific variable id.

Parameters:
variable - The variable id of the attribute to remove
Returns:
A List with all attributes removed.
See Also:
List

ALBPM Process API

© Copyright 1996/2005 Fuego Inc. All Rights Reserved