14 Working with Pipeline Actions in Oracle Service Bus Console

This chapter describes how to add different types of actions to pipelines, using the Oracle Service Bus Console, such as route, publish, service callout, transport headers, conditional actions, error actions, and message transformation actions.

Actions are the elements of pipeline stages, error handler stages, route nodes, and branch nodes that determine how messages are to be defined as they flow through a pipeline.

This chapter includes the following sections:

14.1 Adding and Editing Pipeline Actions in the Console

Actions are the elements of pipeline stages, error handler stages, route nodes, and branch nodes that determine how messages are to be defined as they flow through a proxy service.

These instructions assume that you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

They also assume that you have already added a pipeline stage, a route node, and/or an error handler stage. See:

To add an action to a pipeline:

  1. Select the component to which you want to add an action. For example, click the Stage icon, then click Edit Stage, or click the Route Node icon, then click Edit Route.
  2. Depending on whether actions have already been added to the stage or to the route node, do one of the following:
    • If no actions have yet been added, the Edit Stage Configuration page displays only the Add an Action icon. Click that icon, then select an action type.

    • If one or more actions have already been added, the Edit Stage Configuration page displays one or more icons representing those actions, for example, a Publish icon or a Routing icon. Click the appropriate icon, click Add an Action, then select an action type.

    • Some actions, such as request and response actions in publish actions, include an Add an Action link where an action is appropriate. Click that icon, then select an action type.

    There are no restrictions on what actions can be chained together in a pipeline.

    Table 14-1 through Table 14-4 list the actions you can configure for pipelines.

    Table 14-1 Pipeline - Communication Actions

    Action Description More Information
    Dynamic Publish icon

    Dynamic Publish

    Publish a message to a service identified by an XQuery expression

    Adding Dynamic Publish Actions in the Console

    Publish icon

    Publish

    Publish a message to a statically specified service.

    Adding Publish Actions in the Console

    Publish Table icon

    Publish Table

    Publish a message to zero or more statically specified services. Switch-style condition logic is used to determine at runtime which services will be used for the publish.

    Adding Publish Table Actions in the Console

    Routing Options icon

    Routing Options

    Modify any or all of the following properties in the outbound request: URI, Quality of Service, Mode, Retry parameters, Message Priority.

    Adding Routing Options Actions in the Console

    Service Callout icon

    Service Callout

    Configure a synchronous (blocking) callout to a Service Bus-registered proxy or business service.

    Adding Service Callout Actions in the Console

    Transport Headers icon

    Transport Headers

    Set the transport header values in messages

    Adding Transport Header Actions in the Console

    Dynamic Routingn icon

    Dynamic Routing

    Assign a route for a message based on routing information available in an XQuery resource.

    Adding Dynamic Routing to Route Nodes in the Console

    Routing icon

    Routing

    Identify a target service for the message and configure how the message is routed to that service:

    Adding Routing Actions to Route Nodes in the Console

    Routing Table icon

    Routing Table

    Assign a set of routes wrapped in a switch-style condition table.Different routes are selected based on the results of a single XQuery expression.

    Adding Routing Tables to Route Nodes in the Console

    Table 14-2 Pipeline - Flow Control Actions

    Action Description More Information
    For Each icon

    For each

    Iterate over a sequence of values and execute a block of actions

    Adding For-Each Actions in the Console

    If Then icon

    If...then...

    Perform an action or set of actions conditionally, based on the Boolean result of an XQuery expression.

    Adding If-Then Actions in the Console

    Raise Error icon

    Raise error

    Raise an exception with a specified error code (a string) and description.

    Adding Raise Error Actions in the Console

    Reply icon

    Reply

    Specify that an immediate reply is sent to the invoker.

    Adding Reply Actions in the Console

    Resume icon

    Resume

    Resume pipeline after an error handler has handled an error.

    Adding Resume Actions in the Console

    Skip icon

    Skip

    Specify that at runtime, the execution of the current stage is skipped and the processing proceeds to the next stage in the pipeline.

    Adding Skip Actions in the Console

    Table 14-3 Pipeline - Message Processing Actions

    Action Description More Information
    Assign icon

    Assign

    Assign the result of an XQuery expression to a context variable.

    Adding Assign Actions in the Console

    Delete icon

    Delete

    Delete a context variable or a set of nodes specified by an XPath expression.

    Adding Delete Actions in the Console

    Insert icon

    Insert

    Insert the result of an XQuery expression at an identified place relative to nodes selected by an XPath expression.

    Adding Insert Actions

    Java Callout icon

    Java callout

    Invoke a Java method from the pipeline.

    Adding Java Callout Actions in the Console

    JavaScript icon

    JavaScript

    Manipulate an XML or JSON payload using a JavaScript expression.

    Adding JavaScript Actions in the Console

    MFL Transform icon

    MFL transform

    Convert non-XML to XML or XML to non-XML in the pipeline.

    Adding MFL Translate Actions in the Console

    nXSD Translate Icon

    nXSD translate

    Convert native data format (nXSD) to XML or XML to native data format (nXSD) in the pipeline.

    Adding nXSD Translate Actions

    Rename icon

    Rename

    Rename elements selected by an XPath expression without modifying the contents of the element.

    Adding Rename Actions in the Console

    Replace icon

    Replace

    Replace a node or the contents of a node specified by an XPath expression.

    Adding Replace Actions in the Console

    Validate icon

    Validate

    Validate elements selected by an XPath expression against an XML schema element or a WSDL resource.

    Adding Validate Actions in the Console

    Table 14-4 Pipeline - Reporting Actions

    Action Description More Information
    Alert icon

    Alert

    Send an alert notification based on pipeline message context.

    Adding Alert Actions in the Console

    Log icon

    Log

    Construct a message to be logged.

    Adding Log Actions in the Console

    Report icon

    Report

    Enable message reporting for a proxy service.

    Adding Report Actions in the Console

  3. When you have finished adding actions, you can further configure the actions in stage or route node, as described in Table 14-5.

    Table 14-5 Edit Stage Configuration Tasks

    To... Complete This Step...

    Delete an action

    Click the appropriate icon, then click Delete this Action.

    Move an action down (demote)

    Click the appropriate icon, then click Move Action Down. The action is moved below the next action contained in this stage.

    This option is displayed only when a stage contains two or more actions.

    Move an action up (promote)

    Click the appropriate icon, then click Move Action Up. The action is moved above the previous action contained in this stage.

    This option is displayed only when the stage contains two or more actions.

    Cut an action

    Click the appropriate icon, then click Cut.

    Copy an action

    Click the appropriate icon, then click Copy.

    Paste an action that you have cut or copied

    Click the appropriate icon, then click Paste Action.

    You can copy and paste actions across stages. However, if the action isAssign, Replace or Insert, note the following:

    • All variable-related and user-defined namespaces from the source (copied) stage are added as user-defined namespaces in the target (pasted) stage.

    • Duplicate namespaces (identical namespaces in both source and target stage) are not copied.

    • Conflicting namespaces (namespace declarations that use the same prefix but different URIs) are copied. You can save the configuration, but you cannot activate it until the conflicting namespace declarations in stage B are removed.

    Validate a stage

    In the Edit Stage Configuration page, click Validate to validate all the actions configured in that stage. Only actions that are enabled are validated.

    The Validate button is not available if the stage is disabled.

  4. Click Save to commit the updates in the current session.
  5. On the Edit Message Flow page, continue to construct the pipeline, as described in Viewing and Editing Pipelines in the Console.
  6. Click Save to commit the updates in the current session.
  7. To end the session and deploy the configuration to the runtime, click Activate in the top right corner of the Oracle Service Bus Console.

14.2 Adding Publish Actions in the Console

Use a publish action to identify a statically specified target service for a message and to configure how the message is packaged and sent to that service.

For more information on publish behavior, see Performing Transformations in Pipelines.

To add a publish action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Select Add an Action > Communication > Publish.
  3. Click Service. The Select Service page is displayed.
  4. Select a service from the list, then click Submit. This service is the target service for the message.
  5. If the service has operations defined, you can specify an operation to be invoked by selecting it from the Operation list.
  6. To make the outbound operation the same as the inbound operation, select the Use inbound operation for outbound check box.
  7. To configure how the message is packaged and sent to the service, in the Request Actions field, click Add an Action. Select an action to associate with the service. You can add more than one action. See Adding and Editing Pipeline Actions in the Console.
  8. Click Save to commit the updates in the current session.

14.3 Adding Publish Table Actions in the Console

Use a publish table action to publish a message to zero or more statically specified services.

Switch-style condition logic is used to determine at runtime which services are used for the publish.

For more information on publish behavior, see Performing Transformations in Pipelines.

To add a publish table action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Select Add an Action > Communication > Publish Table.
  3. Click Expression. The XQuery Expression Editor page is displayed. Create an XQuery expression, which at runtime returns the value upon which the routing decision is made. See Creating and Editing Inline XQuery and XPath Expressions.
  4. From the Operator list, select a comparison operator. Then, in the adjacent field, enter a value against which the value returned from the XQuery expression is evaluated.
  5. Click Service to select a service to which messages are to be published if the expression evaluates true for the value you specified. The Select Service page appears.
  6. Select a service from the list, then click Submit. This service is the target service for the message.
  7. If the service has operations defined, you can specify the operation to be invoked by selecting it from the invoking list.
  8. If you want the outbound operation to be the same as the inbound operation, select the Use inbound operation for outbound check box.
  9. In the Request Actions field, to configure how the message is packaged and sent to the service, click Add an Action. Then select one or more actions that you want to associate with the service. To learn more about the type of action you want to add, see Adding and Editing Pipeline Actions in the Console.
  10. To insert a new case, click the Case icon, then select Insert New Case.
  11. Repeat steps 4–8 for the new case.
  12. Add more cases as dictated by your business logic.
  13. Click the Case icon of the last case you define in the sequence, then select Insert Default Case to add a default case at the end.
  14. Configure the default case—the configuration of this case specifies the routing behavior when none of the preceding cases are satisfied.
  15. Click Save to commit the updates in the current session.

14.4 Adding Dynamic Publish Actions in the Console

Use a dynamic publish action to publish a message to a service specified by an XQuery expression.

For more information on publish behavior, see Performing Transformations in Pipelines.

To add a dynamic publish action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Communication > Dynamic Publish.
  3. Click Expression.
  4. In the XQuery Expression Editor, enter an XQuery expression or select an XQuery resource that provides a result similar to:
    <ctx:route>
     <ctx:service isProxy="false">project/folder/businessservicename</ctx:service>
     <ctx:operation>foo</ctx:operation>
    </ctx:route>

    Note:

    If a proxy service is being invoked, set isProxy to true. If a business service is being invoked, set isProxy to false.

    The element operation is optional.

    Alternatively, the following code routes to a pipeline:

    <ctx:route>
      <ctx:pipeline>project/folder/pipeline</ctx:pipeline>
    </ctx:route>
    

    Alternatively, the following code routes to a split join:

    <ctx:route>
      <ctx:splitjoin>project/folder/splitjoin</ctx:splitjoin>
    </ctx:route>
  5. Click Save.
  6. In the Request Actions field, click Add an Action to add an action, then select an action that you want to associate with the service. You can add more than one action. To learn more about the type of actions you can add, see the table of actions in Adding and Editing Pipeline Actions in the Console.
  7. Click Save to commit the updates in the current session.

14.5 Adding Routing Options Actions in the Console

Use the routing options action to modify any or all of the following properties for the outbound request in $outbound: URI, Quality of Service, Mode, Retry parameters.

Although these properties can be modified using assign, insert, replace, or delete actions on $outbound, using routing options provides a simpler way to perform this task, without requiring knowledge of XPath, XQuery, or the structure of the $outbound context variable.

The routing options action can only be used where the context variable $outbound is valid. It can be added to the following actions:

  • Publish

  • Dynamic Publish

  • Publish Table

  • Service Callout

  • Routing

  • Dynamic Routing

  • Routing Table

For more information on routing, see Modeling Message Flow in Oracle Service Bus.

To configure a routing options action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Communication > Routing Options.
  3. Complete any or all of the following steps:
    • To set the URI for the outbound message: Select URI, and click the XQuery Expression Editor. Enter an expression that returns a URI. This overrides the URI for the invoked service.

      Note:

      When routing to another proxy service, the URI override has no effect.

    • To set the Quality of Service element: Select Quality of Service, and select the Quality of Service option from the list. This overrides the default that is auto computed.

    • To set the Mode: Select Mode, and select either request, or request-response from the list.

      Note:

      This is normally already automatically set, based on the interface of the service invoked. However, in some cases like Any Soap or Any XML services, this is not so.

    • To set the Retry Interval: Select Retry Interval, and specify the number of seconds between retries. This overrides the default configured with the invoked service.

    • To set the Retry Count: Select Retry Count, and specify the number of retries the system must attempt before discontinuing the action. This overrides the default configured with the invoked service.

    • To set the Message Priority: Select Priority, and click the XQuery Expression Editor. Enter an expression that returns a positive integer.

  4. Click Save to commit the updates in the current session.

14.6 Adding Service Callout Actions in the Console

Use a service callout action to configure a synchronous (blocking) callout to a Service Bus-registered proxy or business service.

For more information on service callout actions, see Constructing Service Callout Messages.

To add a service callout action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Communication > Service Callout.
  3. Click Service. The Service Browser is displayed.
  4. Select a service from the list of registered proxy or business services, then click Submit.
  5. If the service you chose in step 3, above, is WSDL-based and has operations that can be invoked on the service, those operations are listed in the invoking Operation list. Select an operation to be invoked on the service.

    Note:

    Selecting an operation, which Service Bus requires for many reasons, does not guarantee that only the selected operation is invoked. For example, if you select OperationA, but a message also contains an invocation for Operation B, then OperationB will be invoked as well.

  6. Specify how you want to configure the request and response messages by selecting one of the following options:
    • Select Configure SOAP Body to configure the SOAP Body. Selecting this option allows you to use $body directly.

      Note:

      This option supports SOAP-RPC encoded, which is not supported when configuring payload parameters or document.

    • Select Configure Payload Parameters or Configure Payload Document to configure the payload.

  7. Subsequent configuration options depend on the kind of service you selected and on the kind of configuration options you chose for that service.

    Table 14-6 provides instructions for each option.

    Table 14-6 Service Callout Configuration Options

    For These Options... Follow These Steps...

    SOAP Request Body and SOAP Response Body

    To configure these options,

    • In the SOAP Request Body field, enter the name of a variable to hold the XML of the SOAP Body element for the callout request.

    • In the SOAP Response Body field, enter the name of a variable to which the XML of the SOAP Body element on the response will be bound.

    Request Attachments Variable and Response Attachments Variable

    To configure these options (optional),

    • In the Request Attachments Variable field, enter the name of a variable to hold the XML corresponding to the outbound request attachments.

    • In the Response Attachments Variable field, enter the name of a variable to hold the XML corresponding to the outbound response attachments.

    SOAP Request Header and SOAP Response Header

    To configure these options,

    • In the SOAP Request Header field, enter the name of a variable to hold the XML of the SOAP Header element for the callout request

      You must wrap the input document for the SOAP Request Header with <soap-env:Header>...</soap-env:Header>.

    • In the SOAP Response Header field, enter the name of a variable to which the XML of the SOAP Headers on the response, if any, will be bound.

    Request Parameters and Response Parameters

    To configure options,

    • In the Request Parameters fields, enter names for the variables that will be evaluated at runtime to provide values for the request parameters.

      You must provide only the core payload documents in the input variable—the SOAP package is created for you by Service Bus. In other words, do not wrap the input document with <soap-env:Body>...</soap-env:Body>.

      For example, when creating a body input variable that is used for this request parameter, you would define that variable's contents using the XPath statement body/* (to remove the wrapper soap-env:Body), not $body (which results in keeping the soap-env:Body wrapper).

    • In the Response Parameters fields, enter the names of the variables to which the responses will be assigned at runtime.

    Request Document and Response Document

    To configure these options,

    • In the Request Document Variable field, enter the name of a variable to assign a request document to.

      For SOAP Document-type services, the variable is evaluated at runtime to form the body of the SOAP message sent to the service. For Any XML services, the variable is evaluated at runtime to form the body of the XML message sent to the service.

      For SOAP Document-type services and for Any XML services, you provide only the core payload documents in the input variable—the SOAP package is created for you by Service Bus. In other words, do not wrap the input document with <soap-env:Body>...</soap-env:Body>.

      For example, when creating a body input variable that is used for this request parameter, you would define that variable's contents using the XPath statement body/* (to remove the wrapper soap-env:Body), not $body (which results in keeping the soap-env:Body wrapper).

      For Messaging services, the variable is evaluated to form the body of the message, based on the type of data expected by the service. The following restrictions apply to variables used with Messaging services:

      - For services that expect binary data, the variables must have a ctx:binary-content element.

      - For services that expect MFL data, the variable must have the XML equivalent.

      - For services that expect text data, the variable is a string.

    • In the Response Document Variable field, enter the name of the variable to which a response document will be assigned at runtime.

  8. Optionally, add one or more transport headers. For more information, see Adding Transport Header Actions in the Console.

    Note:

    In addition to the transport headers you specify, headers are added by the Service Bus binding layer. For more information, see Configuring Transport Headers in Pipelines.

  9. Click Save to commit the updates in the current session.

14.7 Adding Transport Header Actions in the Console

Use a transport header action to set the header values in messages.

To add a transport header action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.

  2. Click the appropriate icon, then select Add an Action > Communication > Transport Headers.

  3. From the Set Transport Headers for list, select one of the following, to specify to the runtime which of the message context locations are to be modified:

    • Outbound Request - Select this option to set header values for outbound requests (the messages sent out by a proxy service in route, publish, or service callout actions). This header element is located in the message context as follows:

      $outbound/ctx:transport/ctx:request/tp:headers
      
    • Inbound Response - Select this option to set header values for inbound responses (the response messages a proxy service sends back to clients). This header element is located in the message context as follows:

      $inbound/ctx:transport/ctx:response/tp:headers
      
  4. Optionally, select Pass all Headers through Pipeline to pass all headers through from the inbound message to the outbound message or vice versa. Every header in the source set of headers will be copied to the target header set, overwriting any existing values in the target header set.

    For information about using this option in conjunction with the header-specific pass through option, see Configuring Transport Headers in Pipelines.

  5. Complete the following steps for each Header you want to add:

    1. In the Transport Headers table, click Add Header to display fields for configuring the header.

    2. Specify a header by doing either of the following:

      • From the list in the Name column, select a header name. The list contains all of the predefined header names for the target transport (for example, Content-Type for HTTP transports, JMSCorrelationID for JMS transports, and so on).

      • Enter a header name in the Other field. If that header name is not one of the predefined headers for this service's transport, it becomes a user-header, as defined by the transport specification.

    3. Select one of the options in the Action column to specify how to set the headers value:

      Set Header to Expression

      Selecting this option allows you to use an XQuery or XSLT expression to set the value of the header. The expression can be simple (for example, "text/xml") or a complex XQuery or XSLT expression.

      Because the Service Bus transport layer defines the XML representation of all headers as string values, the result of any expression is converted to a string before the header value is set. Expressions that return nothing result in the header value being set to the empty string. You cannot delete a header using an expression.

      Caution:

      Not all of the header settings you can specify in this action are honored at runtime.For information about which of the headers for a given transport you can set and which of those set are honored at runtime, see Configuring Transport Headers in Pipelines.

      Delete Header

      Specifies that the header is removed from the request or response metadata.

      Copy Header from Inbound Request (if you are setting transport headers for the Outbound Request)

      or

      Copy Header from Outbound Response (if you are setting transport headers for the Inbound Response)

      Specifies that this header is copied directly from the corresponding header of the same name from the inbound message to the outbound message and vice versa. For example, if you want to set the SOAPAction header for an outbound request, selecting Copy Header from Inbound Request causes the runtime to copy the value from the SOAPAction request header of $inbound. In the case of inbound response headers, the source of the header to copy is the response headers of $outbound.

      If the Copy Header option is selected for a header that does not exist in the source, this option is ignored and no action is performed on the target for this header.

      For information about using this option in conjunction with the global Pass all Headers through Pipeline option, see Configuring Transport Headers in Pipelines.

  6. To add additional Headers to the table, click the Header icon, then click Add Header.

    The table is expanded to include an additional row, which includes a new set of options that you can use to configure another transport header. You can add as many headers as necessary to this table. You do not have to order the headers in the table, because the runtime declares namespaces and places header elements in their proper order when generating the corresponding XML.

  7. Click Save to commit the updates in the current session.

14.7.1 Setting Cookies in Outbound HTTP Transport Headers

In an HTTP pipeline you can set cookies on the transport header in the following ways:

14.7.1.1 Setting a Cookie as a Complex XML Expression

To set a cookie using a complex XML expression, which is the Service Bus default format, configure the value of the HTTP Cookie header in the outbound request using the following expression syntax:

<cookie-values xmlns="http://www.bea.com/wli/sb/transports/http">
    <value>{fn:concat("cookie_name", "=", "cookie_value")}</value>
</cookie-values>
14.7.1.2 Setting a Cookie with a String Expression

To set the Cookie header with a string in the outbound request, you must add the following option to your domain startWebLogic command:

-Dcom.bea.osb.http.cookieAsNoComplexElement=true

After you restart the server with this option, you can set an HTTP Cookie header with a string expression. For example:

$cookie_name = "cookie_value"

14.8 Adding Dynamic Routing to Route Nodes in the Console

Assign a route for a message based on routing information available in an XQuery resource.

This is a terminal action, which means you cannot add another action after this one. However, this action can contain request and response actions. For more information on dynamic routing, see Using Dynamic Routing.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add dynamic routing to a route node:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the Route Node icon, then click Edit Route. The Edit Stage Configuration page is displayed.
  3. Click the Add an Action icon, then select Communication > Dynamic Routing.
  4. Click Expression. The XQuery Expression Editor is displayed.
  5. In the XQuery Expression Editor, enter an XQuery expression, the result of which is similar to:
    <ctx:route>
        <ctx:service isProxy='true'>{$service}</ctx:service>
        <ctx:operation>{$operation}</ctx:operation>
    </ctx:route>

    Note:

    If a proxy service is being invoked, set isProxy to true. If a business service is being invoked, set isProxy to false.

    • The service name is the fully qualified service name.

    • The operation element is optional.

    Alternatively, the following code routes to a pipeline:

    <ctx:route>
      <ctx:pipeline>project/folder/pipeline</ctx:pipeline>
    </ctx:route>
    

    Alternatively, the following code routes to a split join:

    <ctx:route>
      <ctx:splitjoin>project/folder/splitjoin</ctx:splitjoin>
    </ctx:route>
  6. Click Save.
  7. In the Request Actions field, click Add an Action to add an action, then select an action that you want to associate with the service. You can add more than one action. To learn more about the type of actions you want to add, see the table of actions in Adding and Editing Pipeline Actions in the Console.
  8. In the Response Actions field, click Add an Action to add an action, then select an action that you want to associate with the service. You can add more than one action. To learn more about the type of actions you want to add, see the table of actions in Adding and Editing Pipeline Actions in the Console.
  9. Click Save.
  10. On the Edit Message Flow page, continue to construct the pipeline, as described in Viewing and Editing Pipelines in the Console.
  11. Click Save to commit the updates in the current session.
  12. To end the session and deploy the configuration to the runtime, click Activate in the top right corner of the Oracle Service Bus Console.

14.9 Adding Routing Actions to Route Nodes in the Console

Identify a target service for the message and configure how the message is routed to that service.

This is a terminal action, which means you cannot add another action after this one. However, this action can contain request and response actions. For more information on routing, see Modeling Message Flow in Oracle Service Bus.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add a routing action to a route node:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the Route Node icon, then click Edit Route. The Edit Stage Configuration page is displayed.
  3. Click the Add an Action icon, then select Communication > Routing.
  4. Click Service. The Service Browser is displayed.
  5. Select a service from the list, then click Submit. The service is displayed instead of the default link.
  6. If you want the outbound operation to be the same as the inbound operation, select the Use inbound operation for outbound check box.
  7. In the Request Actions field, click Add an Action to add an action, then select an action that you want to associate with the service. You can add more than one action. To learn more about the type of actions you can add, see the table of actions in Adding and Editing Pipeline Actions in the Console.
  8. In the Response Actions field, click Add an Action to add an action, then select an action that you want to associate with the service. You can add more than one action. To learn more about the type of actions you can add, see the table of actions in Adding and Editing Pipeline Actions in the Console.
  9. Click Save.
  10. On the Edit Message Flow page, continue to construct the pipeline, as described in Viewing and Editing Pipelines in the Console.
  11. Click Save to commit the updates in the current session.
  12. To end the session and deploy the configuration to the runtime, click Activate under Change Center.

14.10 Adding Routing Tables to Route Nodes in the Console

A routing table is a set of routes wrapped in a switch-style condition table. It is a short-hand construct that allows different routes to be selected based upon the results of a single XQuery expression.

You can nest multiple levels in the stage editor. Identify target services for messages and configure how the messages are routed to these services.

This is a terminal action, which means you cannot add another action after this one. However, this action can contain request and response actions. For more information on routing, see Modeling Message Flow in Oracle Service Bus.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add a routing table to a route node:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the Route Node icon, then click Edit Route. The Edit Stage Configuration page is displayed.
  3. Click the Add an Action icon, then select Communication > Routing Table. The routing table action is displayed.
  4. From the Operator list, select a comparison operator, then enter a value expression in the adjacent field.
  5. Click Service. The Select Service page is displayed.
  6. Select a service from the list, then click Submit.
  7. If you want to invoke an operation on the service, select an operation from the Operation list
  8. If you want the outbound operation to be the same as the inbound operation, select the Use inbound operation for outbound check box.
  9. In the Request Actions field, click Add an Action to add an action, then select an action that you want to associate with the service. You can add more than one action.
  10. In the Response Actions field, click Add an Action to add an action, then select an action that you want to associate with the service. You can add more than one action.

    To learn more about the types of request and response actions you can add, see Adding and Editing Pipeline Actions in the Console.

  11. To insert a new case, click the Case icon, then select Insert New Case.
  12. Repeat steps 2-7 for the new case. You can click the Case icon, then select Insert Default Case to add a default case at the end whose routes are selected if none of the preceding cases is satisfied.
  13. Click Save.
  14. On the Edit Message Flow page, continue to construct the pipeline, as described in Viewing and Editing Pipelines in the Console.
  15. Click Save to commit the updates in the current session.
  16. To end the session and deploy the configuration to the runtime, click Activate under Change Center.

14.11 Adding For-Each Actions in the Console

Use the for-each action to iterate over a sequence of values and execute a block of actions.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add a for-each action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Flow Control > For Each.
  3. Enter variable names in the variable fields, click XPath to open the XPath editor to create an XPath expression, and configure the actions in the Do () loop.
  4. Click Save to commit the updates in the current session.

14.12 Adding If-Then Actions in the Console

Use an if-then action to perform an action or set of actions conditionally, based on the Boolean result of an XQuery expression.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add an if-then action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Flow Control > If...Then...
  3. Click Condition to display the XQuery Condition Editor page.

    The condition you create is used as the test that is executed before the then() clause is entered, per standard if-then logic. See Creating and Editing Inline XQuery and XPath Expressions.

  4. When you finish editing the XQuery condition, click Add an Action, then select an action that you want to associate with the condition. To learn more about the type of action you want to add, see Adding and Editing Pipeline Actions in the Console.

    In the route node, you can select only the routing, dynamic routing, or routing table actions. However, these actions can contain request and response actions inside of them.

  5. As your logic requires, click the If...Then... icon, then click Add else-if Condition or Add else Condition to add else-if conditions or else conditions. Click Add an Action to associate actions with these conditions.

    Condition actions can be nested.

  6. Click Save to commit the updates in the current session.

14.13 Adding Raise Error Actions in the Console

Use the raise error action to raise an exception with a specified error code (a string) and description.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add a raise error action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Flow Control > Raise Error.
  3. In the error code field, enter the error code you want to raise.
  4. In the error message field, enter a description of the error code.
  5. Click Save to commit the updates in the current session.

14.13.1 Transactions

If a service is transactional, a triggered Raise Error action aborts the transaction in the request (asynchronous) or in either the request or response (synchronous). For example, you may introspect messages and determine conditions under which a Raise Error action should occur even if no SOAP fault occurs, and Raise Error causes the transaction to be aborted.

14.14 Adding Reply Actions in the Console

Use the reply action to specify that an immediate reply be sent to the invoker. The reply action can be used in the request, response or error pipeline.

You can configure it to result in a reply with success or failure. In the case of reply with failure where the inbound transport is HTTP, the reply action specifies that an immediate reply is sent to the invoker.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add a reply action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Flow Control > Reply.
  3. Select With Success to reply that the message was successful, or select With Failure to reply that the message has a fault.

    Reply With Failure will cause a transaction, if started by Service Bus, to be aborted.

  4. Click Save to commit the updates in the current session.

14.15 Adding Resume Actions in the Console

Use the resume action to resume message flow after an error is handled by an error handler. This action has no parameters and can only be used in error pipelines.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add a resume action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Flow Control > Resume.

When you complete the configuration of this action, continue by configuring other actions or by saving your configuration, as described in Adding and Editing Pipeline Actions in the Console.

14.16 Adding Skip Actions in the Console

Use the skip action to specify that at runtime, the execution of actions of this stage is skipped and the processing proceeds to the next stage in the pipeline.

Note:

If the action has a service callout or dynamic route in it, any skip action used in the service callout's or dynamic route's respective request or response actions skips only its remaining actions. The skip step does not have any impact on the caller stage's processing.

This action has no parameters and can be used in the request, response, or error pipelines.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add a skip action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Flow Control > Skip.

14.17 Adding Assign Actions in the Console

Use the assign action to assign the result of an XQuery expression to a context variable.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add an assign action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Message Processing > Assign.
  3. Click Expression. The XQuery Expression Editor page is displayed. The XQuery expression is used to create the data that will be assigned to the named variable. See Creating and Editing Inline XQuery and XPath Expressions.
  4. When you finish editing the expression, enter a context variable in the variable field. To learn more about context variables, see Inbound and Outbound Variables and Constructing Messages to Dispatch.
  5. Click Save to commit the updates in the current session.

14.18 Adding Delete Actions in the Console

Use the delete action to delete a context variable or a set of nodes specified by an XPath expression. The delete action is one of a set of update actions.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add a delete action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. To delete a context variable, select the Variable option, then enter the name of a context variable in the Variable field.

    Alternatively, to delete all nodes selected by an XPath expression, select the XPath radio button, then click XPath. The XPath Expression Editor page is displayed. See Creating and Editing Inline XQuery and XPath Expressions. After you save the expression, enter a context variable in the variable field.

14.19 Adding Insert Actions

Use the insert action to insert the result of an XQuery expression at an identified place relative to nodes selected by an XPath expression. The insert action is one of a set of update actions.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add an insert action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Message Processing > Insert.
  3. Click Expression to edit an XQuery expression. The XQuery expression is used to create the data that will be inserted at a specified location in a named variable. The XQuery Expression Editor page is displayed. See Creating and Editing Inline XQuery and XPath Expressions.
  4. When you finish editing the expression, select the relative location from the list. The relative location is used to control where the insert is performed relative to the result of the XPath expression:
    • Before: As sibling before each element or attribute selected by the XPath expression

    • After: As sibling after each element or attribute selected by the XPath expression

    • As first child of: As first child of each element identified by the XPath expression. An error occurs if the result of the XPath returns attributes.

    • As last child of: As last child of each element identified by the XPath expression. An error occurs if the XPath returns attributes.

  5. Click XPath. The XPath Expression Editor page is displayed. See Creating and Editing Inline XQuery and XPath Expressions.

    Valid configurations include those in which:

    • XQuery and XPath expressions both return elements.

    • The XQuery and XPath expressions both return attributes—in which case, the XQuery expression must return attributes.

  6. When you finish editing the XPath expression, enter a context variable in the in variable field. The XPath evaluates the contents of this variable.
  7. Click Save to commit the updates in the current session.

14.20 Adding Java Callout Actions in the Console

Use the Java callout action to invoke a Java method, or EJB business service, from within the pipeline.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add a Java callout action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Message Processing > Java Callout.
  3. Click Method. The Select a JAR page is displayed. Select a JAR resource from the list. The Select a Class and Method page is displayed.
  4. From the list of Java classes listed, click the + beside the appropriate class, to display a list of methods. Select a method and click Submit. The Java callout action is displayed on the Edit Stage page, as follows:
    • Method is replaced by the name of the Java method you selected in steps 2 and 3. This name is a link to the Select a Class and Method page. You can click this link to change your selection of Java method.

      The method must be a static method.

    • Parameters: An Expression link to the XQuery Expression Editor page is provided for each argument the Java method requires. A label for each link indicates the data type for the argument, which will be one of the following:

      • Java.lang.String

      • Primitive types, and their corresponding class types (for example, int versus java.lang.Integer)

      • java.lang.BigDecimal, and java.lang.BigInteger (these types are used in financial calculations where round-off errors or overflows are not tolerable)

      • only org.apache.xbeans.XmlObject and no typed xml beans.

      • byte[]

      • java.lang.String[] (INPUT ONLY)

      • XmlObject[] (INPUT ONLY)

      • javax.activation.DataSource

    • Result: A Result field in which you enter the variable to which the result is to be assigned. The label for the field indicates the data type of the result.

      Note:

      If the result is a byte array (the only possible array returned), the binary-content XML element is returned.

    • Return Parameter as Reference: This option makes the return value of a Java Callout invocation a <java-content ref="jcid"> reference element regardless of its actual type, where jcid is the key to the object in the pipeline object repository. In the Result value field, enter the name of the variable to contain the java-content reference. This option lets you work with a referenced object in the pipeline in addition to the pipeline XML for providing passthrough, performing message enrichment with Java Callout and inline actions, or performing message transformation between Java and non-Java transports. For more information, see Sending and Receiving Java Objects in Messages.

    • Attach a Service Account: A Service Account link allows you to specify an optional Service Account if there is a security context for this Java method. To learn more about security contexts and service accounts, see Working with Service Accounts.

      In the case of fixed and mapped service accounts, the userid/password from the service account is authenticated in the local system and the security context propagated to the Java callout. In the case of passthru, the security context is propagated to the Java callout. This context is the message level context if defined (with WS-Security). Else it is the transport level context.

  5. Under Parameters, click Expression. The XQuery Expression Editor page is displayed. Use the XQuery Expression Editor to provide the arguments required by the Java method. See Creating and Editing Inline XQuery and XPath Expressions.

    If the type of the input value you enter does not match the declared input argument type, Service Bus tries to automatically typecast input values to the declared type of the input argument. For example a string value of "123" will be converted to integer 123 if the declared type of the input argument is java primitive int.

  6. In the Result field, assign a variable for the result returned by the Java method.
  7. If there is a security context for the Java method, select the check box and click Service Account. The Select Service Account page is displayed. Select the required service account from the list, and click Submit.
  8. Click Save to commit the updates in the current session.

14.21 Adding JavaScript Actions in the Console

Use a JavaScript action to manipulate the contents of an XML or JSON payload using JavaScript expressions.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add a JavaScript action:
  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Message Processing > JavaScript.
  3. Provide the JavaScript expression in one of the following ways:
    • To
    • To use a JavaScript expression from a JavaScript resource that has already been uploaded to the Service Bus Console, select the With Resource option, and then click Resource. Use the Select JavaScript dialog to search for and select a JavaScript resource.
  4. Select one of the following Timeout options:
    • System Default: JavaScript processing times out when the system default JavaScript timeout is reached.
    • Seconds field: provide a timeout value (in seconds) at which JavaScript processing times out.
    • None: JavaScript processing does not time out.
  5. Click Validate to validate the JavaScript expression.
  6. Click Save.

14.22 Adding MFL Translate Actions in the Console

Use the MFL (Message Format Language) translate action to convert message content from XML to non-XML, or the reverse, in the message pipeline.

An MFL is a specialized XML document used to describe the layout of binary data. It is an Oracle proprietary language used to define rules to translate formatted binary data into XML data, or the reverse. See Defining Data Structures with Message Format Language.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add an MFL translate action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Message Processing > MFL Translate.
  3. From the Apply MFL Translation list, select XML to Non-XML or Non-XML to XML, according to your requirement.
  4. Click Expression. Using the XQuery Expression Editor, specify the variable on which the MFL translation action is to be performed. This input must be text or binary when translating to XML, and must be XML when translating to non-XML. Binary content in the message context is represented by the binary-content XML element. This XML should be the result of the XQuery expression when the input needs to be binary. See Creating and Editing Inline XQuery and XPath Expressions.
  5. Select one of the following options:
    • MFL Resource: click the resource link. The Select MFL page is displayed. Select the static MFL resource that will perform the MFL translate action.

    • MFL Resource from: click the Expression link. The XQuery Expression Editor page is displayed. Using the XQuery Expression Editor, create or edit an XQuery expression to dynamically specify an MFL resource that will perform the translate action, in the format project/folder/MFLresourcename. See Creating and Editing Inline XQuery and XPath Expressions.

  6. In the Assign to Variable field, enter the name of the variable to which the result of this translate action is to be assigned. The result will be a binary-content XML element.
  7. Click Save to commit the updates in the current session.

14.23 Adding nXSD Translate Actions

Use the nXSD translate action to convert message content from XML to native format data, or the reverse, in the message pipeline.

See "Native Format Builder Wizard" in Understanding Technology Adapters for information on creating native schemas used for translation.

The nXSD Translate Action supports XML to JSON and JSON to XML translations if the associated XSD resource contains the relevant annotations, as shown in the following example:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://example.com/RestService_Operation1_request"
 targetNamespace="http://example.com/RestService_Operation1_request" elementFormDefault="qualified" 
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" nxsd:version="JSON" nxsd:encoding="US-ASCII">
   <xsd:element name="Root-Element">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name="country" type="xsd:string"/>
            <xsd:element name="circuit" type="xsd:string"/>
            <xsd:element name="date" type="xsd:date"/>
…

The nXSD Translate action is enhanced in this version of Service Bus to enforce schema ordering when converting from JSON to XML.

Dynamic nXSD Reference

For dynamic NXSD schema configuration, at design time you specify the Xquery expression for computing the nxsd and scheme element QName details. At runtime, the Xquery expression results in an xml document containing the NXSD schema reference name and the schema element name.

The syntax for identifying the NXSD schema reference and XML element name is as follows:

<xs:schema targetNamespace="http://www.bea.com/wli/sb/context"
           xmlns:tns="http://www.bea.com/wli/sb/context"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           elementFormDefault="qualified"
           attributeFormDefault="unqualified">

    <!-- ============================ -->

  <xs:element name="nxsdTranslation" type="tns:NXSDTranslationType"/>

    <xs:complexType name="TranslationQNameType">
        <xs:sequence>
            <xs:element name="namespaceURI" type="xs:anyURI" minOccurs="0"/>
            <xs:element name="localname" type="xs:NCName"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="NXSDTranslationType">
        <xs:sequence>
            <!-- Name is '/' separated string that starts with project name and ends with resource name -->
            <xs:element name="schema" type="xs:string"/>
            <xs:element name="schemaElement" type="tns:TranslationQNameType"/>
        </xs:sequence>
    </xs:complexType>
</xs:schema>

Below is an example of a full XML snippet:

<nxsdtranslation xmlns="http://www.bea.com/wli/sb/context">
      <schema>default/MySchema</schema>
      <schemaElement>
          <namespaceURI>http://openuri.org</namespaceURI>
         <localname>MyType</localname>
     </ schemaElement>
</nxsdtranslation>

The sample xquery below can generate an XML snippet in that format:

declare variable $children:= ("default/MySchema","http://openuri.org","MyType");

  declare function local:message ($number as xs:integer) as item() {
    $children[$number] 
  };

<nxsdtranslation xlmns="http://www.bea.com/wli/sb/context">
     <schema>{ local:message(1) }</schema>
     <schemaElement>
          <namespaceURI>{ local:message(2) }</namespaceURI>
          <localname>{ local:message(3) }</localname>
     </schemaElement>
</nxsdtranslation>

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add an nXSD translate action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Message Processing > nXSD Translate.
  3. From the Apply nXSD Translation list, select XML to Native or Native to XML, according to your requirement.
  4. Click Expression. Using the XQuery/XSLT Expression Editor, specify the variable on which the nXSD translation action is to be performed. This input would be native format when translating to XML, and XML when translating to native data format. See Creating and Editing Inline XQuery and XPath Expressions.
  5. Select one of the following options:
    • nXSD Resource: click the resource link. The Select a XML Schema page appears. Select the schema (.xsd) file corresponding to the native schema.

    • nXSD Resource from: click the Expression link. The XQuery Expression Editor page is displayed. Using the XQuery Expression Editor, create or edit an XQuery expression to dynamically specify a native schema. See Creating and Editing Inline XQuery and XPath Expressions.

  6. In the Assign output to field, select variable, and enter the name of the variable to which the result of this translate action is to be assigned. You can alternatively assign the output to content of $body.
  7. (Optional) If you are translating from Native format (like JSON) to XML, select the Enforce Schema Order option. When selected, this reorders JSON payloads to match the order of elements in the XML schema.
  8. Click Save to commit the updates in the current session.

14.24 Adding Rename Actions in the Console

Use the rename action to rename elements selected by an XPath expression without modifying the contents of the element. The rename action is one of a set of update actions.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add a rename action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Message Processing > Rename.
  3. Click XPath. The XPath Expression Editor page is displayed. The XPath expression is used to specify the data (in the named variable) that will be renamed. See Creating and Editing Inline XQuery and XPath Expressions.
  4. In variable field, enter the context variable that holds the element you want to rename.
  5. Do one of the following:
    • To rename selected elements using a localname, select the first localname option, then enter a local name in the localname field.

    • To rename selected elements using a namespace, select the first namespace option, then enter a namespace in the namespace field.

    • To rename selected elements using a local name and namespace, select the localname and namespace radio button, then enter a local name and namespace in the localname and namespace fields.

  6. Click Save to commit the updates in the current session.

14.25 Adding Replace Actions in the Console

Use a replace action to replace a node or the contents of a node specified by an XPath expression.

The node or its contents are replaced with the value returned by an XQuery expression. A replace action can be used to replace simple values, elements and even attributes. An XQuery expression that returns nothing is equivalent to deleting the identified nodes or making them empty, depending upon whether the action is replacing entire nodes or just node contents. The replace action is one of a set of update actions.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add a replace action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Message Processing > Replace.
  3. Click XPath. The XPath Expression Editor page is displayed. The XPath expression is used to specify the data (in the named variable) that will be replaced. See Creating and Editing Inline XQuery and XPath Expressions.
  4. When you finish editing the XPath expression, enter a context variable in the in variable field.
  5. Click Expression. The XQuery Expression Editor page is displayed. The XQuery expression is used to create the data that replaces the data specified by the XPath in the named variable.See Creating and Editing Inline XQuery and XPath Expressions.
  6. When you finish editing the XQuery expression, select one of the options:
    • Replace entire node—to specify that the nodes selected by the XPath expression you defined are replaced along with all of its contents

    • Replace node contents—to specify that the node is not replaced; only the contents are replaced.

      Note:

      Selecting the Replace node contents option and leaving the XPath field blank is more efficient than selecting the Replace entire node option and setting the XPath to ./*

  7. Click Save to commit the updates in the current session.

14.26 Adding Validate Actions in the Console

Use a validate action to validate elements selected by an XPath expression against an XML schema element or a WSDL resource.

You can validate global elements only; Service Bus does not support validation against local elements. You can also choose to dynamically select the XML schema element or WSDL resource, at runtime, based on the result of an XQuery expression.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add a validate action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.

  2. Click the appropriate icon, then select Add an Action > Message Processing > Validate.

  3. Click XPath. to construct an XPath expression that specifies the elements to be validated. See Creating and Editing Inline XQuery and XPath Expressions. When you are finished constructing the expression in the XPath Expression Editor, click Save to insert the expression on the Edit Stage Configuration page.

  4. In the in variable field, enter the name of the variable to hold the element to be validated.

  5. Select one of the following options:

    • Against Resource: click the resource link, then select WSDL or Schema. From the WSDL Browser or XML Schema Browser, do the following:

      1. Select the WSDL file or XML schema

      2. Select the WSDL file or XML schema type or element

      3. Click Submit.

    • Against Resource from Expression: click the Expression link. The XQuery Expression Editor page is displayed. Using the XQuery Expression Editor, create or edit an XQuery expression to dynamically specify a WSDL file or schema resource. See Creating and Editing Inline XQuery and XPath Expressions.

      The following is an example of dynamically specifying a WSDL resource:

      <validate xmlns="http://www.bea.com/wli/sb/context">
            <wsdl>default/MyWSDL</wsdl>
            <schemaType>
                <namespaceURI>http://openuri.org</namespaceURI>
               <localname>MyType</localname>
           </schemaType>
      </validate>
      

      The following is an example of dynamically specifying a schema resource:

      <validate xmlns="http://www.bea.com/wli/sb/context">
            <schema>{dvm:lookup('SBProject/dvm/DVM_Validation', 'operation', $operationName, 'validationSchema','default')}</schema>
            <schemaElement>
      .........<namespaceURI>"http://www.example.com/date</namespace>
               <localname>{dvm:lookup('SBProject/dvm/DVM_Validation', 'operation', $operationName, 'validationElement','default')}</localname>
           </schemaElement>
      </validate>
      

      Note that the schema or WSDL selected has to be a resource and so must have been imported into OSB as a Schema/WSDL resource. You cannot point directly to a file or URL. The XML fragment that is required is created via an xquery expression, letting you enter any kind of xquery expression to create that XML. In the examples above, the XML provided is a constant XML, illustrating what kind of XML is expected.

      For example, the name of the WSDL could be coming in a variable and you extract that name to find the resource name. Another example is to have one xquery module resource with a function that can do a lookup of the XML fragment given one or multiple keys. In this case, in the validate expression you can evaluate the keys required and make a call to that xquery module function. This allows you to externalize and manage all those dynamic entries in that one xquery module along with the lookup algorithm.

  6. To save the result of this validation (a boolean result), select Save result of validation in variable and enter the name of the variable in which you want to save the result.

    Alternatively, to raise an error if the element fails validation against the WSDL file or XML schema element, select Raise Error on validation failure.

  7. Click Save to commit the updates in the current session.

14.27 Adding Alert Actions in the Console

Use the alert action to generate alerts based on message context in a pipeline, to send to an alert destination.

Unlike SLA alerts, notifications generated by the alert action are primarily intended for business purposes, or to report errors, and not for monitoring system health. Alert destinations should be configured and chosen with this in mind. To learn more about alert destinations, see Working with Alert Destinations.

If pipeline alerting is not enabled for the service or at the domain level, the configured alert action is bypassed during message processing.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add an alert action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate icon, then select Add an Action > Reporting > Alert.
  3. Click Destination. The Select Alert Destination page is displayed. Select the required alert destination from the list and click Submit.

    By default, the alert will always go to the Administration Console.

  4. Click Expression. The XQuery Expression Editor page is displayed. You specify the message context to be added to the alert message through XQuery expressions on context variables. See Creating and Editing Inline XQuery and XPath Expressions.
  5. In the alert summary field, enter a short description of the alert. This will be the subject line in the case of an Email notification, and can contain no more than 80 characters. If no description is provided, a predefined subject line that reads, "Oracle Service Bus Alert", will be used instead.
  6. In the severity level list, select a severity level for this alert from among: Normal, Warning, Minor, Major, Critical, and Fatal.
  7. Click Save to commit the updates in the current session.

14.28 Adding Log Actions in the Console

Use the log action to construct a message to be logged and to define a set of attributes with which the message is logged.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

Note:

To see log data in the log file or standard out (server console), WebLogic Server logging must be set to the following severity levels:

  • Minimum severity to log: Info

  • Log file: Info

  • Standard out: Info

For information on setting log severity levels, see "Using Log Severity Levels" in Configuring Log Files and Filtering Log Messages for Oracle WebLogic Server.

To add a log action:

  1. Be sure Logging is enabled globally. For more information, see "Configuring Operational Settings at the Global Level" in Administering Oracle Service Bus.
  2. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.
  3. Click the appropriate icon, then select Add an Action > Reporting > Log.
  4. Click Expression. The XQuery Expression Editor page is displayed. You specify the message context to be logged through XQuery expressions on context variables. See Creating and Editing Inline XQuery and XPath Expressions.
  5. In the Annotation field, enter notes for this log action. These notes are logged along with the result of the previously defined expression.
  6. In the severity level list, select one of the options.

    Table 14-7 Log Action Severity Levels

    Severity Level Typical Usage

    Info

    Used for reporting normal operations; a low-level informational message.

    Warning

    A suspicious operation or configuration has occurred but it might not affect normal operation.

    Error

    A user error has occurred. The system or application can handle the error with no interruption and limited degradation of service.

    Debug

    While your application is under development, you might find it useful to create and use messages that provide verbose descriptions of low-level activity within the application.

    Make sure the Log severity level on the proxy service's operational settings is the same as the log action severity level. For information on proxy service operational settings, see "Available Operational Settings" in Administering Oracle Service Bus.

  7. Click Save to commit the updates in the current session.

14.29 Adding Report Actions in the Console

Use the report action to enable message reporting for a proxy service.

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To add a report action:

  1. Navigate to where you want to add the action, as described in Adding and Editing Pipeline Actions in the Console.

  2. Click the appropriate icon, then select Add an Action > Reporting > Report.

  3. Click Expression. The XQuery Expression Editor page is displayed. See Creating and Editing Inline XQuery and XPath Expressions. The XQuery expression is used to create the data that will be reported to the Service Bus dashboard.

  4. When you finish editing the XQuery expression, click Add a Key. Two fields are displayed: a Key Name field and a Key Value field, which includes an XPath link that you can click to edit an XPath expression and an in variable field in which you can enter a context variable.

    You use key value pairs to extract key identifiers from any message context variable or message payload, and ignore the rest of the message. The keys are a convenient way to identify a message. They are displayed as report indexes in the Reporting module. See "Working with Message Reports" in Administering Oracle Service Bus

    1. Enter a key name in the Key Name field.

    2. Click XPath. The Edit an XPath Expression page is displayed. See Creating and Editing Inline XQuery and XPath Expressions.

    3. Enter a context variable in the in variable field.

    4. To add more key values, click the Key icon, then select Add a Key. To delete a key, click the Key icon, then select Delete this Key.

For example, consider a report action configured on an error handler in a stage. The action reports the contents of the fault context variable in the event of an error. The report action is configured as follows:

  • Key name = errorCode

  • Key value = ./ctx:errorCode in variable fault

Each time this action is executed at runtime, a message is reported through the Reporting Data Stream. The following table shows the results after the report action is executed twice.

Report Index DB TimeStamp Inbound Service Error Code

errorCode=OSB-382505

04/26/07 9:45 AM

MortgageBroker/ProxySvcs/loanGateway3

OSB-382505

errorCode=OSB-382505

04/26/07 9:45 AM

OSB-382505

14.30 Adding Error Handlers in the Console

You can configure error handling at the message flow, pipeline, route node, and stage level.

Configure error handlers on the Edit Error Handler page. You must always add at least one stage to the page to specify how the error handler will work.

Note:

You cannot create an error handler within an error handler.

14.30.1 Adding Pipeline Error Handlers in the Console

Before you begin

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

The instructions also assume you have created a pipeline pair node, as explained in How to Add Pipeline Pairs to Pipelines.

To add a pipeline error handler:

  1. Navigate to the pipeline pair node containing the pipeline to which you want to add an error handler. If the pipeline pair is not already expanded, click the plus sign next to the icon to display the pipelines.
  2. Click the Request Pipeline icon or the Response Pipeline icon, then click Add Pipeline Error Handler. The Edit Error Handler page is displayed.
  3. Click the Error Handler icon, then click Add Stage.
  4. Click the Stage icon, click Edit Stage. The Edit Stage Configuration page is displayed.
  5. Click Add an Action, then select the action you want to add.

    An error handler is a pipeline and is therefore configured like any other pipeline. For example, you can use the Publish action to send error notifications to other services, use the Assign action to modify the context variables, and so on. To learn more about the type of action you want to add, see the appropriate procedure in Adding and Editing Pipeline Actions in the Console. There is no restriction on what actions may be chained together.

    Three commonly-used error actions are Raise Error, Reply, and Resume.

    Note:

    You cannot create an error handler within an error handler.

  6. Add other actions and make other edits on the Edit Stage Configuration page, as desired.
  7. On the Edit Stage Configuration page, click Save to commit the updates in the current session.
  8. On the Edit Error Handler page, click Save to commit the updates in the current session.

14.30.2 Adding Stage Error Handlers in the Console

Before you begin

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console. The instructions also assume you have added a stage to a pipeline, as explained in How to Add Stages to Pipelines in the Console.

To add a stage error handler:

  1. Navigate to the stage to which you want to add error handling.
  2. Click the Stage icon, then click Add Stage Error Handler. The Edit Error Handler page is displayed.
  3. Click the Error Handler icon, then click Add Stage.
  4. Click the Stage icon, then click Edit Stage. The Edit Stage Configuration page is displayed.
  5. Click Add an Action, then select the action you want to add.

    An error handler is a pipeline and is therefore configured like any other pipeline. For example, you can use the Publish action to send error notifications to other services, use the Assign action to modify the context variables, and so on. To learn more about the type of action you want to add, see the appropriate procedure in Adding and Editing Pipeline Actions in the Console. There is no restriction on what actions may be chained together.

    Three commonly-used error actions are Raise Error, Reply, and Resume.

    Note:

    You cannot create an error handler within an error handler.

  6. Add other actions and make other edits on the Edit Stage Configuration page, as desired.
  7. Click Save to commit the updates in the current session.

14.30.3 Adding Route Node Error Handlers in the Console

Before you begin

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

The instructions also assume you have created a route node, as explained in How to Add Route Nodes to Pipelines in the Console.

To add a route note error handler:

  1. Click the Route Node icon, then click Add Error Handler. The Edit Error Handler page is displayed.
  2. Click the Error Handler icon, then click Add Stage.
  3. Click the Stage icon, then click Edit Stage. The Edit Stage Configuration page is displayed.
  4. Click Add an Action, then select the action you want to add.

    Since an error handler is another pipeline, it is configured like any other pipeline. For example, the Publish action may be used to send error notifications to other services, the Assign action may be used to modify the context variables, and so on. To learn more about the type of action you want to add, see the appropriate procedure in Adding and Editing Pipeline Actions in the Console. There is no restriction on what actions may be chained together.

    Three commonly-used error actions are Raise Error, Reply, and Resume.

    Note:

    You cannot create an error handler within an error handler.

  5. Add other actions and make other edits on the Edit Stage Configuration page, as desired.
  6. On the Edit Stage Configuration page, click Save to commit the updates in the current session.
  7. On the Edit Error Handler page, click Save to commit the updates in the current session.

14.30.4 Editing Error Handlers in the Console

Before you begin

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To view and change an error handler:

Do one of the following:

Table 14-8 Viewing and Changing the Error Handler

To... Complete This Step...

View and change the pipeline error handler

Click the appropriate Request Pipeline icon or the Response Pipeline icon, then click Edit Pipeline Error Handler. The Edit Error Handler page is displayed. See Adding Pipeline Error Handlers in the Console.

View and change the route node error handler

Click the appropriate Route Node icon, then click Edit Route Error Handler. The Edit Error Handler page is displayed. See Adding Route Node Error Handlers in the Console.

View and change the stage error handler

Click the appropriate Stage icon, then click Edit Stage Error Handler. The Edit Error Handler page is displayed. See Adding Stage Error Handlers in the Console.

14.31 Disabling an Action or a Stage in the Console

You can choose to disable an action or a stage in a pipeline. A disabled action or stage is skipped from the pipeline execution.

When you disable an action or a stage, all the nested actions, if any, are disabled automatically. A disabled stage or action is not validated at design time.

Note:

If a disabled stage has an error handler, then the error handler is also disabled.

You can still edit the configuration of a disabled action or stage. Refactoring also takes place for disabled actions and stages. This means that if there is a call to a service in the disabled action or stage, and the service gets renamed, then the service callout is automatically updated.

You can re-enable a disabled stage or action at any time, and the action or stage is no longer skipped in the pipeline.

14.31.1 Disabling an Action on the Pipeline

Before you begin:

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To disable an action in the pipeline:

  1. Navigate to the action that you wish to edit, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the appropriate action icon, then select Disable this Action.

    The action icon is dimmed, and a Disabled icon appears next to the action.

  3. Click Save to save the changes.

14.31.2 Re-Enabling an Action in the Pipeline

Before you begin:

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To re-enable an action in the pipeline:

  1. Navigate to the action that you wish to edit, as described in Adding and Editing Pipeline Actions in the Console.
  2. Click the disabled action icon, then select Enable this Action.

    The dimmed action icon returns to normal, and the action is enabled.

  3. Click Save to save the changes.

14.31.3 Disabling a Stage in the Pipeline

Before you begin:

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To disable a stage in the pipeline:

  1. On the Edit Message Flow page, click the stage icon that you wish to disable.
  2. Select Disable Stage from the context menu that appears.

    The stage icon is dimmed, and a Disabled icon appears next to the stage.

  3. Click Save to save the changes.

14.31.4 Re-Enabling a Stage in the Pipeline

Before you begin:

These instructions assume you are already editing a pipeline in the Edit Message Flow page, as explained in Viewing and Editing Pipelines in the Console.

To re-enable a stage in the pipeline:

  1. On the Edit Message Flow page, click the disabled stage icon.
  2. Select Enable Stage from the context menu that appears.

    The dimmed stage icon returns to normal, and the stage is enabled.

  3. Click Save to save the changes.