Class ExportAction<T extends Help>

Object
Action
ExportAction<T>
All Implemented Interfaces:
Help

public class ExportAction<T extends Help> extends Action
This action starts exporting or archiving. It's a programmatic version of the same action available in UI. As such it allows user to schedule the action in calculation flow formula.

Obtain it with CalculationFlowActionBuilder.addExportAction(String), then call doExport(String) or doArchive(String) with the label of an export or archiving template from Import / Export / Archiving. The action has no setCalculate() method: it runs when one of these two methods names a template. Each run creates a new export or archiving job with the label passed to addExportAction() and the configuration of the template. If no template has this label, no job starts and the Calculation Flow does not report an error.

Example:


 def date = (new Date()).format("yyyy-MM-dd'T'HH:mm:ss")
 actionBuilder.addExportAction('ArchiveCompetitionData_' + date)
     .doArchive('Template_ArchiveCompetitionData')
 
See Also:
  • Constructor Details

    • ExportAction

      public ExportAction(T backLink, Invocations<MethodInvocationRecord> invocations, String jobName)
      Not intended for public use. An action created with this constructor is not added to the Calculation Flow, so it never runs. Use actionBuilder.addExportAction() instead.
      See Also:
  • Method Details

    • doExport

      public ExportAction<T> doExport(String templateName)
      Notifies system that export for selected template should be started. A later call to doArchive(String) replaces this setting.
      Parameters:
      templateName - template to use: the label of an export template
      Returns:
      this action, for further configuration
    • doArchive

      public ExportAction<T> doArchive(String templateName)
      Notifies system that archiving for selected template should be started. A later call to doExport(String) replaces this setting.
      Parameters:
      templateName - template to use: the label of an archiving template
      Returns:
      this action, for further configuration
    • back

      public T back()
      Returns the builder that added this action, so that the logic can add the next action in the same chain.
      Returns:
      the actionBuilder that added this action
      See Also:
    • getObjectName

      public String getObjectName()
      Not intended for public use.
      Returns:
      the name of the builder that added this action, followed by ".ExportAction"
    • getJobName

      public String getJobName()
      Gets the label of the job that this action creates.
      Returns:
      the label passed to CalculationFlowActionBuilder.addExportAction(String)
    • getTemplateName

      public String getTemplateName()
      Gets the label of the template set with doExport(String) or doArchive(String).
      Returns:
      the label of the template, or null until doExport(String) or doArchive(String) is called
    • isExport

      public Boolean isExport()
      Gets whether this action starts an export.
      Returns:
      true after doExport(String), otherwise false
    • isArchive

      public Boolean isArchive()
      Gets whether this action starts an archiving job.
      Returns:
      true after doArchive(String), otherwise false
    • toString

      public String toString()
      Returns a text representation of this action for debugging.
      Overrides:
      toString in class Object
      Returns:
      a text that contains the job label, the template label and the export and archive flags of this action