use of org.wso2.carbon.humantask.core.engine.commands.AddComment in project jaggery by wso2.
the class RegistryHostObject method jsFunction_addComment.
public static void jsFunction_addComment(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws ScriptException {
String functionName = "addComment";
int argsCount = args.length;
if (argsCount != 2) {
HostObjectUtil.invalidNumberOfArgs(hostObjectName, functionName, argsCount, false);
}
if (!(args[0] instanceof String)) {
HostObjectUtil.invalidArgsError(hostObjectName, functionName, "1", "string", args[0], false);
}
if (!(args[1] instanceof String)) {
HostObjectUtil.invalidArgsError(hostObjectName, functionName, "2", "string", args[1], false);
}
RegistryHostObject registryHostObject = (RegistryHostObject) thisObj;
try {
registryHostObject.registry.addComment((String) args[0], new org.wso2.carbon.registry.core.Comment((String) args[1]));
} catch (RegistryException e) {
throw new ScriptException(e);
}
}
Aggregations