it.eng.spagobi.tools.scheduler
Class Formula
java.lang.Object
it.eng.spagobi.tools.scheduler.Formula
public class Formula
- extends java.lang.Object
Constructor Summary |
Formula(it.eng.spago.base.SourceBean configuration)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Formula
public Formula(it.eng.spago.base.SourceBean configuration)
throws java.lang.Exception
- Throws:
java.lang.Exception
getName
public java.lang.String getName()
setName
public void setName(java.lang.String name)
getDescription
public java.lang.String getDescription()
setDescription
public void setDescription(java.lang.String description)
getGroovyCode
public java.lang.String getGroovyCode()
setGrovyCode
public void setGrovyCode(java.lang.String groovyCode)
execute
public java.lang.String execute()
throws java.lang.Exception
- Executes the formula (i.e. executes the Groovy script)
- Returns:
- the result as a String
- Throws:
java.lang.Exception
- if the groovy code is null or if the execution of the code generates an Excpetion
getAvailableFormulas
public static java.util.List<Formula> getAvailableFormulas()
- Returns a List with all the available formulas: they are configured in WEB-INF/conf/tools/scheduler/formulas.xml.
In case no formulas are found, an empty ArrayList is returned.
- Returns:
- the List of configured formulas.
getFormula
public static Formula getFormula(java.lang.String fName)
- Returns the formula corresponding to the specified name.
If this formula does not exists, null is returned.
- Parameters:
fName
- the name of the formula
- Returns:
- the formula corresponding to the specified name.