Point Cut Query Language : Query Language Primitives

Query Language Primitives
The query language defines the following four primitives:
activity ( selection-expression ) - Selects all activities that match a specific expression.
process ( selection-expression ) - Selects all processes that match a specific expression.
project ( selection-expression ) - Narrows down the scope of the search to projects that match a specific expression.
engine ( selection-expression ) - Narrows down the scope of the search to engines that match a specific expression.
These primitives can be combined to form complex expressions. The selection-expression, which is specified as part of these primitives, has a generic syntax that is not dependent on the actual primitive. Each primitive defines a set of properties that can be used in the expression. For example, the activity() primitive defines a type property that can be used to filer out activities based on their type. The evaluation of the expression results in the selection of a set of join points.
Following is the Backus-Naur Form (BNF) definition of the point cut expression.
<point-cut-expression> :: = <primitive> ( "&amp;&amp;" <primitive> )*
<primitive> ::= "activity(" <selection-expression> ")" | "process(" <selection-expression> ")" |
"project(" <selection-expression> ")" | "engine(" <selection-expression> ")"
<selection-expression> ::= <selection-expression-part> ( <and-or> <selection-expression-part> )*
<selection-expression-part> ::= <selection-expression-part-simple> | <selection-expression-part-wrapped>
<selection-expression-part-simple> ::= ( <propertyName> "=" <propertyValue> ) |
( "!(" <property-name> "=" <property-value> ")" )
<selection-expression-part-wrapped> ::= "(" <selection-expression-part-simple> ")"
<and-or> ::= "&amp;&amp;" | "||"
<propertyName> - see the tables
<propertyValue> - see the table
If the activity() primitive does not appear in the expression then, the BW engine selects all activities that are defined as part of the project. In this case the BW Engine treats this as having activity (name="*") in the expression.
If the process() primitive does not appear then, the BW Engine treats this as having process (name="*") in the expression.
If the project() primitive does not appear then, the BW Engine treats this as having project (name="*") in the expression.
If the engine() primitive does not appear then, the BW Engine treats this as having engine (name="*") in the expression.
Properties Defined for activity() primitive
"event-source" | "signal-in" | "activity"
The flavor of the activity (for example, event-source, signal-in or regular activity).
type
"type" is an ID that uniquely identifies a particular type of activity. To get the ID of a particular activity, refer to the table available in Appendix A, ActivityTypes. The rest of this section describes the algorithm for building these IDs. This is useful to know since there are activities that do not get shipped out of the box with TIBCO ActiveMatrix BusinessWorks and therefore they are not mentioned in Appendix A, ActivityTypes.
This ID is computed in the following way:
<type> ::= "bw.<resource-type-suffix>"
where
the resource-type-suffix is given by the sequence of the characters that appear after the last "." character in the <pd:resourceType> element, which is serialized as part of every activity's configuration. To find the resource-type-suffix for a specific activity, the user has to open a process definition that contains that activity and check the <pd:resourceType> element that is serialized as part of its configuration.
For example, here is the configuration XML of a File Read Activity that appears in a process definition:
<pd:activity name="Read File">
<pd:type>com.tibco.plugin.file.FileReadActivity</pd:type>
<pd:resourceType>ae.activities.FileReadActivity</pd:resourceType>
<pd:x>224</pd:x>
<pd:y>173</pd:y>
<config>
<encoding>binary</encoding>
</config>
<pd:inputBindings>
<ns1:ReadActivityInputClass>
<fileName>
<xsl:value-of select="&quot;C:\test\foo.xml&quot;"/>
</fileName>
</ns1:ReadActivityInputClass>
</pd:inputBindings>
</pd:activity>
This example shows that the resource-type-suffix of the File Read Activity is "FileReadActivity". This means that this activity's type is "bw.FileReadActivity" in Point cut query language.
kind
"kind" is used to filter out activities based on their flavors. There are three flavors of activities, each one identified with a specific ID:
event-source - An activity that is an event source or process starter (for example, File Event Source, JMS Queue Receiver, and so on).
signal-In - An activity that is a signal-in (for example, File Signal-In, and so on).
activity - An activity that is neither an event-source nor a signal-in (for example, File Read Activity, HTTP Send Receive Activity, and so on).
Since these properties are defined for the activity() primitive, they can only be used in the context of this primitive.
Properties Defined for process() primitive
"sub-process" | "regular" |
kind
"kind" is used to filter out processes based on their flavors. There are two flavors of processes, each one identified with a specific ID:
sub-process - A process that doesn't have an event source or process starter.
regular - A process that has an event source or process starter.
Like the properties defined for the activity() primitive, the properties defined for the process() primitive can only be used in the context of this primitive.
Properties Defined for project() primitive
This primitive is used for filtering out projects based on their name. This can be useful in organizations where all aspects are developed, packaged, and deployed together.
Properties Defined for engine() primitive
This primitive is used for filtering out engines based on their names. Similar to project() primitive, this primitive can be useful in organizations where all aspects are developed, packaged, and deployed together.
Use of Escape Character
While using double quote as part of the property value in a pointcut query, use backward slash ('\') as an escape character.
For example, activity (description= "this is how \" is used as part of property value").
Escape characters should be used for all the xml predefined entities (<, >, &, ' and ") in the aspect file.
Wildcard Support
In order to provide more flexibility and to simplify the writing of point cut expressions, the query language supports wildcards ("*") in property values. These can be used either to specify the entire property value (e.g. name="*" ) or to specify a part of it (for example, name = "JMS*").
This means that activity (Name = "foo") evaluates the same as activity (name = "foo"). However, activity (name = "foo") does not evaluate the same as activity ( name = "Foo").
Parentheses Support
Parentheses up to level two are supported in selection-expression of this query language.
Correct Expression (level one):
activity ( (name="JMSReceiver" || name= "HTTPReceiver" ) &amp;&amp; (type="bw.JMSQueueEventSource" || type = "bw.httpEventSource" ) )
Invalid Expression (level three):
process (name = "Test*" || (name = "notify" || (name = "waitnotifyprocess*" &amp;&amp; tns = "http://waitnotifytns/*")))
Supported Operators
The following operators are supported.
EQUAL Comparison operator “=” (EQUAL) can be used while comparing property values. For details, refer to Examples of Point Cuts Defined Using Query Language.
NOT EQUAL Comparison operator “!=” (NOT EQUAL) can now be used while comparing property values. For details, refer to 8.