Sampo project - Reflex - Examples

Using Python in a workflow

  1. The reflex.py module is needed for running Python scripts in Reflex. This module is located under reflex/reflex-current/scripts/python. For further explanation see Python examples.
  2. To run Python scripts in a workflow, first open Available Services in the Tools and Workflow Launcher -menu. From Local Services/Python Processors/, select Python Processor and add it to the workflow model by right-clicking it and selecting Add to model. This opens a window to select the Python script that the user wants to use in the workflow. The example reflex/reflex-current/examples/pythonExample.xml included in the Reflex kit can be used as a template for the user's own scripts. For further explanations (e.g. the Python script editing window) see Python examples.
  3. After adding the script to the model, the Processor can be accessed by opening Advanced model explorer from Tools and Workflow Launcher -menu. The output- and input-files and their type can be seen in a tree view under the Processor.
  4. To add inputs to the workflow, right-click Workflow inputs and select Create New Input. It will prompt for a name and add it to the model. Finally, it can be added to the workflow by right-clicking the input and selecting the correct input under the Choose an Input -list. Note that the input can also be connected to outputs from other processors. After selection a data link is added to the workflow. It can also be accessed in the explorer.
  5. To add outputs to the workflow, right-click the output-file under the processor and connect it to the correct Workflow outputs. This link is also added to the workflow. Remember to connect the outputs to other processors in the workflow, if applicable.