Skip to content

Rule Engine

The Rules Engine allows you to create a set of rules with conditions when you import data from an ArcGIS Map server that will trigger FieldTwin Actions that you create. FieldTwin will then auto-create your field layout including 3D assets using your set of import rules. You can also import and export your rule set to use it for multiple projects.

Initially the software has support for ArcGIS imports, but other data sources to be added in later releases. This allows you to map and match imported data to FieldTwin data objects & attributes. A typical use case could be to auto create brownfield assets or connections for tie in, slot in considerations etc.

See the following example video explaining this powerful functionality:

You can also go straigth to the tutorial section

ArcGIS Setup

ArcGIS Documentation

Note! Detailed information about the various ArcGIS dialog box settings show below can be found in the WMS/WFS specific sections in the documentation e.g. WMS.

Select the Import drop down menu and then select the Data from ArcGis using rules option.

Alt text

This will display the following dialog box:

Alt text

Click on the Create a new import/Clone an existing import button. This will then display the next dialog box:

Alt text

In this example we will use the free mapping service from the Norwegian Petroleum Directorate (NPD), shown below:

https://factmaps.npd.no/arcgis/rest/services/FactMaps/3_0/MapServer

Input this in the Server URL field, and then we need to Override the Project CRS if not set up already. In this example we will use:

EPSG:23031,ED50/UTM zone 31 N

We will also give it a Name, so the completed dialog entries look like this:

Alt text

Now press Next to continue.

This will display the next ArcGIS dialog, which for this example does not require any input from us:

Alt text

Press Next to continue.

This will then query the ArcGIS map service and bring back a list of all available data layers as shown here:

Alt text

For this example we want the Facilities, in place amd Pipeline layers. Press Next to continue. This is shown in the Tutorial Section

Rules Dialog

After you have connected your ArcGIS server and selected the data layers of interest you will now need to build one or more set of import rules to map the data to be ingested to the FieldTwin equivalent. You do this in the Rules Builder screen:

Alt text

This dialog has the following commands:

Alt text

Remove previously inported records that are not part of the new import - Check this box to discard previous records that are not present of a new import.

+Add - Press this button to create a new ruleset. This will look like this:

Alt text

+Add Child - This will add a new rule (child) under the current ruleset.

Clone - This will create a copy of the current selected rule in the ruleset treeview to the left, but not any child rules.

Clone Tree - Use this to create a copy of the selected ruleset including any child rules.

Export - Press this button to export the set of rules as JSON to your download folder. This file can then be imported and used in another project.

Name - Enter/change the name of your ruleset in the text box.

In the top right corner you will find the Delete commands for the rules as shown here:

Alt text

-Remove - This will remove the currently selected rule.

-Remove tree - This will remove the currently selected rule and any child rules.

Rule Creation

After you have selected to create a new ruleset you will see the following new if condition rule entry appear in the dialog:

Alt text

The leftmost drop down list displays all the selected ArcGIS data layers you have selected in the setup of the import as shown here_

Alt text

We are selecting fclKind from ArcGIS here, and then you need to add the rule logic operator in the next drop down list:

Alt text

These logic operators are self explanatory so they are not detailed here. We select equal so the rule so far is as follows. If "fclKind" equal. We then need to select the last type from the map service:

Alt text

The right most drop down list then displays all the map service "fclKind" data entries. We select the Multi Well Template from here. This means we have created the following rule:

If "fclKind" equal "Multi Well Template"

Alt text

Delete - Click on the red Trashcan icon to the right of the rule to delete it.

The next step is to create a corresponding FieldTwin Action for this rule.

Action Creation

For a rule to have any meaning you have to create an action to be excuted when the rule conditions are met.

+Add Action - Press this button to create your action for the rule above.

Alt text

This will then display a list of the available FieldTwin Actions that can be executed:

Alt text

Note! Based on your rule you will only by able to select meaningful actions based on the ingested map data so some entries will be non selectable.

The available Actions are as follows:

FieldTwin Action Description
Create or update connection This will create or update a connection in the Viewport
Set name from attribute Paste selection at mouse location
Set connection type This will allow you to specify the connection type e.g. oil
Create or update stagedAsset This will create or update a stagedAsset in the Viewport
Create or update well This will create or update a well in the Viewport
Set Well type This will allow you to specify the type of well
Set Well radius This will allow you to set a numeric value for the Well radius
Set asset Allows you to specify assets as part of the import process
Map attributes to metadata Allows you to assign map service attributes to FT Metadat e.g. Inner Diameter
Set tags Allows you to specify tags as part of the import process

We will select the Action called Create or update stagedAsset:

Alt text

Note! Depending on the action selected the follow on parameters/selection might vary:

Map name to - Here you select a name attribute from the map service, which will then name the asset.

Asset - This will display a drop down asset list of your FieldTwin assets from the asset library. Select the one you want to use for the selected action.

Your first ruleset is now complete, and you can execute the rule by pressing Next.

Tutorial

After you have connected your ArcGIS server and selected the data layers of interest you will now need to build one or more set of import rules to map the data to be ingested to the FieldTwin equivalent. You do this in the Rules Builder screen:

Alt text

Add - Press this button to create a new ruleset.

Name - Enter the name of your ruleset.

+Add Rule - Press this button to create your first rule for this ruleset.

Alt text

In the example we select the fclKind type from the Map Service entity drop down list and set the operator to equal and then select Multi Well Template from the list of fclKind entities returned from the Map Service.

+Add Action - Click this button to create a corresponding action to the newly created Import rule.

Alt text

Here we selected Create or update stagedAsset and map the name of the asset to the fclName map service attribute, and select a Template 4 slot to be created in FieldTwin.

We will then add a new rule for importing pipelines. Same principle as the example above, but with the following set up:

Alt text

For the Pipeline rule set we use pplMedium type from the Map Service entity drop down list and set the operator to equal and then select Oil from the list of pplMedium entities returned from the Map Service.

Then we create a corresponding Action, which is Create or update connection and map the name of the pipeline to the pplMapLabel map service attribute, and select a Type of Oil Production* to be created in FieldTwin.

You are now ready to execute your first ruleset. Do this by pressing Next. This will then read out all the requested data from the map server based on the rules, and create the corresponding FieldTwin entities and attributes based on the defined actions. After processing you will see the imported data in FieldTwin as shown here:

Alt text

Sample Rules

This sections shows some illustrations on varius rules and corresponding actions that you might find useful:

Pipeline & Metadata example

This rule and action will create or update a connection in FieldTwin of type oil production with the name. In addition we map the pipeline dimension to the standard FieldTwin Metadata schema for inner diameter:

Alt text

XMT shallow water example

This rule and action will create or update a staged asset in FieldTwin of type XMT Shallow Water if the water depth is less than 200 m.

Alt text