Unitfly Customer Portal

Property Calculations

Calculate object properties based on referenced properties and their values like parent-child relationship. One of the many ways to use this module is for calculate open tasks/assignments per project, sum logged hours on projects etc.

Configuring Property calculations

After you have successfully installed the application, you can start adding calculation rules.

  1. Open M-Files Admin
  2. In the left-side tree view, expand the desired connection to M-Files Server.
  3. In the left-side tree view, expand the Document Vaults node.
  4. Still, in the left-side tree view, expand the vault where you installed the connector and select Configurations.
  5. Expand Other Applications
  6. Expand Extension Kit
  7. Click on Extended property calculations

Field Description

FieldValueDescription
EnabledYes/NoSpecifies whether the module is in use.
Rules > Rule [n]
NameTextCustom rule name.
EnabledYes/NoSpecifies whether the rule is in use.
ModeOne of the following:
• ParentChildren
• SingleObject
Calculation mode of this rule.
ParentChildren. If this option is selected, the property used to store calculation results and the properties used for calculation are properties of separate objects in parent-children relationship. Eq. property Price on Project object could be calculated as sum of Price on Task objects related to that Project.
SingleObject. If this option is selected, both the properties used for calculation and the property used to store calculation result are properties of the same object.
TriggerOne of the following:
• ObjectCreated
• ObjectChanged
• ObjectEnteredState
• RunOnce
Type of event that triggers the execution of this rule.
ObjectCreated. If this option is selected, rule will be executed whenever parent or child objects are created.
ObjectChanged. If this option is selected, rule will be executed when parent or child objects are changed.
ObjectEnteredState. If this option is selected, rule will be executed parent or child objects have entered a new state.
Run once. If this option is selected, rule will be run only once and on all matching objects in vault. NOTE: On vault restart, all enabled rules with Run once trigger will be run immediately.
Update optionOne of the following:
• Always
• OnlyWhenTargetEmpty
• OnlyWhenSourceNotEmpty
Always. If this option is selected, property value will be recalculated whenever the rule trigger is matched.
OnlyWhenTargetEmpty. If this option is selected, property value will be updated with the result of calculation only if the existing value is empty – once calculated, non-empty property value will not be overridden.
OnlyWhenSourceNotEmpty. If this option is selected, property value will be updated with the result of calculation only if the result is not an empty value – empty value will never override the existing one.
Calculated propertyProperty definitionProperty that will be holding the calculated value.
Calculation PropertiesList of property definitionsProperties that will be used in calculation.
FunctionOne of the following:
• Sum
• Multiply
• Average
• Min
• Max
• First
• Last
• Concatenate
Function to apply to calculate properties.
Sum. Valid for numeric and lookup based properties.
Multiply. Valid for numeric properties only.
Average. Valid for numeric properties only.
Min. Valid for numeric, as well as text, date and lookup-based properties.
Max. Valid for numeric, as well as text, date and lookup-based properties.
First. Valid for numeric, as well as text, date and lookup-based properties.
Last. Valid for numeric, as well as text, date and lookup-based properties.
Concatenate. Valid for all property types.
Order byProperty definitionDisplayed only when Function is one of the following: Min, Max, First or Last.
If calculated properties are lookups to objects, they will be ordered by the selected property.
Parent objectObjectDisplayed only when Mode is ParentChildren.
Parent object filter.
Source objectObjectDisplayed only when Mode is SingleObject.
Source object filter.
Business CriticalYes/NoIf set to true, rule will be logged in SEQ.
Update metadata in fileYes/NoWhen object metadata is changed it will be automatically updated in document associated with it.
All changes will be available in preview card with no need for check out.
Rules > Rule [n] > Parent object
Object TypeList of object typesObject type of parent object.
ClassList of classesClass of parent object.
WorkflowList of workflowsWorkflow of parent object.
StateList of workflow statesWorkflow state of parent object.
Search filtersList of search filtersList of search filters, any of which the parent object needs to satisfy.
Rules > Rule [n] > Parent object > Search filters > Filter [n]
SearchConditionsSearch conditionsOptional additional conditions that parent object needs to satisfy.
Conditions inside a single filter are combined with AND, while multiple filters are combined with OR operator.
Rules > Rule [n] > Trigger object
Object TypeObject TypeObject type of source object.
ClassClassClass of source object.
WorkflowWorkflowWorkflow of source object.
StateStateWorkflow state of source object.
Note! If you have entered a state, you must also enter the workflow above.
Search filtersList of search filtersList of search filters, any of which the source object needs to satisfy.
Rules > Rule [n] > Source object > Search filters > Filter [n]
SearchConditionsSearch conditionsOptional additional conditions that source object needs to satisfy.
Conditions inside a single filter are combined with AND, while multiple filters are combined with OR operator.
Rules > Rule [n] > Children Objects
Relationship ModeOne of the following:
• All
• FromParentToChildren
• FromChildrenToParent
Type of relationship between parent and children objects.
All. When this option is selected, both parents can have reference to children and vice versa.
FromParentToChildren. When this option is selected, parent must have reference to children.
FromChildrenToParent. When this option is selected, children must have reference to parent.
Relationship PropertyProperty definitionRelationship property between parent and children objects. If not set, any property can be used as relationship.
Object TypeList of object typesObject type of children objects.
ClassList of classesClass of children objects.
WorkflowList of workflowsWorkflow of children objects.
StateList of workflow statesWorkflow state of children objects.
Look inOne of the following:
• LatestObjVersion
• AllObjVersions
When matching trigger object, look in all object versions, or only the latest one.
LatestObjVersion. If this option is selected, the current object version must match the specified conditions for object to be matched as source for this rule.
AllObjVersions. If this option is selected, any object version must match the specified conditions for object to be matched as source for this rule.
Search filtersList of search filtersList of search filters, any of which the children’s objects need to satisfy.
Rules > Rule [n] > Children Objects > Search filters > Filter [n]
SearchConditionsSearch conditionsOptional additional conditions that children objects need to satisfy.
Conditions inside a single filter are combined with AND, while multiple filters are combined with OR operator.
Rules > Rule [n] > Vault search > Search [n]
ConditionsProperty definitionOptional list of conditions that must be satisfied in vault in order for this rule to be executed.
Search result typeOne of the following:
• Any
• None
Any. If this option is selected, the vault search will be considered satisfied if at least one matching object is found in vault.
None. If this option is selected, the vault search will be considered satisfied if no matching objects are found in vault.
Rules > Rule [n] > Vault search > Search [n] > Conditions > Property condition [n]
PropertyProperty definitionSpecifies the property whose value will be checked.
OperatorOne of the following:
• =
• =!
• <
• >
• <=
• >=
• Contains
• Does not contain
• Starts with
• Does not start with
Operator to use for comparing actual and expected property value.
ValueProperty valueProperty value to compare actual value against.
Rules > Rule [n] > Vault search > Search [n] > Conditions > Property condition [n] > Value
ModeOne of the following:
• Dynamic value
• Static value
• Empty value
• No action
Dynamic value. If this option is selected, comparison value will be created dynamically from source properties.
Static value. If this option is selected, comparison value will be created statically i.e. constant value.
Empty value. If this option is selected, comparison value will be empty.
No action. If this option is selected, no action will be performed. This is invalid state.
Dynamic valuePlaceholder editor(Displayed only if Dynamic value is selected as a mode)
Specifies search comparison value using properties from source object.
Static valueText(Displayed only if Static value is selected as a mode)
Specifies constant search comparison value.

Use Cases

Sum spent hours on project and tasks

Customer is big Pharmaceutical company and they are using M-Files as a Project Management solution. They simplified structure have Projects, Tasks and Hour Logging Events, like in Picture 1.

Their Project Managers would like to know at each moment how much time is spent working on a project per each task, as those projects usually takes a bit long. They have configured Calculated properties in two ways:

  1. Have information on a Project about all hours spent on Tasks
  2. Have information on a Task about all hours spent

Configuration of Property calculations

In Picture 2 we can see hierarchy of objects. In M-Files that hierarchy looks like in Picture 3. To configure Extended property calculations, we must be aware of that hierarchy or Parent-Child relationship. In customer cases:

  1. Project is parent and Task is child
  2. Task is parent and Hour Logging Event is child
Picture 3. M-Files implementation structure

Sum spent hours on a task

Picture 4. Object “Task

We will create first rule for summing all hour logging events on tasks. Configuration is shown on Picture 5. We would like that summarizing happen when object is changed (Hour logging event). Parent object is Task and property on task object is Total work (h).

Picture 5. Parent object and property

Children objects are Hour Logging Events (Picture 6) and they have connection to a Task. That’s why Relationship model is from ChildrenToParent and property that connect them is Task (Picture 7).

Picture 6. Hour Logging Event
Picture 7. Children objects

Property that we want to sum its Logged Work (h) from Hour logging events. Function that we are using its SUM (Picture 8).

Picture 8. Calculation properties and function

In this case when we add new hour logging event it will be summed and added to related Task object (Picture 9).

Picture 9. Calculated property Total work (h) in action

Sum spent hours on a project

The way to sum all spent hours per project (Picture 10) is same as for Tasks expect now Parent is Project and Children are Tasks.

Picture 10. Project

Property that connect Tasks and Project is property Project on a Task object (Picture 11).

Picture 11. Configuration of rule for sum all tasks per project

The results are seen on Picture 12, how all Total work (h) from Tasks are summarized to Project.

Picture 12. Calculated property in action on Project object

Count opened tasks on project

Customer that is using M-Files as Project Management is counting opened tasks per project. Every task is going trough workflow and final state is Closed. In every moment Project Manager can see how many opened tickets they have on each project without opening views.

Count opened assignments per person

Customer wanted to have information of how many opened tasks are per Person. That information was on a Person object. With customer we have tested different gamification and motivational methods and counting opened assignments was one of them that took effect in productivity.

Count opened tickets per customer

Customer is using M-Files as a ticketing system with help of M-Files E-mail processor. They are counting how many opened tickets they have per customer and how many total ticket they have. To gain that quick information

Table of Contents