Start of Content Area

Procedure documentation 10: Checking a Result (Switch)  Locate the document in its SAP Library structure

Use

If the airline executed the booking successfully, the confirmation message contains the B indicator for Booked. To determine whether all the flights in the whole flight trip could be booked, the number of successful bookings and the number of sent bookings are compared. The successful bookings are also collected and put in a list. The booking confirmation for the whole flight trip is created from this list later.

To do so, insert a step of type Switch. Define a branch for the switch. This branch will be executed if the confirmation received contains the B indicator. In this branch you define two container operations: one increases the counter for the successful bookings. The seconds adds the confirmation message to a list. Define corresponding container elements for the counter and the list. 

If a confirmation is received that does not contain the B indicator, the Otherwise branch is executed. This branch is created automatically. Since unsuccessful bookings are not to be processed further by the integration process, no further steps are required in this branch.

Procedure

Defining a Container Element

...

       1.      Define the container element for the counter for the successful bookings as follows:

¡        Name: ConfCount

¡        Category: XSD Simple Type

¡        Type: xsd:integer

¡        Container: shows Process

       2.      Define a multiline container element for the list of successful bookings as follows:

¡        Name: ConfirmedList

¡        Category: Abstract Interface

¡        Type: FlightBookingOrderConfirmation_Abstract

¡        Select Multiline.

¡        Container: shows Process

Inserting a Switch

       3.      Insert a switch (This graphic is explained in the accompanying text) after the ReceiveConfirmation receive step.

       4.      In the properties area, enter CheckResult as the step name.

Defining a Container Operation for the Counter

       5.      Insert a container operation (This graphic is explained in the accompanying text) in Branch 1 of the switch.

       6.      To increase the counter by 1 after each successful confirmation received, define the container operation as follows (to define a container operation for a counter, see also: 8: Defining Counters (Container Operation)).

¡        Step name: IncrementSuccessCounter

¡        Target: ConfCount

¡        Operation: Assign

¡        Expression: ConfCount (Simple Variable)

¡        Operator: +

¡        Expression: ’1’

Defining a Container Operation for Adding to the List

       7.      Insert a second container operation after the first container operation to add a confirmation to the list of positive confirmations.

       8.      Define the container operation as follows:

¡        Step name: StoreConfirmation

¡        Target: ConfirmedList (Interface Variable)

¡        Operation: Append

¡        Expression: AirlineResponse (Interface Variable)

Defining a Condition

       9.      Click the switch icon (This graphic is explained in the accompanying text).

   10.      To make the integration process easy to understand, enter BookingSuccess in the Outcome Name field.

This outcome name is displayed in the graphical process definition. 

   11.      Double-click the Condition field.

This displays the condition editor.

   12.      Define the left operand of the condition:

                            a.      Call the input help for the Left Operand field.

                            b.      In the expression editor, select Interface Variable and then AirlineResponse.

                            c.      In the XPath screen area, navigate to the BookingStatus field.

/p1:FlightBookingOrderConfirmation/BookingStatus is displayed in the XPath Expression field.

                            d.      Deselect the Multiline field.

   13.      Use = (equals sign) as the default setting for the operand.

   14.      Define the comparison value as a constant:

                            a.      Call the input help for the Right Operand field.

                            b.      In the expression editor, select Constant.

                            c.      Enter B and select xsd:string in the Type field.

The following condition is now displayed in the switch properties:

(AirlineResponse./p:FlightBookingOrderConfirmation/BookingStatus = B)

See also:

Switch

Container Operation

Defining the Data for a Process in Containers

Condition Editor

Using the Expression Editor

XSD Data Types

 

End of Content Area