# Gateways Conditions

In this section gateways evaluation conditions will be described in detail.

When a Split Gateway is in a Process path the BPM Execution Engine will evaluate all possibilities. And it will follow a sub set of all possible path (the sub set depends on the gateway type and the condition).

The conditions are defined inside [Bizagi Modeler](http://www.bizagi.com/en/products/bpm-suite/modeler) ®.

![](https://3974112602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LH4gGgyMb1_fhOg782r%2F-LHA81EoYXunlhnL2S_r%2F-LHA9D9WXxOAFUy3fVB8%2Fgateways-evaluation-01.jpg?alt=media\&token=f76d0307-a5c9-43e4-bce7-d56e66049d14)

The condition **must be** defined as a Block of only one argument. This argument (process)is the BPM Process Instance itself. In the example above one of the conditions is:

```
[:process | process checkResult = 'rejected']
```

Block: \[:process (argumentName) | (pipe) condition]\
\
&#x20;Where:

* process - represent the process instance.
* checkResult - is the name of a process's variable (a field of any forms of the process or a defined variable).
* 'rejected' - is the value to be used in the comparison.

In this case the variable \[checkResult] is a String.

&#x20;Basic Comparators:\
&#x20;"=" - equal\
&#x20;"!=" - not equal\
&#x20;">="- greater than\
&#x20;"<" - less than\
&#x20;">="- greater than or equal\
&#x20;"<=" - less than or equal

Example with all variable types:\
&#x20;**Number**

```
[:process | process documentId = 123456]
```

**Boolean**\
&#x20;In this case the field is defined as Boolean.

```
[:process | process checkPassed]
```

It is also possible to be defined as:

```
[:process | process checkPassed = true]
```

**String**

```
[:process | process checkPassed = 'passed']
```

**Date**

```
[:process | process sunsetDate = (Date fromString: '10/10/2016')]
```

**Time**

```
[:process | process sunsetTime = (Time fromString: '2:50:11 pm')]
```

**TimeStamp**

```
[:process | process sunsetDate = (TimeStamp fromString: '10/10/2016 2:15:36 pm')]
```

The conditions can be combined:

```
[:process | process sunsetDate = (TimeStamp fromString: '10/10/2016 2:15:36 pm') and:[process checkPassed = 'passed']]
```

```
[:process | process sunsetDate = (TimeStamp fromString: '10/10/2016 2:15:36 pm') or:[process checkPassed ~= 'rejected']]
```

The conditions can compare two Process variables:

```
[:process | process sunsetDate >= process extendedDate]
```

### Recomendations <a href="#recomendations" id="recomendations"></a>

The name of the variable should **NOT** have "-" **Hyphen character**.\
&#x20;If it is so then the evaluation condition **must** be defined as follow:

```
[:process | (process perform: 'string-hyphen-variable') = 'passed']
```

The perform sentence (perform:) must be used with the variable name enclosed with single quotes ('string-hyphen-variable').

**Hyphen Minus** "\_" is accepted as it is:

```
[:process | process hyphen_minus_variable = 123456]
```

### Using 'name' as a field name in a condition <a href="#using-name-as-a-field-name-in-a-condition" id="using-name-as-a-field-name-in-a-condition"></a>

If a form has a field named 'name' and is used in a gateway condition then the codition must be defined as:

```
[:proc | (proc getValueOf: 'name') = 'some name']
```

**This rule is mandatory.**

List of names in the same situation:\
&#x20;andContextApplications\
applicationName\
assignedUserNames\
createdTime\
creator\
creatorEvent\
creatorName\
creatorTask\
currentActivities\
definition\
endEvents\
executedActivities\
executedGateways\
executedScripts\
generateProcessMap\
getActiveArtifacts\
getApplication\
getApplicationName\
getContextApplications\
getDefinitionName\
getExecutedArtifacts\
getFinishedProcessMatrix\
getProcessesTreeAsCollection\
getProcessMatrix\
getRunningArtifacts\
getTopProcess\
hasAndContext\
hasContextApplications\
hasFinalized\
hasOrContext\
hasSubprocesses\
id\
inheritContextApplications\
initialize\
isInCorruptedState\
isSubProcess\
isTopProcess\
orContextApplications\
parentProcess\
postExecution\
printAndContext\
printCurrentRols\
printOrContext\
printParentName\
printProcessState\
printRunningArtifacts\
processId\
processName\
runningGateways\
startEvent\
startEventIsAnonymous\
subprocesses\
transitions\
triggerStartEvent\
userAssignments\
version
