IfConditionActivity Class

public final class IfConditionActivity
extends ControlActivity

This activity evaluates a boolean expression and executes either the activities under the ifTrueActivities property or the ifFalseActivities property depending on the result of the expression.

Constructor Summary

Constructor Description
IfConditionActivity()

Creates an instance of IfConditionActivity class.

Method Summary

Modifier and Type Method and Description
Expression expression()

Get the expression property: An expression that would evaluate to Boolean.

static IfConditionActivity fromJson(JsonReader jsonReader)

Reads an instance of IfConditionActivity from the JsonReader.

List<Activity> ifFalseActivities()

Get the ifFalseActivities property: List of activities to execute if expression is evaluated to false.

List<Activity> ifTrueActivities()

Get the ifTrueActivities property: List of activities to execute if expression is evaluated to true.

JsonWriter toJson(JsonWriter jsonWriter)
String type()

Get the type property: Type of activity.

void validate()

Validates the instance.

IfConditionActivity withDependsOn(List<ActivityDependency> dependsOn)

Set the dependsOn property: Activity depends on condition.

IfConditionActivity withDescription(String description)

Set the description property: Activity description.

IfConditionActivity withExpression(Expression expression)

Set the expression property: An expression that would evaluate to Boolean.

IfConditionActivity withIfFalseActivities(List<Activity> ifFalseActivities)

Set the ifFalseActivities property: List of activities to execute if expression is evaluated to false.

IfConditionActivity withIfTrueActivities(List<Activity> ifTrueActivities)

Set the ifTrueActivities property: List of activities to execute if expression is evaluated to true.

IfConditionActivity withName(String name)

Set the name property: Activity name.

IfConditionActivity withOnInactiveMarkAs(ActivityOnInactiveMarkAs onInactiveMarkAs)

Set the onInactiveMarkAs property: Status result of the activity when the state is set to Inactive.

IfConditionActivity withState(ActivityState state)

Set the state property: Activity state.

IfConditionActivity withUserProperties(List<UserProperty> userProperties)

Set the userProperties property: Activity user properties.

Methods inherited from Activity

Methods inherited from ControlActivity

Methods inherited from java.lang.Object

Constructor Details

IfConditionActivity

public IfConditionActivity()

Creates an instance of IfConditionActivity class.

Method Details

expression

public Expression expression()

Get the expression property: An expression that would evaluate to Boolean. This is used to determine the block of activities (ifTrueActivities or ifFalseActivities) that will be executed.

Returns:

the expression value.

fromJson

public static IfConditionActivity fromJson(JsonReader jsonReader)

Reads an instance of IfConditionActivity from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of IfConditionActivity if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

ifFalseActivities

public List<Activity> ifFalseActivities()

Get the ifFalseActivities property: List of activities to execute if expression is evaluated to false. This is an optional property and if not provided, the activity will exit without any action.

Returns:

the ifFalseActivities value.

ifTrueActivities

public List<Activity> ifTrueActivities()

Get the ifTrueActivities property: List of activities to execute if expression is evaluated to true. This is an optional property and if not provided, the activity will exit without any action.

Returns:

the ifTrueActivities value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

IfConditionActivity.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

type

public String type()

Get the type property: Type of activity.

Overrides:

IfConditionActivity.type()

Returns:

the type value.

validate

public void validate()

Validates the instance.

Overrides:

IfConditionActivity.validate()

withDependsOn

public IfConditionActivity withDependsOn(List<ActivityDependency> dependsOn)

Set the dependsOn property: Activity depends on condition.

Overrides:

IfConditionActivity.withDependsOn(List<ActivityDependency> dependsOn)

Parameters:

dependsOn

withDescription

public IfConditionActivity withDescription(String description)

Set the description property: Activity description.

Overrides:

IfConditionActivity.withDescription(String description)

Parameters:

description

withExpression

public IfConditionActivity withExpression(Expression expression)

Set the expression property: An expression that would evaluate to Boolean. This is used to determine the block of activities (ifTrueActivities or ifFalseActivities) that will be executed.

Parameters:

expression - the expression value to set.

Returns:

the IfConditionActivity object itself.

withIfFalseActivities

public IfConditionActivity withIfFalseActivities(List<Activity> ifFalseActivities)

Set the ifFalseActivities property: List of activities to execute if expression is evaluated to false. This is an optional property and if not provided, the activity will exit without any action.

Parameters:

ifFalseActivities - the ifFalseActivities value to set.

Returns:

the IfConditionActivity object itself.

withIfTrueActivities

public IfConditionActivity withIfTrueActivities(List<Activity> ifTrueActivities)

Set the ifTrueActivities property: List of activities to execute if expression is evaluated to true. This is an optional property and if not provided, the activity will exit without any action.

Parameters:

ifTrueActivities - the ifTrueActivities value to set.

Returns:

the IfConditionActivity object itself.

withName

public IfConditionActivity withName(String name)

Set the name property: Activity name.

Overrides:

IfConditionActivity.withName(String name)

Parameters:

name

withOnInactiveMarkAs

public IfConditionActivity withOnInactiveMarkAs(ActivityOnInactiveMarkAs onInactiveMarkAs)

Set the onInactiveMarkAs property: Status result of the activity when the state is set to Inactive. This is an optional property and if not provided when the activity is inactive, the status will be Succeeded by default.

Overrides:

IfConditionActivity.withOnInactiveMarkAs(ActivityOnInactiveMarkAs onInactiveMarkAs)

Parameters:

onInactiveMarkAs

withState

public IfConditionActivity withState(ActivityState state)

Set the state property: Activity state. This is an optional property and if not provided, the state will be Active by default.

Overrides:

IfConditionActivity.withState(ActivityState state)

Parameters:

state

withUserProperties

public IfConditionActivity withUserProperties(List<UserProperty> userProperties)

Set the userProperties property: Activity user properties.

Overrides:

IfConditionActivity.withUserProperties(List<UserProperty> userProperties)

Parameters:

userProperties

Applies to