Connecting BTTComposite to BTTClientOperation

About this task
To connect BTTComposite to BTTClientOperation, do the following:
  1. Make sure that you have client openAccountClientOp operation definition in your BTT configuration files. To create a client operation named openAccountClientOp, add these XML descriptions to your dseoper.xml:
    <operation id="openAccountClientOp" context="openAccountCtx"		implClass="com.ibm.btt.rcp.sample.operation.OpenAccountClientOperation" 	serverOperation="openAccountOp">
    		<refFormat name="csRequestFormat" refId="openAccountOpSendFmt" />
    	</operation>
  2. Click the OpCompTest composite. In the Properties view, set the BTT_operationName to openAccountClientOp.

    Screen capture showing the Java Property Editor

  3. Create a BTTClientOperation according to openAccountClientOp operation definition.
    1. Right-click the project, and select New > Class.

      Screen capture showing the new Java Class dialog box

    2. In the dialog box that pops up, enter OpenAccountClientOperation in the Name field.
    3. In the Superclass field, click Browse, and in the dialog box that pops up, enter com.ibm.btt.base.BTTClientOperation in the Choose a type field.

      Screen capture showing the Supperclass selection

    4. Click OK, and then click Finish. The BTTClientOperation is created.
  4. Override the execute() method of BTTClientOperation:
    public void execute() throws Exception {
    		CSClientService csClientService = CSClient.getCSClient("realCSClient");
    		csClientService.sendAndWait(this,60000);
    		fireHandleOperationRepliedEvent(new OperationRepliedEvent(this));
  5. Click BTTButton in the Palette, and move your cursor to the Shell and click. Name it to aBTTButton. Drag the aBTTButton to aBTTComposite, and in the Properties view, set the text to be Submit, and set the BTT_type to be OK.

    Screen capture showing the properties view

  6. Right-click the visual class you created in Developing a new SWT Visual Beans Class, and select Run as > SWT application. Click Submit.
  7. If you are in debug mode, the execute method of BTTClientOperation is accessed.
  8. In the server side, the Java™ Request Handler will receive a formatted string.