Once the dynamic routing is created, you can modify the associated decision

19-46 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Parallel Default Routing Rule You can have the following possible scenarios with a parallel default routing rule: ■ All the other routing rules of the Oracle Mediator are parallel: This is a straightforward case. The default routing rule is not executed if any of the filter conditions specified in the other routing rules are matched. If none of the filter conditions are matched, then the default routing rule is executed asynchronously. ■ Other Routing Rules of the Oracle Mediator are sequential or parallel: This is a complex but common use case in which there are other sequential or parallel routing rules available, and the default routing rule is parallel. The default routing rule is not executed if any of the other sequential or parallel routing rule criteria is matched. If none of the conditions are matched, then the default routing rule is executed asynchronously.

19.2.5.2 Default Rule Target

The target of the default routing rule is the same as the supported targets of any other existing routing rule. This indicates that the target can be a service, an event, or an echo. Similarly, the response from the default routing rule target service can be forwarded or returned to the original caller. If the target service returns a fault, then the fault is handled in the same way as it is handled in any other routing rule.

19.2.5.3 Default Rule: Validation, Transformation, and Assign Functionality

Schematron validation, transformation, and assign functionality for the default routing rule works in the same way as other routing rules.

19.2.5.4 Default Rule: Java Callouts

The current behavior of a pre-Java callout or post-Java callout works in the same way as for other routing rules. For the purpose of Java callouts, the default routing rule is considered another routing rule. Therefore, for the scenarios in which the default routing rule is executed, the postRouting callback method occurs only after the default routing rule is executed. Note: The fact that the default routing rule is executed automatically implies that the default routing rule is the only case that was executed for the given Oracle Mediator service component. Similarly, if an Oracle Mediator service component has one routing rule without any filter condition and also has a default routing rule, then the default routing rule is never executed. Note: If exceptions occur while evaluating or executing other routing rules, then the default routing rule is not executed. Note: The post-Java callouts occur after the execution of sequential rules and do not wait for the parallel rules to complete execution. Therefore, if the default routing rule is sequential, then the postRouting callback method occurs after executing the default routing rule. If the default routing rule is parallel, then the postRouting callback occurs after all sequential rules are executed and does not wait for the execution of the parallel default routing rule. Creating Oracle Mediator Routing Rules 19-47

19.2.5.5 Default Rule: Oracle Mediator .mplan File

To set a routing rule as the default one, click the Set as Default Routing Rule icon shown on Figure 19–2 . The .mplan file changes, as shown in Figure 19–36 . Figure 19–36 .mplan File of an Oracle Mediator with a Default Routing Rule

19.3 Creating an Oracle Mediator for Routing Messages

The CustomerRouter use case provides an overview of how to use an Oracle Mediator in a SOA composite sample application to route messages. For downloading the sample files mentioned in this section, visit the following URL: https:soasamples.samplecode.oracle.com The files are provided in the Basic Routing Sample for Oracle Mediator. The CustomerRouter use case consists of the following steps:

1. Legacy customer files are retrieved from a directory by an adapter service named

ReadCust.

2. The ReadCust adapter service sends the file data to the CustomerRouter Oracle

Mediator.

3. The CustomerRouter Oracle Mediator applies a filter to the XML message payload

to determine whether the message should be routed to the USCustomer reference or CanadaCustomer reference.

4. The CustomerRouter Oracle Mediator then transforms the message to the

structure required by the adapter reference.