ConditionTask

interface ConditionTask : Task

A task whose boolean decides which of two tasks runs; the other is skipped.

Register one with DagDef.If, then name the sides with ConditionRef.Then and ConditionRef.Else:

public class HasRows implements ConditionTask {
@Override
public boolean decide(Context context, Client client) {
return ((Number) client.getXCom("extract")).longValue() > 0;
}
}

The SDK runs decide and pushes its result as this task's return value, so execute is never called.

See also

Functions

Link copied to clipboard
abstract fun decide(context: Context, client: Client): Boolean

Decides which side of the condition runs.

Link copied to clipboard
open override fun execute(context: Context, client: Client)

Never called: the SDK runs a condition through decide.