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

Command implementations

You use an doExecute() method to implement commands. Extending an abstract base command with operation-specific commands supports the coding benefits of command patterns.

doExecute() is the method that implements each command. This method should perform the appropriate operation for the associated node. If a Create command is associated with child B1, for example, doExecute() is the method that calls the EIS API to create that child.

public void doExecute(InputCursor obj, Type metadata) throws ResourceException 
{EisRepresentation eis = EisAPI.insert(toEisFormat(obj, metadata));}

Be careful with deleted children. The SDO getContainer() does not return the original parent in a delta operation. Use the getParentDataObject() method, available in the command object, to alleviate this problem.

The Retrieve and RetrieveAll commands must create the entire object structure and return it because the input object is unaware of child objects present in the EIS.

It is a common pattern to have an abstract base command for your EIS, and then have the operation-specific commands extend that. This way, if all your commands need similar data, you can reduce your coding effort.

The WebSphere Adapter Toolkit will not generate the doExecute() methods for individual commands. You will want to override the base command execute method to put in the logic you want.

Implementing Command Manager


Related concepts:

Implementing Interaction.doExecute()