Skip to main content

Keep dates in sync with Periodicities

This workflow is included in the Scheduling package.

Description​

Refresh attributes_standardCyclicalScheduleAllPlannedDates_8931cc4d3d0d87400bd35b4b and attributes_periodicityNextDate_8b766935838e7116fb62e7c0 when periodicity changes.

Properties​

This workflow has the following properties.

PropertyValue
NameKeep dates in sync with Periodicities
Codeworkflows_computeNextDateForPeriodicities_8706d5205143134c25c4f3b0
TypeWorkflow
ContextPackage
EnabledYes
TagsCauseway
Log retention7 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.

PropertyValue
Workflow typeEvent workflow
Applies toPeriodicities
EventsCreate, Edit
CollectionsLive
Attributes listened forattributes_periodicityValidOn_80a6a695435acd16e0b4d317  (Valid on)
attributes_periodicityRepeat_8e35bd9dad29336f460f2acd  (Repeat)
attributes_periodicityEndsOnExclusive_897d0b7250920fc60c072bf1  (Ends On (Exclusive))
attributes_periodicityStartsOnInclusive_863726baef05061cd5adad15  (Starts On (Inclusive))
Output modeManyItems  (Runs once for all items)

Actions​

This workflow runs 5 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 (202 lines)
{
"trigger": {
"dodiCode": "designInterfaces_periodicity_68109e5096e0ec0345072f8a",
"collections": [
"Live"
],
"events": [
"Create",
"Edit"
],
"outputMode": "ManyItems",
"attributesListeningFor": [
"attributes_periodicityValidOn_80a6a695435acd16e0b4d317",
"attributes_periodicityRepeat_8e35bd9dad29336f460f2acd",
"attributes_periodicityEndsOnExclusive_897d0b7250920fc60c072bf1",
"attributes_periodicityStartsOnInclusive_863726baef05061cd5adad15"
]
},
"actions": [
{
"actionId": "8ccee3e37371ee91ce8e2d73",
"designCode": "designs_computeDatesFromPeriodicities_874950917130ef4b6ae2e28c",
"comments": "Get periodicity's next date",
"parameters": [
{
"attributeCode": "attributes_computeDatesFromPeriodicitiesDateRangeStart_800d6f68feb01147ef0d2035",
"value": {
"offsetMilliseconds": 0
},
"attributeType": "Date"
},
{
"attribute": {
"attributeCode": "attributes_computeDatesFromPeriodicitiesLimit_8f4d17da8e3a79f4d3fa840b",
"value": 1
}
}
],
"actions": []
},
{
"actionId": "822784849e68da18bbb4a723",
"designCode": "designs_workflowQueryAction",
"comments": "Query related standard cyclical schedules",
"variables": [
{
"name": "periodicities",
"value": {
"inputParent": 0,
"itemValue": {
"property": "ItemId"
}
}
}
],
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowQueryActionsSingleInstance",
"value": true
}
},
{
"attribute": {
"attributeCode": "attributes_workflowQueryActionsAqsQuery",
"value": {
"type": "Query",
"properties": {
"collectionCode": "Live",
"dodiCode": "designInterfaces_standardCyclicalSchedule_8df406ac30b303672ed6d907",
"parameters": [
{
"name": "periodicities",
"type": "AlloyId"
}
]
},
"children": [
{
"type": "Or",
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_standardCyclicalScheduleInclusivePeriodicities_68132ec89b8145b312072f8a"
}
},
{
"type": "AlloyId",
"properties": {
"parameterName": "periodicities"
}
}
]
},
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_standardCyclicalScheduleExclusivePeriodicities_68132ec89b8145b312072f8b"
}
},
{
"type": "AlloyId",
"properties": {
"parameterName": "periodicities"
}
}
]
}
]
}
]
}
}
}
],
"actions": [
{
"actionId": "841707c0d1d830f348e98c94",
"designCode": "designs_computeDatesFromSchedules_8e51c150022e2c7e705e9223",
"comments": "Get all schedules dates",
"parameters": [
{
"attributeCode": "attributes_computeDatesFromSchedulesDateRangeStart_800d6f68feb01147ef0d2035",
"value": {
"inputParent": 0,
"itemValue": {
"attributeCode": "attributes_scheduleStartsOn_8938a2342563580acb7d5ca5"
}
},
"attributeType": "Date"
},
{
"attributeCode": "attributes_computeDatesFromSchedulesDateRangeEnd_81c4dd81e998b56ddfe158ab",
"value": {
"inputParent": 0,
"itemValue": {
"attributeCode": "attributes_scheduleEndsOn_8f3ddb33870afa31cde2e449"
}
},
"attributeType": "Date"
}
],
"actions": []
},
{
"actionId": "848354b51c5d0a9288e5ea49",
"designCode": "designs_workflowEditItemAction",
"comments": "Update schedules all planned dates",
"parameters": [
{
"attributeCode": "attributes_standardCyclicalScheduleAllPlannedDates_8931cc4d3d0d87400bd35b4b",
"value": {
"script": "new { dates = Variables.scheduleDates.AllValues.Values.Select(x => x.SingleValue).ToArray() }"
},
"attributeType": "Json"
}
],
"variables": [
{
"name": "scheduleDates",
"value": {
"outputAction": "841707c0d1d830f348e98c94",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_computeDatesFromSchedulesOutputDateOccurance_8ad5639456d15a25d67516c5"
}
},
"attributeType": "Date"
}
],
"actions": []
}
]
},
{
"actionId": "80640663ff9a06cb951c8849",
"designCode": "designs_workflowEditItemAction",
"comments": "Set periodicity's next date",
"parameters": [
{
"attributeCode": "attributes_periodicityNextDate_8b766935838e7116fb62e7c0",
"value": {
"outputAction": "8ccee3e37371ee91ce8e2d73",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_computeDatesFromPeriodicitiesOutputDateOccurance_8ad5639456d15a25d67516c5"
}
},
"attributeType": "Date"
}
],
"actions": []
}
]
}