code: public function process()
      {
          $this->validate();
  
          $itemRef = $this->hasRequestParameter('itemDefinition')
              ? $this->getItemRef($this->getRequestParameter('itemDefinition'))
              : null;
  
          $traceData = json_decode(html_entity_decode($this->getRequestParameter('traceData')), true);
  
          try {
              $serviceContext = $this->getServiceContext();
              $stored = 0;
              $size = count($traceData);
  
              foreach ($traceData as $variableIdentifier => $variableValue) {
                  if ($this
                      ->getRunnerService()
                      ->storeTraceVariable($serviceContext, $itemRef, $variableIdentifier, $variableValue)
                  ) {
                      $stored++;
                  }
              }
  
              $response = [
                  'success' => $stored == $size
              ];
  
              common_Logger::d('Stored "' . $stored . '/' . $size . '" trace variables');
              /** @var EventManager $eventManager */
              $eventManager = $this->getServiceLocator()->get(EventManager::SERVICE_ID);
              $event = new TraceVariableStored($serviceContext->getTestSession()->getSessionId(), $traceData);
              $eventManager->trigger($event);
  
          } catch (Exception $e) {
              $response = $this->getErrorResponse($e);
          }
  
          return $response;
      }
docs: Process the storeTraceData action.
  
  Validate required fields.
  Store trace data through runner service.
  Trigger TraceVariableStored event.
  
  @return array
  @throws common_Exception
  @throws common_exception_Error
  @throws common_exception_InconsistentData