Client state is an abstract state class which defines the
general behaviors for client interaction. And in BTT product, there
is a default implementation of client state called ‘PopupPageClientState’.
Actually, alpha developers always need to customize their client state
to fulfill their usage scenarios.
Procedure
- Implement state class.
BTT product has provided an abstract class named ‘com.ibm.btt.automaton.ext.ClientState’
to facilitate the alpha extension. This class is extended from the
class of page state ‘com.ibm.btt.automaton.html.DSEHtmlState’,
so alpha developers could focus more on the logics of client interaction
and pay less attention on common state methods like ‘initializeFrom’.
In extension usage scenario, there are 4 methods may be commonly extended
by alpha developer in their application. For more information, please
refer to Common State methods.- protected abstract String getCommand()
- protected void afterFirstExecute()
- protected void addRequiredDataToContext(Context context)
- public String generateClientResponse()
- Register the implementation class into btt.xml.
To
make the extended state class available during runtime, alpha developers
should register it into the btt.xml of target application. So you
need to open the btt.xml in your application project, and move to
the ‘processor’ tab. Then, you can register your extended state class
in the class table of processors. Please reference with the following
screen shot.