Asset Work Group Syncing
This workflow is included in the Asset Work Groups package.
Description
Update Asset Work Group geometry to be the sum of child assets geometry, and cascade its tasks down to its assets.
Properties
This workflow has the following properties.
| Property | Value |
|---|---|
| Name | Asset Work Group Syncing |
| Code | workflows_assetWorkGroupSynchronisation_878d727ccb3eff889eb628eb |
| Type | Workflow |
| Context | Package |
| Enabled | Yes |
| Tags | Causeway, Causeway Scheduling |
| Runs on | Working days and hours only (Both) |
| Log retention | 60 days |
Trigger
The system triggers this workflow when items of the design below are created or edited. Where attributes are listed, an edit to anything else is ignored.
| Property | Value |
|---|---|
| Workflow type | Event workflow |
| Applies to | Asset Work Groups |
| Events | Create, Edit |
| Collections | Live |
| Attributes listened for | attributes_tasksAssignableTasks (Tasks)attributes_assetGroupsAssets (Assets) |
| Output mode | OneItem (Runs once per item) |
| Can be triggered by other workflows | Yes (indirectly, via item changes) |
Actions
This workflow runs 6 actions, in the order shown in this simplified diagram. Every action's full settings are in the configuration below.
Configuration
The full configuration of this workflow, including every action's parameters.
Show configuration (174 lines)
{
"trigger": {
"dodiCode": "designInterfaces_assetWorkGroups_82cb7cce0582d5d6b5fcfd60",
"collections": [
"Live"
],
"events": [
"Create",
"Edit"
],
"attributesListeningFor": [
"attributes_tasksAssignableTasks",
"attributes_assetGroupsAssets"
],
"outputMode": "OneItem",
"canBeTriggeredByWorkflows": true
},
"actions": [
{
"actionId": "8b0bcafcdfe5f64cb302ea04",
"designCode": "designs_workflowRelationAction",
"description": "Get Asset Heads",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowRelationActionsAqsPath",
"value": "root.attributes_assetGroupsAssets",
"attributeType": "Link"
}
}
],
"variables": [],
"actions": [
{
"actionId": "8b2bb13e309f499a3ee695f9",
"designCode": "designs_workflowEditItemAction",
"description": "Sync tasks to children assets",
"parameters": [
{
"attributeCode": "attributes_tasksAssignableTasks",
"value": {
"outputAction": "883074d339bc9b3b6be1480a",
"itemValue": {
"property": "ItemId"
}
},
"attributeType": "Link"
}
],
"variables": [],
"actions": []
}
]
},
{
"actionId": "8afe1a0fcd2209b003816cbd",
"designCode": "designs_workflowEditItemAction",
"description": "Edit geometry to be the collection of those of its asset heads",
"parameters": [
{
"attributeCode": "attributes_itemsGeometry",
"value": {
"script": "return geometryCollection;"
},
"attributeType": "GeoJson"
}
],
"variables": [
{
"name": "geometries",
"value": {
"outputAction": "8b0bcafcdfe5f64cb302ea04",
"itemValue": {
"attributeCode": "attributes_itemsGeometry"
}
}
},
{
"name": "geometryCollection",
"value": {
"script": "return GeometryCollection(Variables.geometries.AllValues.Values.Where(x => x?.SingleValue != null).Select(x => x.SingleValue).ToArray());"
}
}
],
"actions": [
{
"actionId": "851741c584019c6fa218f0bf",
"designCode": "designs_workflowRelationAction",
"description": "Get tasks",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowRelationActionsAqsPath",
"value": "root.attributes_tasksAssignableTasks",
"attributeType": "Link"
}
}
],
"variables": [],
"actions": [
{
"actionId": "883074d339bc9b3b6be1480a",
"designCode": "designs_workflowFilterAction",
"description": "Filter to Proposed and Issued",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowFilterActionsAqsQuery",
"value": {
"type": "Query",
"properties": {
"attributes": [
"attributes_itemsTitle",
"attributes_itemsSubtitle"
],
"collectionCode": "Live",
"dodiCode": "designInterfaces_tasks"
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_tasksStatus"
}
},
{
"type": "AlloyId",
"properties": {
"value": [
"5bc5bdd281d088d177342c72",
"5bc5bdd281d088d177342c73"
]
}
}
]
}
]
},
"attributeType": "Aqs"
}
}
],
"variables": [],
"actions": [
{
"actionId": "85b309e5723a711b51e7b656",
"designCode": "designs_workflowEditItemAction",
"description": "Edit tasks' geometries to match the asset work group",
"parameters": [
{
"attributeCode": "attributes_itemsGeometry",
"value": {
"inputParent": 0,
"itemValue": {
"attributeCode": "attributes_itemsGeometry"
}
},
"attributeType": "GeoJson"
}
],
"variables": [],
"actions": []
}
]
}
]
}
]
}
]
}