What You May Need to Know About Duplicate Composite Sensor Names
Note the following details when using duplicate names for composite sensors.
-
If you create composite sensors with duplicate names, the entire contents of their definitions are compared. Duplicate names are permitted where one or more additional parameters are different (for example, either different configuration types or different expressions, filters, operation names, and so on). Something must be different in the definitions for duplicate names to be permitted.
-
If you have duplicate sensor definitions, only the last executed sensor value is persisted. Therefore, you can use this type of configuration for mutually exclusive paths (for example, a composite can be invoked through service 1 or service 2). Therefore, you can define the same sensor name on both the services. However, if you define the same names for service 1 and reference 1, only the sensor value from reference 1 (the last executed sensor) is stored.
-
You typically use multiple sensors with the same name to point to the same logical entity extracted from different sources (for example, Oracle Enterprise Manager Fusion Middleware Control displays the final sensor value). Therefore, it can be confusing if the same sensor name is used to extract an email value and a social security value from different sources.
-
Sensor actions apply to all occurrences of the same sensor name. This situation means the sensor actions on the most recently defined sensor with the same name take precedence.
For the scenario shown in sensor.xml
in the following example:
-
The first two sensors named
Service1
are identical. In addition, the configuration type for both isserviceConfig
(composite sensors defined on a service binding component). Therefore, the sensors become one entry (the second one is ignored). -
The third sensor named
Service1
has a different configuration type ofeventConfig
(a composite sensor defined on a business event). Therefore, this sensor is represented with a separate entry. -
The two sensors named
PurchaseOrder
Id
have different configuration types (eventConfig
andserviceConfig
). Therefore, they are represented with separate entries. -
The two sensors named
PurchaseOrder
have the same configuration type (eventConfig
), but different expressions. Therefore, they are represented with separate entries.
<sensors xmlns="http://xmlns.oracle.com/bpel/sensor"> <sensor sensorName="Service1" kind="service" target="undefined" filter=""> <serviceConfig service="OrderPublisher_ep" expression="$in.property.tracking.ecid" operation="execute" outputDataType="string" outputNamespace="http://www.w3.org/2001/XMLSchema"/> </sensor> <sensor sensorName="Service1" kind="service" target="undefined" filter=""> <serviceConfig service="OrderPublisher_ep" expression="$in.property.tracking.ecid" operation="execute" outputDataType="string" outputNamespace="http://www.w3.org/2001/XMLSchema"/> </sensor> <sensor sensorName="Service1" kind="event" target="undefined" filter="" xmlns:po="http://www.mycompany.com/ns/order"> <eventConfig component="EventMediator" expression="$in/po:PurchaseOrder/po:OrderID" event="{http://mycompany.com/events/orders}OrderReceivedEvent" outputDataType="string" outputNamespace="http://www.w3.org/2001/XMLSchema"/> <sensor sensorName="Event1" kind="event" target="undefined" filter=""> <eventConfig component="EventMediator" actionType="Subscribe" expression="$in.property.tracking.ecid" event="{http://mycompany.com/events/orders}OrderReceivedEvent" outputDataType="string" outputNamespace="http://www.w3.org/2001/XMLSchema"/> </sensor> <sensor sensorName="PurchaseOrder Id" kind="event" target="undefined" filter="" xmlns:po="http://www.mycompany.com/ns/order"> <eventConfig component="EventMediator" expression="$in/po:PurchaseOrder/po:OrderID" event="{http://mycompany.com/events/orders}OrderReceivedEvent" outputDataType="string" outputNamespace="http://www.w3.org/2001/XMLSchema"/> </sensor> <sensor sensorName="PurchaseOrder Id" kind="service" target="undefined" filter=""> <serviceConfig service="OrderPublisher_ep" expression="$in.property.tracking.ecid" operation="execute" outputDataType="string" outputNamespace="http://www.w3.org/2001/XMLSchema"/> </sensor> <sensor sensorName="PurchaseOrder" kind="event" target="undefined" filter="" xmlns:po="http://www.mycompany.com/ns/order"> <eventConfig component="EventMediator" expression="$in/po:PurchaseOrder" event="{http://mycompany.com/events/orders}OrderReceivedEvent" outputDataType="PurchaseOrder" outputNamespace="http://mycompany.com/events/orders"/> </sensor> <sensor sensorName="PurchaseOrder" kind="event" target="undefined" filter="" xmlns:po="http://www.mycompany.com/ns/order"> <eventConfig component="EventMediator" expression="$in/po:PurchaseOrder/po:OrderID" event="{http://mycompany.com/events/orders}OrderReceivedEvent" outputDataType="string" outputNamespace="http://www.w3.org/2001/XMLSchema"/> </sensor> </sensor> </sensors>