examples.api

## Class ExecuteAction

- java.lang.Object
- - examples.api.ExecuteAction

-     public class ExecuteAction
      extends java.lang.Object

  This advanced example shows how to execute a server context action by simulating operator input.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExecuteAction()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ActionIdentifier` | `getActionIdentifier(Context devicesContext)`
    `static GenericActionCommand` | `getGenericActionCommand(Context devicesContext, ActionIdentifier actionId, GenericActionResponse actionResponse)`
    `static void` | `main(java.lang.String[] args)`
    `static GenericActionResponse` | `processCommand(GenericActionCommand cmd)` This method emulates execution of UI procedures (action commands) by a human.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ExecuteAction

          public ExecuteAction()

  - ### Method Detail

    - #### main

          public static void main(java.lang.String[] args)

    - #### processCommand

          public static GenericActionResponse processCommand(GenericActionCommand cmd)

      This method emulates execution of UI procedures (action commands) by a human. It must "understand" the action it executes and know all action commands that an action may issue. The normal flow of "discovery" action issues only "Edit Data" commands, so we just fail if command of any other type was received. When received an "Edit Data" command, we reply by sending the same data. This emulated a simple click on "OK" button, i.e. when data was not edited. However, some requests with "known" IDs are filled with additional data.
      Parameters:
        `cmd` - UI procedure to process
      Returns:
        Action response

    - #### getGenericActionCommand

          public static GenericActionCommand getGenericActionCommand(Context devicesContext,
                                                                     ActionIdentifier actionId,
                                                                     GenericActionResponse actionResponse)
                                                              throws ContextException

      Throws:
        `ContextException`

    - #### getActionIdentifier

          public static ActionIdentifier getActionIdentifier(Context devicesContext)
                                                      throws ContextException

      Throws:
        `ContextException`