Create a FoodChain-Lab Workflow

Topics

Learn

  • to import a FoodChain-Lab template.
  • to display and configure the delivery network.
  • to visualize the backward and forward trace for a station.
1

image

  • Select Food-Lab and Open DB Gui… in the menu bar to open the database interface.
2

image

  • If you get a message saying the internal database has been created, click OK. If not, the database has obviously been created before.
3

image

  • Download the example file from “FCL_Examples.xlsx”.
  • In the database interface click the Table import button in the upper left corner.
4

image

  • Now, a file dialog will pop up. FoodChain-Lab data templates (*.xlsx files) can be selected here.
  • Navigate to the folder with the file “FCL_Examples.xlsx” which you have downloaded. Select the file in the dialog and press Open.
5

image

  • If errors or warnings occurred during the import process you would see a dialog after the import is finished.
  • As no errors ocurred, there is no such dialog and you can click OK.
6

image

  • In the database interface, you can now have a look at the data you have imported.
  • Close the dialog.
7

image

  • Now we want to create a workflow, that uses the imported data.
  • Right click on LOCAL in the KNIME Explorer and select New KNIME Workflow…
8

image

  • In the dialog you need to give the workflow a name. How about “MyFirstWorkflow”?
  • Click Finish.
9

image

  • The created empty workflow will be shown in the editor in the center. Here you can add nodes to build your workflow.
10

image

  • Now we need FoodChain-Lab nodes. You can find them in the Node Repository on the left. Click on the small arrow on the left of “FoodChain-Lab” to show all FoodChain-Lab nodes.
  • Drag the Supply Chain Reader from the Node Repository into your empty workflow.
11

image

  • We do not need to configure the Supply Chain Reader.
  • Right click on it and select Execute.
12

image

  • The Supply Chain Reader has now read all data from the internal database.
  • Select the Supply Chain Reader in the workflow (so that a rectangle is drawn around it), then double click on the Tracing View node in the Node Repository.
13

image

  • The Tracing View node should show up in the workflow and its three input ports should be automatically connected to the Supply Chain Reader. This is the fastes way to attach one node to another.
14

image

  • Another option would be to drag the Tracing View node from the Node Repository into the editor. Then left click on the upper output port of the Supply Chain Reader (black arrow), keep pressing the left mouse button and drag a line to the first input port of the Tracing View (black arrow directing at the blue Tracing View). Repeat for the second and third connection.
15

image

  • Double click on the Tracing View node to configure it.
  • You can see a network of stations (circles) and deliveries (arrows).
  • In this network of a fictitious foodborne disease outbeak a contaminated product could be found in three supermarkets. We want to mark them as outbreak stations.
16

image

  • To do so, right click somewhere into the empty space and choose Set Selected Stations.
17

image

  • In this dialog you can specify which stations should be selected.
  • Press the button in the red circle to set the Property.
18

image

  • Select “type of business”.
  • Typical types of business are “primary producer”, “supplier” and “manufacturer”, for example.
19

image

  • We only want to select supermarkets, since this is where contaminated products were found.
  • Set Value to “Supermarket” and press OK. You can either click the small dropdown button on the right of the value field and select an entry or you type “Supermarket” into the white value field.
  • Click OK.
20

image

  • Now, three stations are selected (blue circles).
  • Right click somewhere into the empty space and choose Station Selection and Show Properties.

2.
Note: If you accidentally click with the left mouse button, you deselect all selected stations. Please go one step back to select the three supermarkets again.

21

image

  • A window pops up and you see the properties of the three selected supermarkets.
  • Click Set All Weight.
22

image

  • By setting the weight to “1” you mark all supermarkets as outbreak stations. Here, “1” is already selected and you simply need to click OK.
23

image

  • All three supermarkets have a weight of “1” now.
  • Another way to set the weight would be to click directly into one of the cells of the weight column and to type in the weight for each station individually.
  • Click OK.
24

image

  • Left click into the white network area to deselect highlighted stations (and deliveries) and you will see… nothing new.
  • To get the image you see above, open the context menu (right click) and click Set default Highlighting.
25

image

  • Tick the box below Show Legend to display the legend. Here it is shown what the colours and symbols in the graph mean.
  • So, the outbreak stations are red and the common link is yellow. The common link is a station which is connected (via identical ingredient lots or products thereof) with two or more outbreak stations in the same food chain.
26

image

  • To arrange the network in a better way right click in the graph and select Apply Layout and choose a layout, for example Fruchterman-Reingold.
27

image

  • This layout process is not deterministic. That means you will get a different result each time.
  • You can apply the layout again, if you are not satisfied with the current result.
  • You can also apply a layout for certain stations only: Therefore you have to select the stations you want to be layouted and apply the layout again.
28

image

  • You can activate Join Deliveries to simplify the graph. Deliveries with the same supplier and recipient are joined now.
  • This option is especially useful in networks with many deliveries.
29

image

  • Double click on the station marked as “common link”.
  • The dialog shown above will pop up, showing all attributes of the station.
  • Select Observed and click OK.
30

image

  • All stations / deliveries of the forward trace are orange-colored and the ones of the backward trace are shown in purple.
  • We will go into detail on this in the tutorial “Tracing”.