# Selecting active branch using Case Switch Model node?

**URL:** <https://forum.knime.com/t/selecting-active-branch-using-case-switch-model-node/18475>\
**Category:** KNIME Analytics Platform\
**Created:** [September 27, 2019, 12:45pm UTC](https://forum.knime.com/t/selecting-active-branch-using-case-switch-model-node/18475 "2019-09-27T12:45:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rolivella](https://forum-cdn.knime.com/user_avatar/forum.knime.com/rolivella/32/11637_2.png) [@rolivella](https://forum.knime.com/u/rolivella)\
**Post date:** [September 27, 2019, 12:45pm UTC](https://forum.knime.com/t/selecting-active-branch-using-case-switch-model-node/18475/1 "2019-09-27T12:45:25Z")

</div>

Dear all,

![Screenshot_20190927_143359](https://forum-cdn.knime.com/uploads/default/original/2X/5/58808deef40df70e2364d3c58617047b32d7e6b5.png)

In this workflow is there any way to use the top branch (Input File + PeakPickerHiRes) or the bottom one (only the Input file node) depending on the one that is active? I’ve tried using the Case Switch Model node but without success.

Thank you!

Roger

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [September 30, 2019, 3:48pm UTC](https://forum.knime.com/t/selecting-active-branch-using-case-switch-model-node/18475/2 "2019-09-30T15:48:34Z")

</div>

Hi there,

well you are using Generic Workflow nodes so you might check if that extension contains some node that can help. See [here](https://kni.me/e/7EIJDj9brIglS6cv) list of nodes. Maybe FileMerger can work or FileToTable and then End IF node?

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![armingrudd](https://forum-cdn.knime.com/user_avatar/forum.knime.com/armingrudd/32/84633_2.png) [@armingrudd](https://forum.knime.com/u/armingrudd)\
**Post date:** [September 30, 2019, 8:44pm UTC](https://forum.knime.com/t/selecting-active-branch-using-case-switch-model-node/18475/3 "2019-09-30T20:44:03Z")

</div>

Hi @rolivella and welcome back to the KNIME community forum,

How about a Try/Catch Errors construct with the [Catch Errors (Generic Ports)](https://nodepit.com/node/org.knime.base.node.flowcontrol.trycatch.genericcatch.GenericPortCatchNodeFactory) node?

😊

---

<div class="post-metadata">

**Author:** ![rolivella](https://forum-cdn.knime.com/user_avatar/forum.knime.com/rolivella/32/11637_2.png) [@rolivella](https://forum.knime.com/u/rolivella)\
**Post date:** [October 10, 2019, 2:42pm UTC](https://forum.knime.com/t/selecting-active-branch-using-case-switch-model-node/18475/4 "2019-10-10T14:42:45Z")

</div>

Hi @armingrudd, thank you for your reply and sorry for the late answer, I was out of the office.

I’ve tried your solution but without success. Do you mind if I send you my workflow to see how can I put there a try/catch for controlling the execution branch? Thank you very much.

[module\_workflow\_shotgun\_tfrp\_dev.knwf](https://forum-cdn.knime.com/uploads/default/original/2X/3/39e3403174634aad43a82f59d11b7f6dbd4a3ea9.knwf) (28.5 KB)

With this [data](https://www.dropbox.com/s/1sqoic6kkxbtppx/190215_Q_QC01_01_32_6583a564-93dd-4500-a101-b2fe56496b25_QC01_93d2a97b9d0b35c9668663223bdef998_TRFP_v1.1.10.mzML?dl=0)

---

<div class="post-metadata">

**Author:** ![armingrudd](https://forum-cdn.knime.com/user_avatar/forum.knime.com/armingrudd/32/84633_2.png) [@armingrudd](https://forum.knime.com/u/armingrudd)\
**Post date:** [October 10, 2019, 6:49pm UTC](https://forum.knime.com/t/selecting-active-branch-using-case-switch-model-node/18475/5 "2019-10-10T18:49:52Z")

</div>

You have to put a Try node as well (in the top branch for example).

This way if the top branch executes without any errors then the output of the Catch Errors will be from the top input port. If the top branch fails then the output from the bottom branch will be passed to the rest of the flow.

😊

P.S. Here is an example of using Try/Catch Errors construct:  
[https://blog.statinfer.com/knime-re-executing-failed-nodes/](https://blog.statinfer.com/knime-re-executing-failed-nodes/)

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [October 17, 2019, 6:52pm UTC](https://forum.knime.com/t/selecting-active-branch-using-case-switch-model-node/18475/6 "2019-10-17T18:52:27Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
