Search in sources :

Example 1 with ConditionSpecification

use of io.cdap.cdap.api.workflow.ConditionSpecification in project cdap by caskdata.

the class DefaultWorkflowConfigurer method addWorkflowConditionNode.

@Override
public void addWorkflowConditionNode(Condition condition, List<WorkflowNode> ifBranch, List<WorkflowNode> elseBranch) {
    Preconditions.checkArgument(condition != null, "Condition is null.");
    ConditionSpecification spec = DefaultConditionConfigurer.configureCondition(condition, deployNamespace, artifactId, pluginFinder, pluginInstantiator, runtimeInfo, getFeatureFlagsProvider());
    nodes.add(new WorkflowConditionNode(spec.getName(), spec, ifBranch, elseBranch));
}
Also used : DefaultConditionSpecification(io.cdap.cdap.internal.workflow.condition.DefaultConditionSpecification) ConditionSpecification(io.cdap.cdap.api.workflow.ConditionSpecification) WorkflowConditionNode(io.cdap.cdap.api.workflow.WorkflowConditionNode)

Example 2 with ConditionSpecification

use of io.cdap.cdap.api.workflow.ConditionSpecification in project cdap by caskdata.

the class DefaultWorkflowConfigurer method createConditionNodeWithId.

private WorkflowNode createConditionNodeWithId(WorkflowNode node) {
    WorkflowConditionNode conditionNode = (WorkflowConditionNode) node;
    List<WorkflowNode> ifbranch = Lists.newArrayList();
    List<WorkflowNode> elsebranch = Lists.newArrayList();
    ifbranch.addAll(createNodesWithId(conditionNode.getIfBranch()));
    elsebranch.addAll(createNodesWithId(conditionNode.getElseBranch()));
    ConditionSpecification spec = conditionNode.getConditionSpecification();
    return new WorkflowConditionNode(spec.getName(), spec, ifbranch, elsebranch);
}
Also used : WorkflowNode(io.cdap.cdap.api.workflow.WorkflowNode) WorkflowConditionNode(io.cdap.cdap.api.workflow.WorkflowConditionNode) DefaultConditionSpecification(io.cdap.cdap.internal.workflow.condition.DefaultConditionSpecification) ConditionSpecification(io.cdap.cdap.api.workflow.ConditionSpecification)

Example 3 with ConditionSpecification

use of io.cdap.cdap.api.workflow.ConditionSpecification in project cdap by caskdata.

the class DefaultWorkflowForkConfigurer method addWorkflowConditionNode.

@Override
public void addWorkflowConditionNode(Condition condition, List<WorkflowNode> ifBranch, List<WorkflowNode> elseBranch) {
    Preconditions.checkArgument(condition != null, "Condition is null.");
    ConditionSpecification spec = DefaultConditionConfigurer.configureCondition(condition, deployNamespace, artifactId, pluginFinder, pluginInstantiator, runtimeInfo, featureFlagsProvider);
    currentBranch.add(new WorkflowConditionNode(spec.getName(), spec, ifBranch, elseBranch));
}
Also used : DefaultConditionSpecification(io.cdap.cdap.internal.workflow.condition.DefaultConditionSpecification) ConditionSpecification(io.cdap.cdap.api.workflow.ConditionSpecification) WorkflowConditionNode(io.cdap.cdap.api.workflow.WorkflowConditionNode)

Example 4 with ConditionSpecification

use of io.cdap.cdap.api.workflow.ConditionSpecification in project cdap by caskdata.

the class DefaultWorkflowConditionConfigurer method addWorkflowConditionNode.

@Override
public void addWorkflowConditionNode(Predicate<WorkflowContext> predicate, List<WorkflowNode> ifBranch, List<WorkflowNode> elseBranch) {
    ConditionSpecification spec = new DefaultConditionSpecification(predicate.getClass().getName(), predicate.getClass().getSimpleName(), "", new HashMap<String, String>(), new HashSet<String>());
    currentBranch.add(new WorkflowConditionNode(spec.getName(), spec, ifBranch, elseBranch));
}
Also used : DefaultConditionSpecification(io.cdap.cdap.internal.workflow.condition.DefaultConditionSpecification) DefaultConditionSpecification(io.cdap.cdap.internal.workflow.condition.DefaultConditionSpecification) ConditionSpecification(io.cdap.cdap.api.workflow.ConditionSpecification) WorkflowConditionNode(io.cdap.cdap.api.workflow.WorkflowConditionNode)

Example 5 with ConditionSpecification

use of io.cdap.cdap.api.workflow.ConditionSpecification in project cdap by caskdata.

the class DefaultWorkflowConditionConfigurer method addWorkflowConditionNode.

@Override
public void addWorkflowConditionNode(Condition condition, List<WorkflowNode> ifBranch, List<WorkflowNode> elseBranch) {
    Preconditions.checkArgument(condition != null, "Condition is null.");
    ConditionSpecification spec = DefaultConditionConfigurer.configureCondition(condition, deployNamespace, artifactId, pluginFinder, pluginInstantiator, runtimeInfo, featureFlagsProvider);
    currentBranch.add(new WorkflowConditionNode(spec.getName(), spec, ifBranch, elseBranch));
}
Also used : DefaultConditionSpecification(io.cdap.cdap.internal.workflow.condition.DefaultConditionSpecification) ConditionSpecification(io.cdap.cdap.api.workflow.ConditionSpecification) WorkflowConditionNode(io.cdap.cdap.api.workflow.WorkflowConditionNode)

Aggregations

ConditionSpecification (io.cdap.cdap.api.workflow.ConditionSpecification)7 WorkflowConditionNode (io.cdap.cdap.api.workflow.WorkflowConditionNode)7 DefaultConditionSpecification (io.cdap.cdap.internal.workflow.condition.DefaultConditionSpecification)7 WorkflowNode (io.cdap.cdap.api.workflow.WorkflowNode)1