*/
private Scriptable prepareScope
(Context cx, Activity activity, FormalParameter[] formPars, Map map)
throws RemoteException {
Scriptable scope = cx.initStandardObjects(null);
ScriptableObject wfe = new ScriptableObject () {
public String getClassName() {
return "ToolAgentContext";
}
};
Function fo = new FunctionBase () {
public Object call (Context cx, Scriptable scope,
Scriptable thisObj, Object[] args)
throws JavaScriptException {
if (logger.isDebugEnabled ()) {
logger.debug ("abandon called with: " + args[0]);
}
throw new AbandonedException ((String)args[0]);
}
};
wfe.defineProperty ("abandon", fo, ScriptableObject.PERMANENT);
wfe.defineProperty
("activityUniqueKey", Context.javaToJS(activity.uniqueKey(), scope),
ScriptableObject.PERMANENT | ScriptableObject.READONLY);
scope.put("scriptingContext", scope, wfe);
prepareArguments(cx, scope, formPars, map);