Show Table of Contents
17.6. Determine Location for Audit Assignment
In SwitchYard, you may choose to provide an argument to the @Audit annotation. The accepted values for this comes from org.switchyard.bus.camel.processors.Processors enumeration. For example, the following combination can handle only validation occurrences:
@Audit(Processors.VALIDATION)
Note the following important facts about validation, transformation, and transaction in SwitchYard:
- The validation is executed twice for in-only exchanges and four times for in-out exchanges.
- The validation occurs before and after transformation of inbound messages.
- When SwitchYard sends outgoing messages, the validation occurs before and after transformation of outbound messages.
- Transformation is executed once for in-only exchanges and twice for in-out exchanges.
- Transaction phase is always executed twice.
If you want to implement only one execution of your auditor, use the following combination:
@Audit(Processors.PROVIDER_CALLBACK).Here, the auditor is executed just before sending exchange to service implementation. You can also implement one auditor instance with few mediation steps. For example, a bean with annotation following:
@Audit({Processors.PROVIDER_CALLBACK, Processors.CONSUMER_CALLBACK})
This bean is executed twice. One pair of before or after call for provider service and second pair for outgoing response.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.