CreateRecipe step


The CreateRecipe step allows users to create new recipes dynamically at runtime from the operator view. Recipes created in this way are always cloned from the current recipe.

To set this up, you must add the CreateRecipe step to a subflowchart, binding a button in the operator view to this subflowchart, and then link other elements in the operator view to the following inputs:

  • The Recipe Name input. Sets the name of the new recipe being created.

  • The Generate auto ID input. Sets whether the ID of the new recipe is automatically generated.

  • The Recipe ID input. Sets the ID of the new recipe being created if Generate auto ID is not selected.

  • The Switch to new recipe input. Makes the new recipe the active recipe after it is created. If this input is set to False, the new recipe must be manually loaded using the LoadRecipe step before the user can modify it.

Each recipe in a project must have a unique name and ID before it can be saved. If a user tries to create a recipe at runtime with a name or ID that conflicts with another recipe, an error message will be displayed.

You will need to create additional controls in the operator view that allow the user to make changes to the recipes that they create at runtime (for example, a button that executes a subflowchart containing a Reconfigure step). For more information about creating new recipes at runtime, see the Setting up an operator view to manage recipes section earlier in this chapter.

The new recipe will be cloned from the last saved version of the current recipe. Changes made to a recipe using the Store step or Reconfigure step are only saved when your project terminates properly, or when a SavePersistentData step is executed. In most cases, you should put a SavePersistentData step immediately before a CreateRecipe step to ensure that all modifications made to the previous recipe are saved and cloned. For more information, see the Persistence and the SavePersistentData step section in Chapter 57: Persistence.