FailActivity Class

public final class FailActivity
extends ControlActivity

This activity will fail within its own scope and output a custom error message and error code. The error message and code can provided either as a string literal or as an expression that can be evaluated to a string at runtime. The activity scope can be the whole pipeline or a control activity (e.g. foreach, switch, until), if the fail activity is contained in it.

Constructor Summary

Constructor Description
FailActivity()

Creates an instance of FailActivity class.

Method Summary

Modifier and Type Method and Description
Object errorCode()

Get the errorCode property: The error code that categorizes the error type of the Fail activity.

static FailActivity fromJson(JsonReader jsonReader)

Reads an instance of FailActivity from the JsonReader.

Object message()

Get the message property: The error message that surfaced in the Fail activity.

JsonWriter toJson(JsonWriter jsonWriter)
String type()

Get the type property: Type of activity.

void validate()

Validates the instance.

FailActivity withDependsOn(List<ActivityDependency> dependsOn)

Set the dependsOn property: Activity depends on condition.

FailActivity withDescription(String description)

Set the description property: Activity description.

FailActivity withErrorCode(Object errorCode)

Set the errorCode property: The error code that categorizes the error type of the Fail activity.

FailActivity withMessage(Object message)

Set the message property: The error message that surfaced in the Fail activity.

FailActivity withName(String name)

Set the name property: Activity name.

FailActivity withOnInactiveMarkAs(ActivityOnInactiveMarkAs onInactiveMarkAs)

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

FailActivity withState(ActivityState state)

Set the state property: Activity state.

FailActivity 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

FailActivity

public FailActivity()

Creates an instance of FailActivity class.

Method Details

errorCode

public Object errorCode()

Get the errorCode property: The error code that categorizes the error type of the Fail activity. It can be dynamic content that's evaluated to a non empty/blank string at runtime. Type: string (or Expression with resultType string).

Returns:

the errorCode value.

fromJson

public static FailActivity fromJson(JsonReader jsonReader)

Reads an instance of FailActivity from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

message

public Object message()

Get the message property: The error message that surfaced in the Fail activity. It can be dynamic content that's evaluated to a non empty/blank string at runtime. Type: string (or Expression with resultType string).

Returns:

the message value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

FailActivity.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

type

public String type()

Get the type property: Type of activity.

Overrides:

FailActivity.type()

Returns:

the type value.

validate

public void validate()

Validates the instance.

Overrides:

FailActivity.validate()

withDependsOn

public FailActivity withDependsOn(List<ActivityDependency> dependsOn)

Set the dependsOn property: Activity depends on condition.

Overrides:

FailActivity.withDependsOn(List<ActivityDependency> dependsOn)

Parameters:

dependsOn

withDescription

public FailActivity withDescription(String description)

Set the description property: Activity description.

Overrides:

FailActivity.withDescription(String description)

Parameters:

description

withErrorCode

public FailActivity withErrorCode(Object errorCode)

Set the errorCode property: The error code that categorizes the error type of the Fail activity. It can be dynamic content that's evaluated to a non empty/blank string at runtime. Type: string (or Expression with resultType string).

Parameters:

errorCode - the errorCode value to set.

Returns:

the FailActivity object itself.

withMessage

public FailActivity withMessage(Object message)

Set the message property: The error message that surfaced in the Fail activity. It can be dynamic content that's evaluated to a non empty/blank string at runtime. Type: string (or Expression with resultType string).

Parameters:

message - the message value to set.

Returns:

the FailActivity object itself.

withName

public FailActivity withName(String name)

Set the name property: Activity name.

Overrides:

FailActivity.withName(String name)

Parameters:

name

withOnInactiveMarkAs

public FailActivity 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:

FailActivity.withOnInactiveMarkAs(ActivityOnInactiveMarkAs onInactiveMarkAs)

Parameters:

onInactiveMarkAs

withState

public FailActivity 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:

FailActivity.withState(ActivityState state)

Parameters:

state

withUserProperties

public FailActivity withUserProperties(List<UserProperty> userProperties)

Set the userProperties property: Activity user properties.

Overrides:

FailActivity.withUserProperties(List<UserProperty> userProperties)

Parameters:

userProperties

Applies to