Skip to main content

Sync Next Target Dates

This workflow is included in the Scheduling package.

Description​

Add a NextTargetDate when a task connected to a relative schedule is completed.

Properties​

This workflow has the following properties.

PropertyValue
NameSync Next Target Dates
Codeworkflows_syncNextTargetDates_870625205145134c65c4f7bb
TypeWorkflow
ContextPackage
EnabledYes
TagsCauseway
Log retention7 days

Trigger​

The system triggers this workflow when items of the design below are edited. Where attributes are listed, an edit to anything else is ignored.

PropertyValue
Workflow typeEvent workflow
Applies toScheduled Task
EventsEdit
CollectionsLive
Attributes listened forattributes_tasksCompletionTime  (Completion Time)
Output modeManyItems  (Runs once for all items)

Actions​

This workflow runs 7 actions, in the order shown in this simplified diagram. Select an MWR action to open the workflow it runs. Every action's full settings are in the configuration below.

Configuration​

The full configuration of this workflow, including every action's parameters.

Show configuration (257 lines)
{
"trigger": {
"dodiCode": "designInterfaces_scheduledTask_8465d419467667a08a6b03cf",
"collections": [
"Live"
],
"events": [
"Edit"
],
"outputMode": "ManyItems",
"attributesListeningFor": [
"attributes_tasksCompletionTime"
]
},
"actions": [
{
"actionId": "87bc712d10e2af95b237e0e3",
"designCode": "designs_workflowRelationAction",
"description": "Reference TaskType",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowRelationActionsAqsPath",
"value": "root.attributes_tasksWithTaskTypesTaskType",
"attributeType": "String"
}
}
],
"variables": [],
"actions": []
},
{
"actionId": "87bc712d10e2af96be374086",
"designCode": "designs_workflowRelationAction",
"description": "Get parent tasksAssignableWithNextDates",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowRelationActionsAqsPath",
"value": "root^attributes_tasksAssignableTasks<designInterfaces_tasksAssignable>",
"attributeType": "String"
}
}
],
"variables": [],
"actions": [
{
"actionId": "87bc712d10e4af96be37b088",
"designCode": "designs_workflowRelationAction",
"description": "Get all matching schedulables",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowRelationActionsStandardPathId",
"value": "66f56ab51797b9a782228000",
"attributeType": "String"
}
},
{
"attribute": {
"attributeCode": "attributes_workflowRelationActionsToParentDodi",
"value": "designInterfaces_schedulable_801adccd0a05b30647df41c6",
"attributeType": "String"
}
}
],
"variables": [],
"actions": [
{
"actionId": "87bc712d10e4af46be57a089",
"designCode": "designs_workflowRelationAction",
"description": "Get all schedules",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowRelationActionsAqsPath",
"value": "root.attributes_schedulableTaskSchedules_86d15a122f4aaa1b57cedbf4",
"attributeType": "String"
}
}
],
"variables": [],
"actions": [
{
"actionId": "86f5d9fb354e940acd51d346",
"designCode": "designs_workflowFilterAction",
"comments": "keep only relative schedules with matching TaskType",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowFilterActionsAqsQuery",
"value": {
"type": "Query",
"properties": {
"dodiCode": "designInterfaces_relativeDateSchedule_81e19cdae3c5d9df4917200e",
"collectionCode": "Live",
"parameters": [
{
"name": "matchingTaskType",
"type": "AlloyId"
}
],
"attributes": [
"attributes_itemsTitle",
"attributes_itemsSubtitle"
]
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_scheduleTasksToGenerate_8e052b8307c10ea8ae43b4ec"
}
},
{
"type": "AlloyId",
"properties": {
"parameterName": "matchingTaskType"
}
}
]
}
]
},
"attributeType": "Aqs"
}
}
],
"variables": [
{
"name": "matchingTaskType",
"attributeType": "Link",
"value": {
"outputAction": "87bc712d10e2af95b237e0e3",
"outputMode": "Input",
"itemValue": {
"property": "ItemId"
}
}
}
],
"actions": [
{
"actionId": "880b9235bc3bd27508ffbb56",
"designCode": "designs_computeDatesFromSchedules_8e51c150022e2c7e705e9223",
"comments": "Get schedules next dates",
"parameters": [
{
"attributeCode": "attributes_computeDatesFromSchedulesDateRangeStart_800d6f68feb01147ef0d2035",
"attributeType": "Date",
"value": {
"script": "return Date(Now.AddDays(0));"
}
},
{
"attributeCode": "attributes_computeDatesFromSchedulesDateRangeEnd_81c4dd81e998b56ddfe158ab",
"attributeType": "Date",
"value": {
"script": "return Date(Now.AddYears(2000));"
}
}
],
"variables": [],
"actions": [
{
"actionId": "86f5d9fb334e9406cd51d84f",
"designCode": "designs_workflowCreateItemAction",
"comments": "create nextTargetDate",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowCreateItemActionsDesignCode",
"attributeType": "String",
"value": "designs_nextTargetDate_8bbf2c5dac22df0ab9d7e055"
}
},
{
"attribute": {
"attributeCode": "attributes_workflowCreateItemActionsCollection",
"attributeType": "String",
"value": "Live"
}
},
{
"attribute": {
"attributeCode": "attributes_workflowCreateItemActionsSingleInstance",
"attributeType": "Boolean",
"value": true
}
},
{
"attributeCode": "attributes_workflowCreateItemActionsParents",
"attributeType": "Link",
"value": {
"outputAction": "87bc712d10e2af96be374086",
"outputMode": "Input",
"itemValue": {
"property": "ItemId"
}
}
},
{
"attribute": {
"attributeCode": "attributes_workflowCreateItemActionsParentsLinkAttributeCode",
"attributeType": "String",
"value": "attributes_tasksAssignableWithNextDatesNextTargetDates_8273093477853f80782c1924"
}
},
{
"attributeCode": "attributes_nextTargetDateTaskType_86d15a1e2f4a2a1bf7cbabfa",
"attributeType": "Link",
"value": {
"outputAction": "87bc712d10e2af95b237e0e3",
"outputMode": "Input",
"itemValue": {
"property": "ItemId"
}
}
},
{
"attributeCode": "attributes_nextTargetDateTargetDate_8ad5639452d13a25de751eca",
"value": {
"script": "Variables.datesFromAllSchedules.AllValues.Values.Select(x => x.SingleValue).Min()"
},
"attributeType": "Date"
}
],
"variables": [
{
"name": "datesFromAllSchedules",
"value": {
"outputAction": "880b9235bc3bd27508ffbb56",
"outputMode": "All",
"itemValue": {
"attributeCode": "attributes_computeDatesFromSchedulesOutputDateOccurance_8ad5639456d15a25d67516c5"
}
},
"attributeType": "String"
}
],
"actions": []
}
]
}
]
}
]
}
]
}
]
}
]
}