Interface TaskCondition
-
@ExperimentalApi @Internal public interface TaskCondition
Condition for task. Allows to decide if task should be executed or skipped depending on configuration.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default com.atlassian.bamboo.specs.api.builders.condition.TaskCondition
fromYaml(@NotNull Node node, @NotNull TaskValidationContext validationContext)
Parse YAML representation of condition.default @NotNull String
getDescription(@NotNull CommonContext commonContext, @NotNull TaskConditionConfig condition)
Provide condition description to display at UI and build logs.boolean
isMet(@NotNull RuntimeTaskDefinition taskDefinition, @NotNull Map<String,String> conditionConfiguration, @NotNull CommonContext commonContext)
@NotNull Map<String,String>
prepareConfiguration(@NotNull ActionParametersMap parametersMap)
@NotNull Map<String,Object>
prepareParametersMap(@NotNull Map<String,String> configuration, @NotNull ActionParametersMap parametersMap)
default @Nullable Node
toYaml(@NotNull com.atlassian.bamboo.specs.api.model.plan.condition.ConditionProperties condition)
@Nullable ErrorCollection
validate(@NotNull ActionParametersMap parametersMap)
Validate user input before saving condition configuration.
-
-
-
Method Detail
-
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 TaskDefinitionparametersMap
- - 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 contextcondition
- 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.
-
-