Using the Client Simulator view

The Client Simulator view allows you to emulate the clients in IBM WebSphere InterChange Server interfaces--connector agents and access clients. The view provides interfaces to connect the clients to the server, create and send business object requests, and reply with business object responses.

Showing and closing Client Simulator views

The following sections describe the numerous ways you can show and close Client Simulator views.

The "Default interface position" column in Table 29 lists the views whose default positions in the interface are overlaid with the Client Simulator views in the "Client Simulator view number" column.


Table 29. Default Client Simulator view positions

Client Simulator view number Default interface position
Test Connector 1 ITE Navigator
Test Connector 2 Outline
Test Connector 3 Properties
Test Connector 4 Dependency
Test Connector 5 ITE Navigator
Test Connector 6 Outline
Test Connector 7 Properties
Test Connector 8 Dependency
Test Connector 9 ITE Navigator

Showing Client Simulator views

Use one of the following techniques to show Client Simulator views for the connectors and access clients in the interface you are testing:

Table 29 shows the default interface positions in which the different Client Simulator views are displayed.

Closing Client Simulator views

Use one of the following techniques to close Client Simulator views:

Connecting a Client Simulator view to the server

You must connect Client Simulator views to the server to emulate a connector as part of testing an interface.

When using the Client Simulator view, you can either emulate a connector using the definition in the repository or using a configuration file. You can also use the Client Simulator view to emulate an access client.

Note that you can also use the Task Manager view to connect agents to the server. For more information, see Table 25.

Emulating a connector using the repository definition

Do one of the following to connect to the server using the repository definition of the connector:

Note:
The DeliveryTransport property of the connector you are emulating must be set to the value IDL to connect to the server using the repository definition.

Emulating a connector using a configuration file

Do the following to connect to the server using a configuration file:

  1. Click the down arrow in the right-hand corner of the title bar of the Client Simulator view and select Server > Connect with *.cfg.
  2. Navigate to and open the connector configuration file.
Note:
If the DeliveryTransport property of the connector you are emulating is not set to the value IDL then and you select Server > Connect from the menu, then Integrated Test Environment presents the dialog to specify the configuration file to be used.

Emulating an access client

To emulate an access client, click the down arrow in the right-hand corner of the title bar of the Client Simulator view and select Server > Connect.

Confirming that a client has connected to the server

Use the following indicators to determine if a Client Simulator has successfully connected to the server:

For more information about the Status Pane, see Using the Status Pane.

For more information about the Input Pane, see Using the Input Pane.

Disconnecting from the server

To disconnect a Client Simulator that is emulating a connector from the server, click the down arrow in the right-hand corner of the title bar of the Client Simulator view and select Server > Disconnect.

A Client Simulator view also disconnects from the server when you close it. The only way to disconnect a Client Simulator view that is emulating an access client from the server is to close the Client Simulator view. For more information on closing Client Simulator views, see Closing Client Simulator views.

Client Simulator view panes and pane arrangements

The Client Simulator view has several panes you use to simulate the behavior of a connector or access client.

Using the Input Pane

You use the Input Pane in the Client Simulator view to work with and send business object requests. You can create business object instances, add data to their attributes, and send them as requests. You typically use the Input Pane when working with a Client Simulator view that is emulating a source client in an interface.

Figure 83 shows the Input Pane for a Client Simulator view that is emulating a source connector.

Figure 83. Client Simulator view Input Pane


Using the Result Pane

You use the Result Pane in the Client Simulator view to work with business object requests that have been received and to send business object responses. You typically use the Result Pane when working with a Client Simulator view that is emulating a destination client in an interface.

Figure 84 shows the Result Pane for a Client Simulator view that is emulating a destination connector.

Figure 84. Client Simulator view Result Pane


Using the Status Pane

The Status Pane contains messages about the execution of the Client Simulator view. For instance, the message "[AppConnector: Connector has recovered]" is written to the Status Pane when a connector has successfully connected to the server.

You use the Status Pane primarily to confirm that Client Simulator has successfully connected to the server and to perform troubleshooting. For instance, if you send a business object request from a Client Simulator view and there is no subscription for the business object type, then a message is written to the Status Pane. This can help you to determine why a business object request does not appear in the Result Pane of a Client Simulator view emulating a destination client in an interface.

Figure 85 shows the Status Pane for a Client Simulator view.

Figure 85. Client Simulator view Status Pane


Arranging all panes vertically

You can arrange a Client Simulator view so that it displays the Input, Result, and Status panes simultaneously, stacked on top of one another. This view can be helpful when a Client Simulator view is emulating a client that has to handle both event notification and request processing responsibilities.

Do one of the following to arrange the Client Simulator view panes vertically:

Figure 86 shows the Client Simulator view panes when they have been arranged vertically.

Figure 86. Arranging Client Simulator view panes vertically


Arranging all panes horizontally

You can arrange a Client Simulator view so that it displays the Input, Result, and Status panes simultaneously from left to right. This view can be helpful when a Client Simulator view is emulating a client that has to handle both event notification and request processing responsibilities.

Do one of the following to arrange the Client Simulator view panes horizontally:

Figure 86 shows the Client Simulator view panes when they have been arranged horizontally.

Figure 87. Arranging Client Simulator view panes horizontally


Working with business object requests in the Client Simulator view

Request business objects are those that you send from a Client Simulator view when it is emulating a connector that is the source of the events that trigger an interface. Working with request business objects consists of creating a business object instance, populating it with data, and sending the request.

Creating request business objects

Do the following to create a new business object instance:

  1. In the Input Pane, select the name of the business object you want to create from the BO Type drop-down menu.
  2. Do one of the following:
  3. When presented with the "New Instance" dialog, type a name for the instance in the Enter Name field.
  4. Select the desired verb from the Verb drop-down menu.
  5. Select the desired locale from the BO Locale drop-down menu.
  6. Provide values for the simple attributes and child business objects within the top-level object, as described in Setting values for business object attributes.
  7. Click OK.

Sending request business objects asynchronously

When a source client sends a request business object in asynchronous mode, it does not expect to get back a response business object. Once the request business object is dispatched, the source client's role in the transaction is finished. The response business object is typically processed by the integration broker. The default mode for a Client Simulator view is asynchronous.

To send a business object asynchronously, do the following:

  1. Create the request business object instance, as described in Creating request business objects.
  2. Click the down arrow in the right-hand corner of the title bar of the Client Simulator view and select Server > Mode > Asynchronous.
    Note:
    The Client Simulator view operates in "Asynchronous" mode by default, so you only have to perform this step if you previously were sending synchronous requests from the view. You do not have to set the mode before sending each request.
  3. Do one of the following to send the request:

Sending business object requests synchronously

When a source client sends a request business object synchronously, it expects to get back a response business object from the integration broker after any destination applications have processed the request.

  1. Create the request business object instance, as described in Creating request business objects.
  2. Click the down arrow in the right-hand corner of the title bar of the Client Simulator view and select Server > Mode > Synchronous to set the Client Simulator view to synchronous mode.
  3. Do one of the following to send the request:
  4. When presented with the "Select Collaboration" dialog, select the collaboration to which the business object should be sent from the Collaboration drop-down menu and click OK.

    The business object request is sent to the configured port of the collaboration object chosen for processing.

Sending business object requests in batch mode

In batch mode, the Client Simulator view lets you specify the number of instances of a particular business object you want to send, as well as one attribute in the top-level object --a primary key attribute, for example--that you want set to a unique value for each instance. The Client Simulator view copies the business object as many times as you have specified, incrementing the value of the single attribute you specified for each instance, and then sends each instance. This option allows you to create a large number of business objects quickly and easily.

If the selected attribute is a key field that participates in dynamic cross-referencing as part of an identity relationship, then you must guarantee that the initial value and all those that follow it are unique. Otherwise, the cross-referencing logic will fail, causing the request business objects to fail.

To ensure that the values are unique, you can use Relationship Manager or execute SQL statements against the table for the relationship participant as follows.

To send business objects in batch mode, do the following:

  1. Click the down arrow in the right-hand corner of the title bar of the Client Simulator view and select Server > Send Batch.
  2. In the "Batch Mode" window, select the desired verb from the Verb drop-down menu.
  3. Select the desired locale from the BO Locale drop-down menu.
  4. Select from the Attribute list the attribute in the top-level business object that you want incremented with each business object request in the batch.

    The selected attribute should typically be an attribute that uniquely identifies the business object, such as a primary key.

  5. In the Initial Value field, type the starting value for the attribute to be incremented.
  6. In the No. of BO's field, type the number of business object instances you want generated and sent.
  7. Click OK.

    The Client Simulator view generates the number of business objects you specified, all identical with the exception of the one specified attribute, whose value is incremented for each instance.

Figure 88 shows a batch mode configuration in which:

Figure 88. Sending business object requests in batch mode


Setting values for business object attributes

You can set values for business object attributes when creating a business object request and when editing a business object request that has been received, so that it can be returned as a response.

To set values for the attributes of a business object you intend to send as a request, you must use the Input Pane of the Client Simulator view. For more information, see Using the Input Pane.

To set values for the attributes of a business object you are editing to send as a response, you use the "Response BO" window. For more information, see Editing response business objects.

Setting values for simple attributes

To provide a value for a simple attribute, click its cell in the Value column of the Input Pane or the "Response BO" window and enter a value.

Adding child business objects

To add an instance of a child business object, right-click the attribute that represents the child object in the Input Pane or the "Response BO" window and select Add Instance from the context menu.

A plus sign (+) is added next to the attribute that represents the child business object to show that there is at least one child business object instance. If you expand the child object attribute, numbered entries are displayed for each instance. The individual instances also have plus signs (+) next to them, so you can expand them and set values for their attributes.

To add more child business object instances, right-click the attribute that represents the child object and select Add Instance from the context menu.

Note:
If the Card property of the attribute that references the child business object is set to the value 1 (indicating it is of single-cardinality), then you will only be able to add one instance of the child object.

Removing child business objects

To remove an instance of a child business object, right-click the instance and select Remove Instance from the context menu.

To remove all instances of a child business object, right-click the attribute that represents the child business object and select Delete All Instances from the context menu.

Setting the verb of a child business object

You can set the verb of a child business object to test the effect that value has on the business process. This can be helpful when you are troubleshooting logic that involves the cross-referencing of child objects.

To set the verb of a child business object instance, right-click it and choose Set Verb from the context menu. When presented with the "Select Verb" prompt, selected the desired verb and click OK.

Resetting business object attributes to their default values

To reset the attributes of a business object request to their default values, click the down arrow in the right-hand corner of the title bar of the Client Simulator view and select Edit > Reset BO.

To reset the attributes of a business object response to their default values, click the Reset BO to default button in the toolbar of the "Response BO" window.

Clearing business object attribute values

To clear the attributes of a business object request of their values, click the down arrow in the right-hand corner of the title bar of the Client Simulator view and select Edit > Clear BO.

To clear the attributes of a business object response of their values, click the Clear BO values button in the toolbar of the "Response BO" window.

Working with response business objects

Response business objects are those that you send from a Client Simulator view when it is emulating a connector that is the recipient of business object requests in an interface. Working with request business objects consists of editing the values in the business object instance and sending the response back to the server.

If you create and send a business object request as described in Working with business object requests in the Client Simulator view and it is successfully processed by the interface, then the business object appears in the Result Pane of any destination connectors in the interface. Figure 84 shows a Result Pane in which a business object request has been received.

Editing response business objects describes how to edit a business object request that has been received, and Sending response business objects describes how to send the instance as a response.

Editing response business objects

When you receive a business object request in a Client Simulator view that is emulating a destination client in an interface, you frequently want to edit the values of the attributes. For instance, you will want to provide unique values for primary key attributes that participate in relationships, or you will want to modify the value of other attributes to test map or collaboration logic that responds differently depending on the exact values in the business object. Do the following to set the values of business object attributes:

  1. Do one of the following to edit the business object request in the "Response BO" window:
  2. Do one of the following to edit the attributes of the business object:

Sending response business objects

After you edit a request business object (if editing is needed), you send it back to the server as a reply.

Table 30 lists the reply options and shows their corresponding connector return codes for both C++ and Java connectors. For more detailed information about C++ or Java Connector return codes, see the Connector Development Guide for C++ or Connector Development Guide for Java Server.

Table 30. Client Simulator view reply types and connector return codes.

Client Simulator view reply type C++ connector return code Java connector return code
Success BON_SUCCESS SUCCESS
Fail BON_FAIL FAIL
Multiple Hits BON_MULTIPLE_HITS MULTIPLE_HITS
Retrieve By Content Fail BON_FAIL_RETRIEVE_BY_CONTENT RETRIEVEBYCONTENT_FAILED
Not Found BON_BO_DOES_NOT_EXIST BO_DOES_NOT_EXIST
Value Duplicate BON_VALDUPES VALDUPES

To reply to a request business object, do the following:

  1. Select the business object instance in the Request Pane.
  2. Do one of the following:

Saving business objects

You can save a business object instance that you have created in the Input Pane so that it is available whenever the Client Simulator view is opened to emulate that particular connector definition. You can select the instance by name from BO Instance field instead of having to go through the process of creating a new request.

To save the business object instances currently listed in the BO Instance field, click the down arrow on the right-hand side of the title bar of the Client Simulator view and select Edit > Save All BO's.

The business object is saved to a file with the name of the business object instance, without any extension, in a directory named after the business object type in the .bos directory of the directory for the test project in which the test unit is defined. The file is saved in the same format used by Test Connector and Map Designer, so it can be used for testing in those tools as well.

Deleting business objects

To delete a business object instance from a Client Simulator view, click the down arrow on the right-hand side of the title bar of the Client Simulator view and select Edit > Delete BO.

Exporting business objects

You can export a business object instance to a file to conveniently archive data and to share with Technical Support. The test data file is saved with a .bo extension and can be used for testing with Test Connector and Map Designer as well as the Integrated Test Environment.

Exporting a request business object

Do the following to export a business object instance from the Input Pane of the Client Simulator view:

  1. Select the business object instance you want to export in the BO Instance field.
  2. Click the down arrow on the right-hand side of the title bar of the Client Simulator view and select Edit > Export BO.
  3. Navigate to the directory in which you want to save the file and specify a name in the File name field.
  4. Click Save.

Exporting a response business object

Do the following to export a business object instance from the "Response BO" window when editing a business object response in the Result Pane:

  1. Click the Save BO button in the toolbar of the "Response BO" window.
  2. Navigate to the directory in which you want to save the file and specify a name in the File name field.
  3. Click Save.

Importing business objects

You can import a business object test data file that was saved from Map Designer or Test Connector, or exported from Integrated Test Environment.

Importing a request business object

Do the following to import a business object instance into the Input Pane of the Client Simulator view:

  1. Click the down arrow on the right-hand side of the title bar of the Client Simulator view and select Edit > Import BO.
  2. Navigate to and open the test data file.

Importing a response business object

Do the following to import a business object instance into the "Response BO" window when editing a business object response in the Result Pane:

  1. Click the Load BO button in the toolbar of the "Response BO" window.
  2. Navigate to and open the test data file.

Comparing business object instances

A Client Simulator view can compare two business objects of the same type and display the attributes that differ in value. You can use this function to view changes to a business object at different points in the execution of a transaction. For instance, you could compare a business object that has been sent to the server with the same business object after the server has processed it and returned it to the source connector. Do the following to compare two business object instances:

  1. Select the request business object instance to be compared on the Input Pane.
  2. Select the response business object to be compared on the Response Pane.
  3. Click the down arrow in the right-hand corner of the title bar of the Client Simulator view and select Reply > Compare BO's.

Tracing business object data output

To transport business object data output, CORBA is used. Because this solution can be problematic if the business object data is large, the server caches the actual business object data locally and notifies the client with metadata only. Since this call is small, the business object inspection points can be updated quickly. The cached data in the server is cleared when the server restarts or when ITE requests it.

Business object data transport is only intended for remote servers. For local servers, sharing the local file system should be used for optimum performance. When business object tracing is turned on, ITE will notify local servers of the file system location. If the server is running remotely, the file system location will be empty.

Copyright IBM Corp. 1997, 2004