|
ALBPM Process API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Filter
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
Description | Connector |
Is | + |
Is not | - |
Contains | + |
Not contains | - |
Connector | Connector | Operator | Description |
+ | + | OR | The combination of two types of + will be connected by an OR |
+ | - | AND | The combination of one type + and another type - will be connected by an AND |
- | + | AND | The combination of one type "-" and another type + will be connected by an AND |
- | - | AND | The combination of two types of "-" will be connected by an AND |
Ex.
Conditions | Explanation |
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. |
B, B: OR | The combination of two types of B will be connected by an OR |
B, E: AND | The combination of one type B and another type E will be connected by an AND |
E, B: AND | The combination of one type E and another type B will be connected by an AND |
E, E: OR | The 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.
Conditions | Explanation |
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 |
---|
static final long serialCheck
static final long serialVersionUID
Method Detail |
---|
void addFilter(Filter subFilter)
subFilter
- The Filter to add.boolean removeFilter(Filter subfilter)
subfilter
- Subfilter to remove.
List<Filter> getFilters()
List<FilterAttribute> getAttributes()
FilterAttribute
,
List
Map<String,List<FilterAttribute>> getAttributesByVariable()
FilterAttribute
,
Map
,
List
List<FilterAttribute> getAttributesByVariable(String variable)
variable
- The VarDefinition ID to obtain the FilterAttributes added.
FilterAttribute
,
List
void setCaseSensitive(boolean caseSensitive)
caseSensitive
- True if is case sensitive and False if not.boolean isCaseSensitive()
Comparator getComparator()
Comparator
Comparator getComparator(Locale locale)
locale
- Locale
to generate the Comparator
String getDescription()
void setMatchAll(boolean matchAll)
matchAll
- True for AND connector between attributes and False for ORboolean isMatchAll()
void setName(String name)
name
- A String with the name of the filter.String getName()
void setOrdering(Ordering ordering)
ordering
- The attributes to orderOrdering
Ordering getOrdering()
Ordering
boolean isParametric()
List<FilterAttribute> getParametricAttributes()
List
void setSearchScope(SearchScope searchScope)
searchScope
- The SearchScope to define the environment.SearchScope
SearchScope getSearchScope()
SearchScope
FilterAttribute addAttribute(VarDefinition variable, Comparison operator, Object value)
variable
- VarDefinition to check.operator
- Comparison to use.value
- The value to compare with the instance value.
FilterAttribute
FilterAttribute addAttribute(VarDefinition variable, Comparison operator, boolean parametric)
variable
- VarDefinition to check.operator
- Comparison to use.parametric
- True if the filter attribute is parametric and False if not.
FilterAttribute
FilterAttribute addAttribute(VarDefinition variable, Comparison operator, Object value, boolean parametric)
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.
FilterAttribute
FilterAttribute addAttribute(String variableId, int kind, Comparison operator, Object value, boolean parametric)
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.
FilterAttribute
void addAttribute(FilterAttribute attribute)
attribute
- The FilterAttribute to addFilterAttribute
boolean match(InstanceInfo instance, Participant participant)
instance
- The instance to checkparticipant
- The participant witch execute the match
void removeAttribute(FilterAttribute attribute)
attribute
- Attribute to remove.List<FilterAttribute> removeAttributes(String variable)
variable
- The variable id of the attribute to remove
List
|
ALBPM Process API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |