Quadri

 View Only

Automation 

08-31-2022 00:29

Automation

Use this procedure to create a new Automation task.

Click the Automation tool.

Find it here:


 

Rule files

The Automation tool store files with a set of rules. The files are called ruleset files.



Automation needs to know where to store the ruleset files. Go to the main settings in the application and go to the environment to inspect that setting.



What does this tool do

The tool help the user with 2 main things:
   - Create rules that the application could run.
   - Run the rules.

With this tool you can define rules by use of a graphical editor. The principle of the rules is to do a query and then do an action on the result of the query.

There is 2 types of query:
   - What - find features and do one or more actions with those features.
   - Where - find sections in a road or railway network and do one or more actions with those sections.



The tool



Select data
This section should be used if you are going to run some rules. If you are only going to define rules with this task, you do not have to use this section.

You define which part of the model you are going to run the rules.

It is 3 steps in this section:
   - Select which type of selection to use.
   - If you have defined dynamic query in the first, you will be able to open the dynamic query dialog in the second step.
   - The last step is to define if the selection should include historical data.




Rule set

In the dropdown, you will find all your Ruleset files. You select one ruleset file or make a new one. You could select one rule in the ruleset and edit it or you could make new ruleset files.


The Graphical Editor
The graphical editor is an important part of this tool where you define the content of a rule. It will start when you select the Edit rule or New rule functions in the menu.


Run

In this part of the tool, you will select one or more rules to run. Use the Select rule icon to start an editor where you define what to run. What you have selected will show up in the list.
Click on run rules to run the rules in the list. The rules that are running, will run on the selected data that you selected in the start of this tool.


Undo

This undo function only works on the model. It will not revert anything in the ruleset files.
When you are running the automation rules, you could change features. The changes these rules have been doing, could be reverted with the undo function.

Finish / Cancel
When you click on finish, you will accept the changes the rules have been doing, if the rules did some changes. If you click cancel, all changes the rules have been doing with the model, will be reverted.
Finish will end the tool. This will not affect the rule set files and the rules. They have been saved by the ruleset editor. You need to edit the rules in the rule editor.


Edit rulesets

Make a new Ruleset

In the Rule set chunk, click on the dropdown to see the list of ruleset files available for you.


In the lower part of that list, you will find the “Add new rule set”. Click on that menu item.


You will get a dialog to add the name of the rule set.



Create new rule
When you have a rule set active, you could edit or add new rules. Click on “Create new rule” to create a new rule.



You will get a dialog where you define the name and description of the new rule.


When you click “Create rule”, the Rule editor will appear. How to use that is explained later.



Edit an existing rule
In the Rule set chunk, set the ruleset file that you want to edit as active.


Then select the rule that you want to edit.

The Rule editor will appear. More information about that later...


Rule editor

About the editor
In the editor you could make rules by using the graph editor. You could paint the rule by dragging predefined functions into the graphic and then make arrows between the functions.


In the middle you have the graphic editor where you can draw the rules.
On the left you find the list of functions that you could drag into the graphic. On the right properties for the functions could be edited. The list of properties will change according to the function you select.


In the graphic area you have 4 boxes representing different cursors you could click on to change the cursor. The functionality you get is:
   - The first one is the pointer and should be the normal cursor to use.
   - The second you should use to draw a line between 2 functions you have added to the diagram. Be aware that when you draw a line between two boxes in the diagram they are connected if there is a             green dot at the end of the line.
   - The third box you will use if you are going to make a chunk of rules in the same diagram. Then you should order them. With this box you get a cursor to make an “order” line between different rules.
   - The last box is about making loops. If you select this and make a line between two functions. The function pointing to, will run several times depending on the definition in that function.

The rules should consist of this elements:
   - Filter type
   - Query
   - Action


In the graphical editor you first need to drag in a filtertype. Then you will drag in some query items to build up the query. What query item to select, depends on the filtertype you have selected. you make the needed connecting lines between the query items and the filtertype box. Then the filtertype box represents the result of the query. The next thing you need to do is to add an action that is going to do something with the result. You could add more actions on the same result.

There is 3 button in the lower part of the dialog:
   - Validate
   - OK
   - Cancel

Validate will check your diagram and find out if the drawing is a valid rule. You will get errors if it is not.
OK  will save the rule and end the dialog.
Cancel will end the dialog with no change in the rule.


Filtertype

When you start this editor it will show you the filter type on the left. You could select:
   - Feature Query (Normal case for rules on objects)
   - Location Query (Normal case for rules on sections)
   - CSV loop (special case)

Select and drag in to the graphical editor a Feature Query, if you want to find some features and do an action on them.

Select and drag in to the graphical editor a Location Query, if you want to find sections in road, railway that you will do an action on.

In the normal case you do not have to add properties to these boxes.



Features
When you have drag in a Feature result box, the next you do is to select the Feature query item on the left. Then you will get a menu with a list of functions to add to the diagram to work with features.


Filter methods
In the list of methods you will find 4 filter methods that you could use in the feature query:
   - Feature attribute comparison
   - Attribute comparison
   - Common attribute comparison
   - Association comparison

If you want to query using attributes to find features where the featuretype is known, then select the first method. Drag this method in to the diagram and add properties:
   - Featuretype - you need to specify featuretype in this method.
   - Attributetype - you need to specify the attributetype to use in the filter - in this case that is an attributetype defined in this featuretype.
   - Then define the operator - select it from the dropdown in the field.
   - Set the value to compare.
   - If this is used with a CSV file, you could define the column to get the value from.
   - You could use this query for all features that have the attributetype. Check the “use this filter for all types” if that is the case.


If you want to query using attributes to find features where the featuretype is not known, then select the second method. Drag this method in to the diagram and add properties:
   - Attributetype group - select the attributetype you want to select the attributetype from.
   - Attributetype - select the attributetype to use in the filter.
   - Operator - select the operator in the dropdown in the field.
   - Value - give the value to look for.
This method will filter all features that have this attributetype independent of featuretype.


All features have some common properties. If you want to query using these common properties to find features where the featuretype is not known, then select the third method. Drag this method in to the diagram and add properties:
   - Select one of the common properties.
   - Select an operator.
   - Give a value to filter on.
   - This method will do the filtering independent of featuretype.


If you are going to use attributes in an associated feature to filter features, then you need to use the fourth method. Drag this method in to the diagram and add properties:
   - Define a featuretype to filter.
   - Define the association in that featuretype.
   - Then define a featuretype that this association could point at.
   - Then define the attributetype in this featuretype that you are going to use in the filter of the first defined featuretype.
   - Define the operator to use.
   - Give a value to use in the filter.
   - You could also use this with the CSV file, if that is the case than you have to define the column name to fetch the value from.
   - If this association is used in several Featuretypes, you could check the “use this filter for all types.”


You could add more filter methods to the query. If you do that, you need to click on the Logical menu list on the left side. Then 3 methods will appear:
   - AND
   - OR
   - NOT
You need to add these methods between the filters. An AND says that the features should satisfy both criteria at the same time. An OR will give you features that satisfy either criteria one or two or both. NOT will turn one single filter to the opposite.


You could use this AND, OR, NOT in several levels. It is possible to build a complex query by combining a lot of filters.

To add arrows between the boxes, first click on the box, then click in the green marker on the box. The system will find the nearest box to connect to.


You could also click on the second cursor icon to get a cursor to draw the lines between the boxes.



Actions
After you have defined the query, you get a feature result and that result could be put into one or more actions. The action methods you could use are located under the filters in the menu. Important to notice that you could not mix actions from Location Query with filters from feature query. If you have defined a result to be a feature result you should use filters and actions from the Feature Query menu.



Modify feature

In general - when you drag an action into the diagram you will get the properties to select on the right panel. In some cases you could get even more properties for the action by clicking on the three dots behind the action field in the property panel.

A dialog will appear with:
   - Action name
   - Description
   - Feature type of the result.
   - a list with all the attributes you will add a value to.
   - a checkbox “Append to existing” that you use when you want to append this value to an existing value.



Feature validation
With this action you could write validation - the result will appear in process info.


In this action the result is:
   - an error message
   - You could use the “insert keyword” to insert names and ID from the feature in the result into the message.
   - You could set the severity of the error message.


Sections
When you drag in a Location result box, the next you do is to select the Location query item on the left. Then you will get a menu with a list of functions to add to the diagram to work with locations on features. With locations we mean from and to positions in a Road, Railway, Waterway or any other infrastructure network. In order to get these functions to work, the model needs to have features that are located on an infrastructure network.

Filter methods
There are 3 filter methods to use with location filtering.


Feature’s attribute comparison
If you want to query for sections using attributes to find features where the featuretype is known, then select the first method. Drag this method in to the diagram and add properties:
   - Featuretype - you need to specify featuretype in this method.
   - Attributetype - you need to specify the attributetype to use in the filter - in this case that is an attributetype defined in this featuretype.
   - Define the operator - select it from the dropdown in the field.
   - Set the value to compare.

Actions

Create Feature
This action you should use if you want to create features on the sections in the result. Define the featuretype and attributetypes. You could even add values to the attributes.


You add a new attribute to add with the + sign under the table.


Network validation
This action is used for writing validation messages. All the sections in the result will get one message of the type you have defined.


Write the message in the result part of the dialog. You could add a keyword with the insert keyword button. You could even define what level of message this is.


Run a set of rules
Rules that have been made are stored in RuleSet files. You may have several rules in one ruleset file. This file is independent of the task. Once this file is made, it could be used in several automation tasks. It is then enough to just run the rules.


When you are going to run a set of rules, you should use the “Select data” chunk and “Run Automation” chunk. You use “Select data” to do a selection of data to use when running the rules.

In “Run Automation” you first need to select rules with the icon in the chunk. When you click on that icon, you will get a dialog shown below.


With this dialog you could do 2 things:
   - Select the rules to run by checking them.
   - Sort the order they should run.

You sort the order by marking the line with the rule and then drag the rule up or down. When you click Save the dialog will close and the selection you made will show up in the chunk.

If needed you could use the Delete button to delete a rule that is shown in the dialog. It is important to be aware that you then will permanently delete the rule from the Ruleset file.


Finish

Click Finish to finish the task, or click Cancel to cancel.




Statistics
0 Favorited
38 Views
0 Files
0 Shares
0 Downloads

Comments

09-01-2022 04:40

When will 2022.6 be available? 
This looks like a interesting tool!

Related Entries and Links

No Related Resource entered.