hasRequestParameter($toolStateParameter)) { // since the parameter content is a JSON string // we need to load it using the raw mode $param = $this->getRawRequestParameter($toolStateParameter); if ($param) { $toolStates = json_decode($param, true); if (count($toolStates) > 0) { array_walk($toolStates, function (&$toolState) { $toolState = json_encode($toolState); }); $this->getRunnerService()->setToolsStates( $this->getServiceContext(), $toolStates ); return true; } } } return false; } /** * Get the current tools states * * @throws \oat\oatbox\service\exception\InvalidServiceManagerException * @throws \common_Exception * @throws \common_ext_ExtensionException * * @return array the tools states */ protected function getToolStates() { $toolStates = $this->getRunnerService()->getToolsStates($this->getServiceContext()); array_walk($toolStates, function (&$toolState) { $toolState = json_decode($toolState); }); return $toolStates; } }