private ServerDeploymentActionResult getActionResult(UUID actionId, ModelNode actionResultNode) {
ServerDeploymentActionResult actionResult = null;
String outcome = actionResultNode.get("outcome").asString();
if ("cancelled".equals(outcome)) {
actionResult = new SimpleServerDeploymentActionResult(actionId, Result.NOT_EXECUTED);
} else if ("failed".equals(outcome)) {
Exception e = actionResultNode.hasDefined("failure-description") ? new Exception(actionResultNode.get("failure-description").toString()) : null;
if (actionResultNode.hasDefined("rolled-back") && actionResultNode.get("rolled-back").asBoolean()) {
if (e == null) {
actionResult = new SimpleServerDeploymentActionResult(actionId, Result.ROLLED_BACK);
} else {
actionResult = new SimpleServerDeploymentActionResult(actionId, Result.ROLLED_BACK, e);
}
} else {
actionResult = new SimpleServerDeploymentActionResult(actionId, e);
}
} else {
actionResult = new SimpleServerDeploymentActionResult(actionId, Result.EXECUTED);
}
// FIXME deal with shutdown possibilities
return actionResult;
}