## Simulated rules and conditions

Rules, or conditions, can be set up for a given event's interaction in order to govern its actions' execution. Using conditions one can split and organize the execution of an interaction into different 'conditional blocks' and decide when to perform one action or another. An interaction splitted into 'conditional blocks' would look like the following example in the Events panel:

There are two different types of conditions that can be defined with Justinmind Prototyper:

- User decision: The interaction of the user is needed when the event is triggered to decide what actions to execute.

- Automatic evaluated condition: The condition is an expression that can be evaluated automatically once the event is triggered.

#### Creating a user decision

To define a decision for a specific interaction that has already been created follow the steps:

1. Click on the widget that has the event defined on the canvas. Its events will display on the Events panel.

2. Click on the 'Add condition' link above the actions you want to make conditional. The Expression Builder dialog will appear.

3. Construct an expression with only a text string which will define the decision (eg: "Does the user exist?").

4. Press Ok to create the decision. Select Cancel to close the dialog without applying changes.

When simulating a user decision it will appear as a Yes/No decision box. If the user selects yes the corresponding actions will be executed otherwise they will be ignored.

#### Creating an automatic condition

To define an automatic condition for a specific interaction that has already been created follow the steps:

1. Click on the widget that has the event defined on the canvas. Its events will display on the Events panel.

2. Click on the 'Add condition' link above the actions you want to make conditional. The Expression Builder dialog will appear.

3. Build a comparative expression using prototype's elements and functions (eg: Input_1 = "abc").

4. Press Ok to create the condition. Select Cancel to close the dialog without applying changes.

One can also define a decision or condition for an action when defining it. To create it click on the 'Add condition' button in the Interactions dialog.