Interface TaskCondition


@ExperimentalApi @Internal public interface TaskCondition
Condition for task. Allows to decide if task should be executed or skipped depending on configuration.
  • Method Details

    • isMet

      boolean isMet(@NotNull @NotNull RuntimeTaskDefinition taskDefinition, @NotNull @NotNull Map<String,String> conditionConfiguration, @NotNull @NotNull CommonContext commonContext)
      Returns:
      true if task should be executed.
    • prepareConfiguration

      @NotNull @NotNull Map<String,String> prepareConfiguration(@NotNull @NotNull ActionParametersMap parametersMap)
      Returns:
      configuration parameters to be stored along with task configuration.
    • prepareParametersMap

      @NotNull @NotNull Map<String,Object> prepareParametersMap(@NotNull @NotNull Map<String,String> configuration, @NotNull @NotNull ActionParametersMap parametersMap)
      Parameters:
      configuration - - condition configuration from TaskDefinition
      parametersMap - - user submitted parameters. Use it to restore configuration in case of validation errors.
      Returns:
      properties to be used for UI presentation of condition configuration.
    • validate

      @Nullable @Nullable ErrorCollection validate(@NotNull @NotNull ActionParametersMap parametersMap)
      Validate user input before saving condition configuration.
    • getDescription

      @NotNull default @NotNull String getDescription(@NotNull @NotNull CommonContext commonContext, @NotNull @NotNull TaskConditionConfig condition)
      Provide condition description to display at UI and build logs.
      Parameters:
      commonContext - execution context
      condition - settings
      Returns:
      human readable condition description.
    • fromYaml

      @Nullable default com.atlassian.bamboo.specs.api.builders.condition.TaskCondition fromYaml(@NotNull @NotNull Node node, @NotNull @NotNull TaskValidationContext validationContext)
      Parse YAML representation of condition.
      Returns:
      Bamboo Specs builder.
    • toYaml

      @Nullable default @Nullable Node toYaml(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.plan.condition.ConditionProperties condition)
      Returns:
      YAML node from condition properties.