Class CalculatorHelper

java.lang.Object
org.pentaho.di.trans.step.BaseStepHelper
org.pentaho.di.trans.steps.calculator.CalculatorHelper
All Implemented Interfaces:
StepHelperInterface

public class CalculatorHelper extends BaseStepHelper
  • Constructor Details

    • CalculatorHelper

      public CalculatorHelper()
  • Method Details

    • handleStepAction

      protected org.json.simple.JSONObject handleStepAction(String method, TransMeta transMeta, Map<String,String> queryParams)
      Handles step-specific actions for Calculator.
      Specified by:
      handleStepAction in class BaseStepHelper
      Parameters:
      method - The name of the method to execute.
      transMeta - The transformation metadata associated with the step.
      queryParams - A map of query parameters for the action.
      Returns:
      A JSON object containing the action status and any additional response data.
    • getCalcTypes

      public org.json.simple.JSONObject getCalcTypes()
      Retrieves the list of available calculation types and returns them as a JSON object.
      Returns:
      A JSON object containing the list of calculation types.
    • getCalcFields

      public org.json.simple.JSONObject getCalcFields(TransMeta transMeta, Map<String,String> queryParams) throws org.pentaho.di.core.exception.KettleStepException
      Retrieves the list of available calculation fields and returns them as a JSON object. This includes both existing calculator fields and fields from previous steps.
      Parameters:
      transMeta - The transformation metadata.
      queryParams - A map of query parameters for the action.
      Returns:
      A JSON object containing the list of calculation fields.
      Throws:
      org.pentaho.di.core.exception.KettleStepException - if there's an error retrieving field information.