try {
if (isBatch()) {
final CompositeOperationBuilder builder = CompositeOperationBuilder.create();
for (String cmd : getCommands()) {
try {
builder.addStep(ctx.buildRequest(cmd));
} catch (CommandFormatException e) {
throw new IllegalArgumentException(String.format("Command '%s' is invalid", cmd), e);
}
}
final ModelNode result = client.execute(builder.build());