As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
var scriptFailed = false; // Have a look at the behaviour object that should have been passed if (behaviour == null) { logger.log("The behaviour object has not been set."); scriptFailed = true; } // Check the name of the behaviour if (behaviour.name == null && behaviour.name != "onCreateNode") { logger.log("The behaviour name has not been set correctly."); scriptFailed = true; } else { logger.log("Behaviour name: " + behaviour.name); } // Check the arguments if (behaviour.args == null) { logger.log("The args have not been set."); scriptFailed = true; } else { if (behaviour.args.length == 1) { var childAssoc = behaviour.args[0]; logger.log("Calling compute average"); //computeAverage(childAssoc); var clienteName = childAssoc.properties["cm:name"]; childAssoc.properties["cm:content"] = clienteName; childAssoc.save(); } else { logger.log("The number of arguments is incorrect."); scriptFailed = true; } }