JavaScript Method Reference
A JavaScript handler implements the same methods as the Java BLTHAdapter class:
cim1265
A JavaScript handler implements the same methods as the Java BLTHAdapter class:
handleStart(BLTHContext ctx)handleSetSubject(BLTHContext ctx)handleValidation(BLTHContext ctx)handleSubmission(BLTHContext ctx)
Example:
// This sample illustrates BLTH implemented in java script// It verifies that a tag specified in the task is unique in// the environment functionhandleValidation(blthContext, errorMsg) {var taskTag = null;var currentTask = blthContext.getAdminTask();if(currentTask != null) {taskTag = blthContext.getAdminTask().getTaskTag();}if(taskTag == null) {errorMsg.reference = "Failed to get the task tag";return false;}try {task = blthContext.getAdminTaskProvider().findByTag(taskTag);} catch(exception) {// there is no task with this tagreturn true;}��if (!currentTask.equals(task)) {errorMsg.reference = "Tag must be unique: " + taskTag;return false;} else {// the same task}return true;}
For more information on these methods, refer to the CA Identity Manager Programming Reference.