|
ALBPM Process API (PAPI) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Filter is used to define a subset of instances returned from a View or set of Processes.
SearchScope and FilterAttribute. SearchScope defines which
instances will be processed by the set of FilterAttributes. FilterAttributes define
the filter conditions.
e.g. using the severity attribute.
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 |
| 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 |
| 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 | The combination of one type lower than and another type greater than will be connected by an OR |
| greater than, lower than: AND | 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 |
| 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. |
| Method Summary | |
void |
addAttribute(FilterAttribute attribute)
Adds a new FilterAttribute to the filter. This FilterAttribute will define a new condition for the filter. |
FilterAttribute |
addAttribute(VarDefinition variable,
Comparison operator,
boolean parametric)
Adds a new parametric FilterAttribute to the filter. In this case you define the variable, the comparison and if the filter attribute is parametric or not. |
FilterAttribute |
addAttribute(VarDefinition variable,
Comparison operator,
Object value)
Adds a new FilterAttribute to the filter. In this case you define the variable, the comparison and the value to compare. |
FilterAttribute |
addAttribute(VarDefinition variable,
Comparison operator,
Object value,
boolean parametric)
Adds a new parametric FilterAttribute to the filter. In this case you define the variable, the comparison, the value to compare and if the filter attribute is parametric or not. |
void |
addFilter(Filter subFilter)
Adds a new Filter to the Filter. This filter added will define a new condition for the filter. |
void |
addRefineInstance(InstanceId instanceId)
Deprecated. Adds a new filter into this filter with the instance to refine ( addFilter(Filter)). |
List |
getAttributes()
Gets all attributes added to the filter |
Map |
getAttributesByVariable()
Gets all attributes added to the filter, grouped by VarDefinition Id. |
List |
getAttributesByVariable(String variable)
Gets all attributes added to the filter for the specified variable. |
Comparator |
getComparator(Locale locale)
Gets the java.util.Comparator generated by this filter. |
String |
getDescription()
Gets the description of this filter. |
List |
getFilters()
Returns all Filters added to this filter. |
String |
getGrabActivityName()
Deprecated. |
String |
getName()
Gets the name of this filter. |
Ordering |
getOrdering()
Gets the order of the instances that match with this filter. |
List |
getParametricAttributes()
Gets all parametric attributes. |
List |
getRefineInstances()
Deprecated. Use a filter into this filter to refine instances. |
SearchScope |
getSearchScope()
Gets the scope of the filter. The scope define the environment of the instances that could be process by the filter. |
boolean |
isCaseSensitive()
Returns if this filter is case sensitive or not. |
boolean |
isMatchAll()
Returns if this filter has match all or not. |
boolean |
isParametric()
Returns if any attribute is parametric or not. |
boolean |
match(InstanceInfo instance,
Participant participant)
Checks if the specified instance match with this filter. |
void |
removeAttribute(FilterAttribute attribute)
Removes an attribute from the filter. |
List |
removeAttributes(String variable)
Removes all attribute for the specified variable id. |
boolean |
removeFilter(Filter subfilter)
Removes a filter added to this filter. |
void |
setCaseSensitive(boolean caseSensitive)
Sets if this filter is case sensitive or not. If is case sensitive al comparations with characters will be case sensitive. |
void |
setGrabActivity(Activity activity)
Deprecated. Find the instance that would you grab, and then execute the method ProcessServiceNESession.getGrabActivitiesForInstance(InstanceInfo),
with that instance as argument, to obtain the activities which can grab it. |
void |
setGrabActivityName(String activity)
Deprecated. Find the instance that would you grab, and then execute the method ProcessServiceNESession.getGrabActivitiesForInstance(InstanceInfo),
with that instance as argument, to obtain the activities which can grab it. |
void |
setMatchAll(boolean matchAll)
Sets if the instances must match with all attributes of the filter or not. |
void |
setName(String name)
Sets the name of this filter. |
void |
setOrdering(Ordering ordering)
Sets the order of the instances that match with this filter. |
void |
setSearchScope(SearchScope searchScope)
Sets the scope of the filter. The scope define the environment of the instances that could be process by the filter. |
| Method Detail |
public List getAttributes()
FilterAttribute with all attributes added to the filter.FilterAttribute,
Listpublic Map getAttributesByVariable()
FilterAttribute with all attributes for this VarDefinition.FilterAttribute,
Map,
Listpublic List getAttributesByVariable(String variable)
variable - VarDefinition Id to obtain the FilterAttributes added.
FilterAttribute,
Listpublic void setCaseSensitive(boolean caseSensitive)
caseSensitive - true if is case sensitive.public boolean isCaseSensitive()
true if is case sensitive.public Comparator getComparator(Locale locale)
Comparatorpublic String getDescription()
public void setGrabActivity(Activity activity)
ProcessServiceNESession.getGrabActivitiesForInstance(InstanceInfo),
with that instance as argument, to obtain the activities which can grab it.
activity - grab Activity where you want to grab.Activitypublic void setGrabActivityName(String activity)
ProcessServiceNESession.getGrabActivitiesForInstance(InstanceInfo),
with that instance as argument, to obtain the activities which can grab it.
activity - name of the Grab activity where you want to grab.Activitypublic String getGrabActivityName()
null if the activity was not set.public void setMatchAll(boolean matchAll)
matchAll - true for AND connector between attributes and false for ORpublic boolean isMatchAll()
true if is match all and the connector is AND, false if not and
the connector is OR.public void setName(String name)
name - the new name of the filter.public String getName()
public void setOrdering(Ordering ordering)
ordering - Ordering with the attributes to orderOrderingpublic Ordering getOrdering()
Orderingpublic boolean isParametric()
true if any attribute of the filter is parametric.public List getParametricAttributes()
Listpublic List getRefineInstances()
Listpublic void setSearchScope(SearchScope searchScope)
searchScope - SearchScope to define the environment of the filter.SearchScopepublic SearchScope getSearchScope()
SearchScope
public FilterAttribute addAttribute(VarDefinition variable,
Comparison operator,
Object value)
variable - VarDefinition to check. Cannot be null.operator - Comparison to use. Cannot be null.value - The value to compare with the instance value.
public FilterAttribute addAttribute(VarDefinition variable,
Comparison operator,
boolean parametric)
variable - VarDefinition to check. Cannot be null.operator - Comparison to use. Cannot be null.parametric - true if the filter attribute is parametric.
public FilterAttribute addAttribute(VarDefinition variable,
Comparison operator,
Object value,
boolean parametric)
variable - VarDefinition to check. Cannot be null.operator - Comparison to use. Cannot be null.value - The value to compare with the instance value.parametric - true if the filter attribute is parametric.
public void addFilter(Filter subFilter)
subFilter - Filter to add.public boolean removeFilter(Filter subfilter)
subfilter - subfilter to remove.
true if the filter contained the specified subfilter.public List getFilters()
public void addAttribute(FilterAttribute attribute)
attribute - FilterAttribute to addFilterAttributepublic void addRefineInstance(InstanceId instanceId)
addFilter(Filter)).
instanceId - The instance id where the filter will be executed.
public boolean match(InstanceInfo instance,
Participant participant)
instance - instance to checkparticipant - Participant which execute the match
true if the instance match with the filter.public void removeAttribute(FilterAttribute attribute)
attribute - FilterAttribute to remove.public List removeAttributes(String variable)
variable - variable Id of the attribute to remove.
|
ALBPM Process API (PAPI) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||