TIBCO ActiveMatrix mediation flow does not support control tasks, such as Route task or XPathRoute task in the output path. The following are some suggestions for sending a declared fault to the consumer based on a transformation/validation error in the output path:
1). Place a Transform or Validate XML task in the output path.
2). If an error occurs in the Transform or Validate XML task, the execution control is transferred to the Mediation fault path.
3). In the mediation fault path, catch the “Mediation Fault” and use a transform task to convert to a mediation operation declared fault.
You can define a schema with expected values. If they are not received as expected, a fault will be generated. In the Fault path you can massage the output and send it back to the client.