/**
  * View details about a batch command invocation.
  *
  * @param batchToken
  * @param request
  * @return
  */
 @RequestMapping("/batch/command/{token}")
 public ModelAndView batchCommandInvocationDetail(
     @PathVariable("token") String batchToken, HttpServletRequest request) {
   Tracer.start(TracerCategory.AdminUserInterface, "batchCommandInvocationDetail", LOGGER);
   try {
     Map<String, Object> data = createBaseData(request);
     ITenant tenant = (ITenant) data.get(DATA_TENANT);
     IDeviceManagement management = SiteWhere.getServer().getDeviceManagement(tenant);
     IBatchOperation operation = management.getBatchOperation(batchToken);
     if (operation != null) {
       data.put("operation", operation);
       String commandToken =
           operation.getParameters().get(IBatchCommandInvocationRequest.PARAM_COMMAND_TOKEN);
       if (commandToken == null) {
         return showError("No command token set for batch operation.");
       }
       IDeviceCommand command = management.getDeviceCommandByToken(commandToken);
       data.put("command", new String(MarshalUtils.marshalJsonAsString(command)));
       return new ModelAndView("batch/command", data);
     }
     return showError("Batch operation for token '" + batchToken + "' not found.");
   } catch (NoTenantException e) {
     return showTenantChoices(getUrl(request), request);
   } catch (SiteWhereException e) {
     return showError(e);
   } finally {
     Tracer.stop(LOGGER);
   }
 }