I have a KNIME workflow that runs processes specific to certain months within a quarter. The workflow is set up to execute twice per quarter as follows:
I already have a variable that represents the current month and current number. I want to create a trigger process where, for example, if the current month is February, only the process specific to February will run, and the rest will be skipped and so on.
What is the best way to set up this trigger mechanism? I have this initial set-up, but I’m not sure how to configure it properly and to connect the process for other flows and so on.
you can use CASE Switch Start node, control it with flow variable and connect proper output port with proper workflow branch. Just need to do mapping of flow variable holding month name/number. If February = 0, March = 1, May = 2…
Thank you for your solution! I’d like to ask a follow-up question regarding the Case Switch Start process. In my workflow, I have two green boxes:
The first box retrieves the data from one of the input ports to determine the month and tags it with the corresponding port number that I assigned per month (as per your suggestion) in the Table Creator. (My problem here is that it has historical files from the previous dump, so there is multiple months but i sort the month in descending order to get the first row as latest month)
I tried connecting the first box to the Case Switch Start node and using the “port” variable generated by the Rule Engine node to control the switch. However, I encountered an error: “Execute failed: Invalid output port ‘6’ specified.”
I believe one cause of the error in the case swtich is because my sort table has multiple port number in the port column (since it has historical months and the table creator tagged ports in specific months), i did try to use row filter to only get the 1st row so that it will only read 1 port value and connect it to the case switch but it has the same case switch error.
not sure about your design and exact data you have in your tables but seems to me you should use variable input/output ports on CASE Switch Start/End nodes. I have created a little example for you so you can check it out. This is workflow design:
You can now change input month in first Table Creator and different Math Formula will execute. (Month covered in Rule Engine are December, January and February.)
Thank you for the clear and detailed example! This really helps me understand how to use the Case Switch Start and End nodes with variable input/output ports.