private void addNodesSF(Collection<MPPOrderNode> list,int PP_Order_Node_ID,int AD_Client_ID){
  final MPPOrderNode node=getNode(PP_Order_Node_ID,AD_Client_ID);
  if (node != null) {
    if (!list.contains(node)) {
      list.add(node);
    }
    ArrayList<Integer> nextNodes=new ArrayList<Integer>();
    for (    MPPOrderNodeNext next : node.getTransitions(AD_Client_ID)) {
      final MPPOrderNode child=getNode(next.getPP_Order_Next_ID(),AD_Client_ID);
      if (child != null) {
        if (!list.contains(child)) {
          list.add(child);
          nextNodes.add(next.getPP_Order_Next_ID());
        }
 else {
          log.saveError("Error","Cyclic transition found - " + node + " -> "+ child);
        }
      }
    }
    for (    int pp_Order_Next_ID : nextNodes) {
      addNodesSF(list,pp_Order_Next_ID,AD_Client_ID);
    }
  }
}

private void addNodesSF ( Collection < MPPOrderNode > list , int PP_Order_Node_ID , int AD_Client_ID ) { final MPPOrderNode node = getNode ( PP_Order_Node_ID , AD_Client_ID ) ; if ( node != null ) { if ( ! list . contains ( node ) ) { list . add ( node ) ; } ArrayList < Integer > nextNodes = new ArrayList < Integer > ( ) ; for ( MPPOrderNodeNext next : node . getTransitions ( AD_Client_ID ) ) { final MPPOrderNode child = getNode ( next . getPP_Order_Next_ID ( ) , AD_Client_ID ) ; if ( child != null ) { if ( ! list . contains ( child ) ) { list . add ( child ) ; nextNodes . add ( next . getPP_Order_Next_ID ( ) ) ; } else { log . saveError ( "Error" , "Cyclic transition found - " + node + " -> " + child ) ; } } } for ( int pp_Order_Next_ID : nextNodes ) { addNodesSF ( list , pp_Order_Next_ID , AD_Client_ID ) ; } } }
add nodes recursively ( sibling first ) to ordered list
