Руководство Разработчика для Cisco Cisco UCS Director 5.0
Cisco UCS Director Cloupia Script Cookbook
31
logger.addError("Error occured while assigning VMs to
vDC");
ctxt.setFailed("Task failed to assign VM to vDC");
ctxt.exit();
}
}
output.Result = " VMs successfully assigned to destination vDC:"+
destinationVdc;
}
vDC");
ctxt.setFailed("Task failed to assign VM to vDC");
ctxt.exit();
}
}
output.Result = " VMs successfully assigned to destination vDC:"+
destinationVdc;
}
24 Rolling back a Task in a Workflow
Rollback / Undo of a task in a workflow
If you want to rollback a task in a workflow, use the change tracker API, and take
care of rollback of the task.
care of rollback of the task.
Example Script :
importPackage(com.cloupia.service.cIM.inframgr.customaction
s);
importPackage(com.cloupia.feature.accounts.wftasks);
function doRollBack(){
s);
importPackage(com.cloupia.feature.accounts.wftasks);
function doRollBack(){
var undoTaskHandlerName =
DeleteGroupConfig.HANDLER_NAME;
var configObject = new
DeleteGroupConfig(input.groupId+ "")
ChangeTracker.undoableResourceModified(input.assetType,
input.assetId, input.assetLabel, input.description,
undoTaskHandlerName, configObject) ;
}
doRollBack();
ChangeTracker.undoableResourceModified(input.assetType,
input.assetId, input.assetLabel, input.description,
undoTaskHandlerName, configObject) ;
}
doRollBack();
The undo task handler name and undo config object are the important parameters
for executing the undo task. The undo task needs the data for the original task to
undo the actions done by the original task.
Related API for undo of modify/delete operations:
ChangeTracker.undoableResourceModified and
ChangeTracker.undoableResourceDeleted.
Both the API calls with the same set of parameters. Each task in the workflow needs
undo support using the change tracker API to successfully rollback the entire
workflow.
for executing the undo task. The undo task needs the data for the original task to
undo the actions done by the original task.
Related API for undo of modify/delete operations:
ChangeTracker.undoableResourceModified and
ChangeTracker.undoableResourceDeleted.
Both the API calls with the same set of parameters. Each task in the workflow needs
undo support using the change tracker API to successfully rollback the entire
workflow.