Workflow Editor

Updated on

July 28, 2022

In this VR Builder tutorial, you will learn how to use the Workflow Editor, a graphical user interface of VR Builder, to define processes for your VR application in Unity. In detail, you will learn how to work with steps, transitions, and chapters in the Workflow Editor.

  1. Setting up the Unity project
  2. Basic elements of the workflow editor
  3. Steps
  4. Transitions
  5. Chapters
  6. Next Steps

Setting up the Unity project for working with the VR Builder Workflow Editor

Before getting started, you need to set up the scene for using VR Builder. Please refer to the VR Builder setup guide for additional help. For this tutorial, we will use an empty Unity scene.

Setting the layout for the Workflow Editor

After setup, the Workflow Editor automatically appears in a new window and displays an empty process. It contains a single chapter Chapter 1 and only the Start node. Every chapter has its own Start node. The Start node defines where the process begins for each chapter.

We recommend adding it to a wide area on the bottom, for instance, together with the Unity tabs Project and Console:

n case you closed the Workflow Editor and want to open it again, you can find the option to Open Workflow Editor from the VR Builder tab in Tools.

Changing the active process

It is also possible to create several VR Builder processes in a single Unity project. However, every scene should only use one of them. You can select the process for a given scene by selecting the Game Object [PROCESS_CONFIGURATION] in the Hierarchy and choosing the Selected Process in the Runtime Configurator (Script) in the Unity Inspector.

Basic elements of the Workflow Editor

A process is described by a sequence of steps. Steps are connected with each other via transitions. A step can also have several transitions entering or exiting. This allows processes to be non-linear, as illustrated by the following example from the VR Builder demo scene.

You can structure your process with chapters. There is no technical necessity to use chapters but they can help you keep the overview over the process. Before going into detail about each of these topics, please note that the Workflow Editor supports undo and redo for all following functions. You can either click on Edit->Undo / Edit->Redo in Unity's menu bar or use the hot keys Ctrl+Z and Ctrl+Y.

Steps

Adding a step

To add a new step, right-click somewhere in the empty area of the Workflow Editor and select Add step from the flyout.

Note that another tab - the Step Inspector - will appear directly after a step is selected. The Step Inspector is covered in the next tutorial. For now, you don't need to worry about it, so you can just move it somewhere, where it does not bother you.

Deleting a step

To delete a step, right-click on the step and select Delete. You can also press the delete key on your keyboard.

Cutting, copying and pasting steps

In the same context menu, you also have the options to copy and cut the selected step. Alternatively, the hot keys Ctrl+C and Ctrl+X work as well. To paste a step, right-click in an empty area where you want to paste the step, then select Paste step.

By using the hotkey Ctrl+V, you will paste the cached step. It is even possible to paste a step into a text editor, in which case you will see the technical representation of the step. This might be a helpful gimmick for developers for debugging or hacking purposes.

Rearranging steps

To rearrange a step, left-click on it and drag it to the desired position, then release. Transitions are automatically positioned and updated while rearranging, so you don't need to worry about them.

Transitions

Transitions connect steps with one another. They always exit one step and usually lead to another step. If no consecutive step is selected, this transition will lead to the end of the chapter and in case this is the last chapter, the end of the whole process. If a consecutive step is selected, it will be entered when this transition is triggered. A transition is automatically triggered as soon as all its conditions are fulfilled. In a later section, you will learn more on how to define conditions for transitions as well and how they can be fulfilled.

For now, let's dig deeper into working with transitions and their connections.

Adding a transition

To add a transition, click on the + icon on the bottom right of the step where you want to add the transition. This transition can exit the step and be connected to a consecutive step.

Deleting a transition

To delete a transition, left-click on the trash icon next to the transition you want to delete. Since there has to be at least one transition for every step, the last transition will not disappear when deleted, but it will be emptied and the connection will be removed.

Setting a transition's connection

To set a transition's connection, drag'n'drop a connection with a left click from an exit node to the entry node of a step or the step itself:

Removing a transition's connection

To remove a transition's connection, right-click on the connection line and select Delete.

Changing a transition's connection

To change a transition's connection, you can simply create a new one. The existing one will be removed since only one connection per transition is possible. To model alternative paths exiting a step, use several transitions with one connection each.

Bulk selecting several steps and bulk operations

It is also possible to operate on several steps and transitions at the same time. To do so, first select everything you want to work on by drag-selecting them. You can add additional and remove selected elements by pressing Ctrl and clicking on or drag-selecting them. 

Then, you can use all the operations you learned in this tutorial to be applied to all of them at once.

Chapters

Chapters can be used to structure complex processes. As every chapter has its own, separate graph, splitting up your process into several chapters makes it possible to keep clarity when creating complex processes. In the next subsection we will share best practices on working with chapters.

Best practices on how to use chapters

We recommend creating one chapter for each self-contained topic, as well as the introduction and the outro. An example for using chapters to structure the workflow can be found in the cockpit training demo scene provided with the Interhaptics integration for VR Builder.

In this example, there are three main tasks: Preparation, which in this case refers to building up pressure, starting the right engine, and then repeating the steps for the left engine. By defining the chapters first, then the process, and finally the steps, we were able to reuse a lot of the Start engine chapters.

It is best to create the chapter structure early on since splitting a chapter in two involves a lot of manual work.

Changing the order of chapters

Next to the chapter, you find four icons. The first two are the up and down arrows. By clicking on them, you can move this chapter up and down one slot.

Note that chapters always follow a linear order. So, at the end of the first chapter, the second one automatically starts. At the end of the second chapter, the third one starts, and so on.

Adding, deleting, renaming chapters

Next to the arrow icons, you have a trash bin icon for deleting the chapter and an edit icon which allows you to rename it. You can add new chapters by clicking on the + Add Chapter button on the bottom of the chapter list.

Next steps

In this VR Builder tutorial you have learned how to define a process, but you still have to define each individual step. Learn how to define steps with the Step Inspector!

Helpful links

Download Vr Builder