ModelNode domainModel, DeploymentActionsMenu cmd) throws IOException {
String toUndeploy = chooseDeployedContent("Choose the deployment to undeploy:", deployedContent, undeployedContent, domainModel);
if (toUndeploy != null) {
UndeployDeploymentPlanBuilder udpb = builder.undeploy(toUndeploy);
builder = udpb;
if (cmd == DeploymentActionsMenu.UNDEPLOY_AND_REMOVE) {
builder = udpb.andRemoveUndeployed();
removedContent.add(toUndeploy);
addedContent.remove(toUndeploy);
}
undeployedContent.add(toUndeploy);