Interface StepProcessorContext


public interface StepProcessorContext
Context for the main processing logic of the custom step.
Since:
2.0.0
  • Method Details

    • getInputContext

      Optional<ProcessorInputContext> getInputContext(String inputId)
      Returns the input context of the custom step. Input context returned is based on the input ID specified.
      Parameters:
      inputId - ID of input associated with input context
      Returns:
      ProcessorInputContext associated with input ID
    • progressChanged

      void progressChanged(double progressPercent)
      Update the step execution's progress bar percentage. This method must not used inside OutputColumnManager.onValue(String, LongFunction) and OutputColumnManager.onValue(String, BiFunction)
      Parameters:
      progressPercent - progress percentage. Valid value is between 0.0 to 1.0, e.g. 0.1 is 10%, 0.5 is 50%.
    • progressChanged

      void progressChanged(String message, double progressPercent)
      Update the step execution's progress bar percentage with additional message. This method must not used inside OutputColumnManager.onValue(String, LongFunction) and OutputColumnManager.onValue(String, BiFunction)
      Parameters:
      message - progress message.
      progressPercent - progress percentage. Valid value is between 0.0 to 1.0, e.g. 0.1 is 10%, 0.5 is 50%.
    • getStepPropertyValue

      <T> Optional<T> getStepPropertyValue(String stepPropertyId)
      Returns the step property value based on the step property ID specified.
      Type Parameters:
      T - Type of the step property value
      Parameters:
      stepPropertyId - ID of step property
      Returns:
      Step property value
    • getCacheManager

      StepCacheManager getCacheManager()
      Returns the cache manager for the custom step.
      Returns:
      StepCacheManager for the custom step
    • getCacheConfigurationBuilder

      StepCacheConfigurationBuilder getCacheConfigurationBuilder()
      Returns the cache configuration builder for the custom step.
      Returns:
      StepCacheConfigurationBuilder for the custom step
    • getResource

      <T> Optional<T> getResource(String resourceId, Class<T> resourceClass)
      Returns the resource to be used by the custom step.

      Resources refer to any shared resources that can be created and used throughout processing. The resource should be closed after processing.

      Type Parameters:
      T - Type of step resource
      Parameters:
      resourceId - ID of resource to be returned
      resourceClass - Class of the step resource
      Returns:
      Step resource with specified ID
    • getStepSettingFieldValueAsString

      Optional<String> getStepSettingFieldValueAsString(String stepSettingFieldId)
      Returns the step setting field value as a string based on the step setting field ID specified.
      Parameters:
      stepSettingFieldId - ID of the step setting field to be returned
      Returns:
      String value of the step setting field
    • isInteractive

      boolean isInteractive()
      Interactive is a flag that set to `true` when the user views the output of a step on the Data Studio Grid (UI). In interactive mode, the evaluator of OutputColumnManager.onValue(String, LongFunction) will only be executed when the cell is visible. It is set to `false` when running the whole workflow as a Job.
      Returns:
      true if the execution is interactive, otherwise false
    • getColumnFromChooserValues

      List<InputColumn> getColumnFromChooserValues(String columnChooserId)
      Convenience method to returns the columns selected by the user. It will returns empty list if the column chooser is invalid or the step property is not a column chooser.
      Parameters:
      columnChooserId - the column chooser's step property ID
      Returns:
      the list of selected InputColumn
    • getIndexRowValues

      List<CellValue> getIndexRowValues(String indexName, int rowIndex)
      Method to return the index row values
      Parameters:
      indexName - Index name
      rowIndex - The specified row of the index
      Returns:
      The list of CellValue at the specified row of the index