Search in sources :

Example 1 with WorkflowConditionNode

use of co.cask.cdap.api.workflow.WorkflowConditionNode in project cdap by caskdata.

the class ApplicationVerificationStage method verifyWorkflowCondition.

private void verifyWorkflowCondition(ApplicationSpecification appSpec, WorkflowSpecification workflowSpec, WorkflowNode node, Set<String> existingNodeNames) {
    WorkflowConditionNode condition = (WorkflowConditionNode) node;
    verifyWorkflowNodeList(appSpec, workflowSpec, condition.getIfBranch(), existingNodeNames);
    verifyWorkflowNodeList(appSpec, workflowSpec, condition.getElseBranch(), existingNodeNames);
}
Also used : WorkflowConditionNode(co.cask.cdap.api.workflow.WorkflowConditionNode)

Example 2 with WorkflowConditionNode

use of co.cask.cdap.api.workflow.WorkflowConditionNode 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(co.cask.cdap.internal.workflow.condition.DefaultConditionSpecification) ConditionSpecification(co.cask.cdap.api.workflow.ConditionSpecification) DefaultConditionSpecification(co.cask.cdap.internal.workflow.condition.DefaultConditionSpecification) WorkflowConditionNode(co.cask.cdap.api.workflow.WorkflowConditionNode)

Example 3 with WorkflowConditionNode

use of co.cask.cdap.api.workflow.WorkflowConditionNode in project cdap by caskdata.

the class DefaultWorkflowForkConfigurer 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(co.cask.cdap.internal.workflow.condition.DefaultConditionSpecification) ConditionSpecification(co.cask.cdap.api.workflow.ConditionSpecification) DefaultConditionSpecification(co.cask.cdap.internal.workflow.condition.DefaultConditionSpecification) WorkflowConditionNode(co.cask.cdap.api.workflow.WorkflowConditionNode)

Example 4 with WorkflowConditionNode

use of co.cask.cdap.api.workflow.WorkflowConditionNode in project cdap by caskdata.

the class DefaultWorkflowConfigurer 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>());
    nodes.add(new WorkflowConditionNode(spec.getName(), spec, ifBranch, elseBranch));
}
Also used : DefaultConditionSpecification(co.cask.cdap.internal.workflow.condition.DefaultConditionSpecification) ConditionSpecification(co.cask.cdap.api.workflow.ConditionSpecification) DefaultConditionSpecification(co.cask.cdap.internal.workflow.condition.DefaultConditionSpecification) WorkflowConditionNode(co.cask.cdap.api.workflow.WorkflowConditionNode)

Example 5 with WorkflowConditionNode

use of co.cask.cdap.api.workflow.WorkflowConditionNode 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(co.cask.cdap.api.workflow.WorkflowNode) WorkflowConditionNode(co.cask.cdap.api.workflow.WorkflowConditionNode) ConditionSpecification(co.cask.cdap.api.workflow.ConditionSpecification) DefaultConditionSpecification(co.cask.cdap.internal.workflow.condition.DefaultConditionSpecification)

Aggregations

WorkflowConditionNode (co.cask.cdap.api.workflow.WorkflowConditionNode)9 ConditionSpecification (co.cask.cdap.api.workflow.ConditionSpecification)7 DefaultConditionSpecification (co.cask.cdap.internal.workflow.condition.DefaultConditionSpecification)7 WorkflowNode (co.cask.cdap.api.workflow.WorkflowNode)2 ScheduleProgramInfo (co.cask.cdap.api.workflow.ScheduleProgramInfo)1 WorkflowActionNode (co.cask.cdap.api.workflow.WorkflowActionNode)1 WorkflowForkNode (co.cask.cdap.api.workflow.WorkflowForkNode)1 WorkflowSpecification (co.cask.cdap.api.workflow.WorkflowSpecification)1