public function processGetState(Identifier $identifier)
{
$redis = $this->getRedis();
try {
//get state from key
$key = sprintf(self::KEY_ENTITY_STATE, $identifier->getMachine(), $identifier->getEntityId());
$state = $redis->get($key);
} catch (\Exception $e) {
throw new Exception(sprintf('getting current state failed: [%s]', $e->getMessage()), Exception::PERSISTENCE_LAYER_EXCEPTION);
}
if (!$state) {
throw new Exception(sprintf('no state found for [%s]. ' . 'Did you "$machine->add()" it to the persistence layer?', $identifier->getId(true)), Exception::PERSISTENCE_LAYER_EXCEPTION);
}
return $state;
}