IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with adapters > Configure and using adapters > IBM WebSphere Adapters > Adapter Toolkit > Implementing code from the IBM WebSphere Adapter Toolkit > Outbound support > Use command patterns > Implementing Command Manager

Implementing Interaction.doExecute()

To enable the command pattern capability, you implement a class from the InteractionSpec with a call to the Command Manager. The InteractionSpec is part of the JCA CCI interface.

The interaction class is part of the JCA CCI interface and processes records as input and output. This is the API that is exposed for manipulating data in outbound operations:

 public Record doExecute(InteractionSpec ispec, Record inRecord) 
                                      throws ResourceException;

You may want to call the Command Manager to produce the command structure, then the interpreter to process each command in the structure. A simplified version of the resulting interaction code will resemble the following:

public Record doExecute(InteractionSpec ispec, Record inRecord) 
throws ResourceException {
WBIStructuredRecord wbiRecord = (WBIStructuredRecord) inRecord;
String functionName = ((WBIInteractionSpec) ispec).getFunctionName();
CommandForCursor topLevelCommand = 
commandManagerForCursor.produceCommands(wbiRecord, functionName);
interpreter.doExecute(topLevelCommand);
WBIStructuredRecord outRecord = new WBIStructuredRecord();
outRecord.setOperationName(functionName);
outRecord.setFooConnection(connection.getEISConnection());
outRecord.setEISRepresentation(topLevelCommand.getEisRepresentation());
return outRecord;}

Notice that you need not "walk" the incoming object structure, or the command structure– the command manager and interpreter perform this function.

Implementing Command Manager