def action(a, c = nil)
      if !self.driver.in_driver_context?
        # Called from outside Driver. Send an async message to Driver.
        self.driver.message(:action, [a, c])
      else
        # Called from within Driver.
        if self.respond_to?(a)
          command = self.send(a)

          case command
            when String
              msg = "#{self.name} #{a}: #{command}"
              applog(self, :info, msg)

              system(command)
            when Proc
              msg = "#{self.name} #{a}: lambda"
              applog(self, :info, msg)

              command.call
            else
              raise NotImplementedError
          end
        end
      end
    end
def action(a, c = nil)
      if !self.driver.in_driver_context?
        # Called from outside Driver. Send an async message to Driver.
        self.driver.message(:action, [a, c])
      else
        # Called from within Driver.
        if self.respond_to?(a)
          command = self.send(a)

          case command
            when String
              msg = "#{self.name} #{a}: #{command}"
              applog(self, :info, msg)

              system(command)
            when Proc
              msg = "#{self.name} #{a}: lambda"
              applog(self, :info, msg)

              command.call
            else
              raise NotImplementedError
          end
        end
      end
    end
Perform the given action.

 a - The Symbol action.
 c - The Condition.

 Returns this Task.