Condition 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;
}
}Content copied to clipboard
The SDK runs decide and pushes its result as this task's return value, so execute is never called.