Show TOC

Procedure documentationDriving an Interaction with the EIS Locate this document in the navigation structure

 

If the resource adapter implements interaction-related functions, you can drive an interaction with the underlying EIS. Driving an interaction implies calling a specific function of the EIS from your application component.

To execute an interaction, you use an InteractionSpec, which defines the properties of the EIS function.

Procedure

  1. Get a connection to the EIS.

    More information: Using a Resource Adapter to Obtain a Connection

  2. Create an Interaction and an InteractionSpec instance, and set the specific properties defined in the InteractionSpec.

    Example Example

    1. Interaction inter = conn.createInteraction();
      InteractionSpec interSpec = new InteractionSpec();
      interSpec.setFunctionName("XXX");
      
    End of the code.
  3. Create the input record for the execution of the interaction, and an empty output record to hold the output of the interaction.

    Example Example

    1. InputRecord inRec = new javax.resource.cci.Record();
      inRec.setProperty(); // set the properties for the input record
      ...
      OutputRecord outRec = new javax.resource.cci.Record();
      
    End of the code.
  4. Execute the interaction.

    Example Example

    1. inter.execute(interSpec, inRec, outRec);
    End of the code.
  5. Finally, close the interaction and the connection as well.

    Example Example

    1. inter.close();
      ...
      conn.close();
      
    End of the code.