HubEngine: Conditions

You can control your synchronisation precisely using conditions. Conditions determine whether a data set is synchronised at all (both for create and update). You can configure conditions in a number of ways with different field types and nested structures. This way you can easily realise complex synchronisation conditions.

To set conditions in your plan, navigate to the Connection tab. If you use a bidirectional plan, select the corresponding synchronisation direction. You will see the mapped fields and below them is the configuration area for the conditions, directly below the actions.

To add a condition, click on the Add Rule button.

The HubEngine allows you to set conditions for a synchronization plan to be executed.
The HubEngine allows you to set conditions for a synchronization plan to be executed.

For each term (left and right side) the following fields then pop up (see picture below): Type, Value.

For Type you can select the following field types:

Type What will happen? Input
String Writes your text into the field. Text Input
Null Sets the field to “no value”. No further input necessary.
Boolean sets the field to True or False. Set the switch to the value you need.
Integer Sets the field to a whole number. Needs numeric input.
Input Feld Copies the value of the chosen input field. Select an input field from the list.
Output Feld Copies the value of the produced output field. Select an output field from the list.
Field after action Accesses values that are only available after applied actions. Select a field from the list.
Fixed Date/Time Writes a specific date and time into the field. Choose “Date only”, if you do not need the time value.
Relative Datetime Calculates a date and time based on an anchor (Now, Input/Output Field). Create your desired datetime with use of the e.g. Offset. “Calculated” shows you the calculated time.

It is best to always select Field on the left side.

HubEngine Conditions Value Types
Conditions Types

Here you decide whether you want to select a field in the system from which you synchronise (Input Field) or into which you synchronise (Output Field).

If you want to access values that are only available after mapping the field options, select Field after action.

For all three options you get a easy to use field selector to choose the corect field for the selected system.

Otherwise you enter the value of the selected type in the input field. Between the terms you can select the logical operation. The screenshot shows the operation Equals.

Logical Operators

The following operators are available:

  • Equals
  • Not Equals
  • Less Than
  • Greater Than
  • Begins With
  • Begins Not With
  • Ends With
  • Ends Not With
  • Contains
  • Contains Not
  • Regex
  • Is Empty
  • Is Not Empty
  • On Create
  • On Update

In our example below, this means that the field sync must have the value 1 in the system we are synchronising from in order for the record to be synchronised at all.

Configure the condition: Choose which side for the condition field is considered (input vs. output) and its name (left column). Then choose the data type you want to set and its value in the right column.
Configure the condition: Choose which side for the condition field is considered (input vs. output) and its name (left column). Then choose the data type you want to set and its value in the right column.

Of course, you can also combine and chain several conditions. To do so, simply click on the Add Rule button again.

We have extended the condition so that the field external_id must be not equal to “null“. The two conditions are linked with a logical AND (logical operators). This means that both conditions must be true for synchronisation to be executed.

You can freely chain and combine conditions for a synchronization plan in the HubEngine.
You can freely chain and combine conditions for a synchronization plan in the HubEngine.

Now we want to realise a more complex condition. To do this, we delete the second condition, as we nest it with another one. We now model a nested condition. Nested conditions are also often represented with brackets. To add brackets, we click on the button Add Group.

We want to model the following synchronisation condition (in different notations):

(deleted == 0) & (external_id == null | external_id == 0)
(deleted == 0) AND (external_id == null OR external_id == 0)
deleted is equal to zero and either external_id is null or is equal to zero

The HubEngine allows you set unlimited nested conditions for a synchronization plan to be executed.
The HubEngine allows you set unlimited nested conditions for a synchronization plan to be executed.

The first group contains the condition of the sync field and the second group contains the two conditions, each with the external_id field. The logical or refers to within the second group. The logical and refers to between both groups.

Both the first term (first bracket) and the second term (second bracket) must apply.

With the arrow next to the AND/OR its possibile to show more common logical operators.

Its possible to add notes to complexe conditions by clicking the description field.

If you need help or advice setting up your conditions, just contact us. We will be happy to help you!

Marini Systems GmbH | Website | Privacy Statement | Legal