Branch

 2 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
TommyT
Veteran Member
Posts: 58
Veteran Member
    I have a situation with about 25 conditions that a flow has to evaluate.  Am I seeing things or can a branch only handle 10 conditions?  Do I need to split into several branch nodes at this point in the flow?
    Shane Jones
    Veteran Member
    Posts: 460
    Veteran Member
      Yep.... Sounds like you will need three branches to go 25 different directions...

      I have not tried it but I would think if you know jscript and you are using the branch to set a variable you might be able to do that in an assign with added script and a case function - but I usually just branch to a branch....

      Shane
      Shane Jones
      Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
      Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
      ** Teach others to fish...
      Woozy
      Veteran Member
      Posts: 709
      Veteran Member
        If you are trying to branch to different places with each option, then you'll have to do multiple branch nodes.  However, if you are just evaluating to do variable assignments (or if this will simplify your branching), then JavaScript is the ticket. 

        I've done something similar using JavaScript Assign nodes using IF-THEN-ELSE stacks rather than CASE (though I'm not sure why I didn't use case instead...).  The only trick is ensuring that the syntax is exactly correct - don't forget the semicolons.

        if (vOption=='1')
        {
             vDestValue='A';
        }
        else if (vOption=='2')
        {
             vDestValue='B';
        }
        else if (vOption=='3')
        {
            vDestValue='C';
        }
        else
        {
            vDestValue='';
        }

        I'd think that a case (actually switch) statement would be better:

        switch(vOption)
        {
            case 1:
                vDestValue='A'
                break;
            case 2:
                vDestValue='B'
                break;
            case 3:
                vDestValue='C'
                break;
            default:
                vDestValue=''
        }

        I hope this helps.  Good Luck!
        Kelly Meade
        J. R. Simplot Company
        Boise, ID