Implementing evaluateFunction
Implement this method to evaluate a specified function with specified actual arguments. The function is specified with the function name. The arguments are specified with an instance of com.apama.dashboard.data.IVariableData.
For functions that return table data, use the factory class com.apama.dashboard.data.TabularDataFactory to create an instance of ITabularData.
When you compile your implementation, ensure that dashboard_client5.1.jar is on your class path. This jar file is in the lib directory of your Apama installation.
Your implementation of evaluateFunction can set or retrieve substitution values, if necessary, by using the following methods of DashboardManager and IDashboardContext:
DashoardManager.getFunctionDashboardContext: This static method takes as argument an instance of
IVariableData and returns an instance of
IDashboardContext. Pass the instance of
IVariableData that is passed into
evaluateFunction.
IDashboardContext.getSubstitution: Gets the value of a substitution with a given name.
IDashboardContext.setSubstitution: Sets the value of a substitution with a given name.
IDashboardContext.setSubstitutions: Sets the values of substitutions, where the substitutions and values are specified with
String vectors.
Each set method has a boolean argument, triggerUpdate, which controls whether objects attached to the substitution are updated. If it is false, they are not. If the substitutions are only used as command parameters or in drilldowns, you can improve performance by specifying false.
Here is an example:
IDashboardContext ctxt =
DashboardManager.getFunctionDashboardContext(v);
String val1 = ctx.getSubstitutionValue("$subst1");
...
ctx.setSubstitution("$subst2", "val2", false);
Copyright © 2013
Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.