public Object execute(Environment environment) throws Exception { unlockExecution(); if (userId != null) { environment.setUserId(userId); } try { CommandService commandService = environment.get(CommandService.class); commandService.execute(command); } finally { if (userId != null) { environment.setUserId(null); } } return null; }