SwitchActivity Class

public class SwitchActivity
extends ControlActivity

This activity evaluates an expression and executes activities under the cases property that correspond to the expression evaluation expected in the equals property.

Constructor Summary

Constructor Description
SwitchActivity()

Creates an instance of SwitchActivity class.

Method Summary

Modifier and Type Method and Description
static SwitchActivity fromJson(JsonReader jsonReader)

Reads an instance of SwitchActivity from the JsonReader.

List<SwitchCase> getCases()

Get the cases property: List of cases that correspond to expected values of the 'on' property.

List<Activity> getDefaultActivities()

Get the defaultActivities property: List of activities to execute if no case condition is satisfied.

Expression getOn()

Get the on property: An expression that would evaluate to a string or integer.

String getType()

Get the type property: Type of activity.

SwitchActivity setCases(List<SwitchCase> cases)

Set the cases property: List of cases that correspond to expected values of the 'on' property.

SwitchActivity setDefaultActivities(List<Activity> defaultActivities)

Set the defaultActivities property: List of activities to execute if no case condition is satisfied.

SwitchActivity setDependsOn(List<ActivityDependency> dependsOn)

Set the dependsOn property: Activity depends on condition.

SwitchActivity setDescription(String description)

Set the description property: Activity description.

SwitchActivity setName(String name)

Set the name property: Activity name.

SwitchActivity setOn(Expression on)

Set the on property: An expression that would evaluate to a string or integer.

SwitchActivity setOnInactiveMarkAs(ActivityOnInactiveMarkAs onInactiveMarkAs)

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

SwitchActivity setState(ActivityState state)

Set the state property: Activity state.

SwitchActivity setUserProperties(List<UserProperty> userProperties)

Set the userProperties property: Activity user properties.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from Activity

Methods inherited from ControlActivity

Methods inherited from java.lang.Object

Constructor Details

SwitchActivity

public SwitchActivity()

Creates an instance of SwitchActivity class.

Method Details

fromJson

public static SwitchActivity fromJson(JsonReader jsonReader)

Reads an instance of SwitchActivity from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of SwitchActivity 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.

getCases

public List<SwitchCase> getCases()

Get the cases property: List of cases that correspond to expected values of the 'on' property. This is an optional property and if not provided, the activity will execute activities provided in defaultActivities.

Returns:

the cases value.

getDefaultActivities

public List<Activity> getDefaultActivities()

Get the defaultActivities property: List of activities to execute if no case condition is satisfied. This is an optional property and if not provided, the activity will exit without any action.

Returns:

the defaultActivities value.

getOn

public Expression getOn()

Get the on property: An expression that would evaluate to a string or integer. This is used to determine the block of activities in cases that will be executed.

Returns:

the on value.

getType

public String getType()

Get the type property: Type of activity.

Overrides:

SwitchActivity.getType()

Returns:

the type value.

setCases

public SwitchActivity setCases(List<SwitchCase> cases)

Set the cases property: List of cases that correspond to expected values of the 'on' property. This is an optional property and if not provided, the activity will execute activities provided in defaultActivities.

Parameters:

cases - the cases value to set.

Returns:

the SwitchActivity object itself.

setDefaultActivities

public SwitchActivity setDefaultActivities(List<Activity> defaultActivities)

Set the defaultActivities property: List of activities to execute if no case condition is satisfied. This is an optional property and if not provided, the activity will exit without any action.

Parameters:

defaultActivities - the defaultActivities value to set.

Returns:

the SwitchActivity object itself.

setDependsOn

public SwitchActivity setDependsOn(List<ActivityDependency> dependsOn)

Set the dependsOn property: Activity depends on condition.

Overrides:

SwitchActivity.setDependsOn(List<ActivityDependency> dependsOn)

Parameters:

dependsOn

setDescription

public SwitchActivity setDescription(String description)

Set the description property: Activity description.

Overrides:

SwitchActivity.setDescription(String description)

Parameters:

description

setName

public SwitchActivity setName(String name)

Set the name property: Activity name.

Overrides:

SwitchActivity.setName(String name)

Parameters:

name

setOn

public SwitchActivity setOn(Expression on)

Set the on property: An expression that would evaluate to a string or integer. This is used to determine the block of activities in cases that will be executed.

Parameters:

on - the on value to set.

Returns:

the SwitchActivity object itself.

setOnInactiveMarkAs

public SwitchActivity setOnInactiveMarkAs(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:

SwitchActivity.setOnInactiveMarkAs(ActivityOnInactiveMarkAs onInactiveMarkAs)

Parameters:

onInactiveMarkAs

setState

public SwitchActivity setState(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:

SwitchActivity.setState(ActivityState state)

Parameters:

state

setUserProperties

public SwitchActivity setUserProperties(List<UserProperty> userProperties)

Set the userProperties property: Activity user properties.

Overrides:

SwitchActivity.setUserProperties(List<UserProperty> userProperties)

Parameters:

userProperties

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

SwitchActivity.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to