Process Aspect is a new concept in TIBCO ActiveMatrix BusinessWorks that provides a way to alter the execution of a process by injecting user defined code in specific points of a process. In general, Aspects are defined, packaged and deployed completely independent of TIBCO ActiveMatrix BusinessWorks applications (like EAR files).
•
•
In TIBCO ActiveMatrix BusinessWorks, an Aspect is implemented with an XML file that has a "bwaspect" extension.The following snippet shows the pseudo-schema of the TIBCO ActiveMatrix BusinessWorks aspect:xmlns:xsi="xsd:anyURI" xsi:schemaLocation="xsd:anyURI"
An aspect has a required @targetNamespace attribute, whose value must be unique in the context of a BW engine. At the BW engine initialization time, if two or more aspects are found with the same targetNamespace, it throws a BWAspectConfigurationException and exits. An aspect also has an optional @order attribute, which is used to establish an execution order for advices that are inserted in the same join point.A point cut is used to select all the join points where advices are injected. The selection is implemented by performing a query on the BW Project infoset. For details refer to Chapter 2, Point Cut Query Language.
A point cut has a required @name attribute, whose value must be unique in the context of an aspect. At the BW engine initialization time, if more than one point cuts are found with the same name, the BW Engine throws a BWAspectConfigurationException.A common usage of an aspect is to contain more than one point cut. This is useful especially when the aspect contains multiple advice definitions. At run-time, when advices are injected in the business processes, only the point cuts that are actually referenced by advices are used. Hence, all the point cuts not referenced by advices are discarded by the engine at run-time.An advice is a configured user defined code that gets injected in a process at run-time, thereby changing its behavior. The location of where the advice gets injected is specified by referencing a point cut, via the required @pointcut attribute.
Currently supported join points can only alter the activity behaviors. There are four flavors of join points. They are,
•
• An AfterThrowing advice can also specify an exception type QName via the @exceptionType attribute. Use this attribute to select a particular type of exception. If this attribute is not set, then any exception thrown by the activity will trigger the execution of the advice.An advice has a required @name attribute, whose value must be unique in the context of an aspect. At run-time, the BW engine throws a BWAspectConfigurationException if it finds two or more advices with the same name. An advice also has an implementation, which is the actual code that gets executed at run-time.
Currently TIBCO ActiveMatrix BusinessWorks supports only JAVA for defining advice implementations.An advice implementation Java class, which is specified in the @className attribute of the implementation element, must implement a specific contract. For more information about this contract and the API that is available to advice implementations, refer Advice Implementations.
The BW engine does not halt its execution if an exception such as a BWAspectConfigurationException, is thrown during its initialization process.Aspects, point cuts, and advices can have an optional documentation element that can be used to store comments associated with these entities.
Copyright © TIBCO Software Inc. All Rights Reserved.