RecurrenceRuleGetNextAvailabilities

Description

This activity allows, given a recurrence rule, to obtain the next available dates.

A recurrence rule could be of 3 possible types (StartType): DAILY, WEEKLY and MONTHLY which mean once a day, week or month. You can also specify how many days, weeks, or months the rule should repeat by using the RepeatEvery parameter. All other parameters are used to indicate availability rules such as: "once a week only on Tuesdays or Thursdays". If the next recurrence falls on an available day, that date will be returned, otherwise if it is not available the next available date will be returned. So, for example, if the start date is July 1st and the rule says to repeat once a month only on weekends. If the 1st of the following month is during the week, DocsMarshal will advance day by day to the first available day.
RecurrenceRule Properties
StartType It can be daily, weekly or monthly. Indicates the duration of the recurrence which can be once a day, once a week or once a month.
StartDt The date when the recurrence starts.
ExpireDate The date after which the rule is no longer valid
RepeatEvery Indicates every how many days, weeks or months the rule must be repeated.
RecursInTheDay Indicates which days of the week are available for the rule.
RecursInTheMounth Indicates which months are available for the rule.
RecursInTheMounthDays Indicates which days in the month are available for the rule.
RecursInTheMounthOn Possible values are first, second, third, fourth and last. Indicates which occurrences of the days of the week in the month are available for the rule. It can be used to create rules like "Once a month on last Friday" or "Once a month on second Monday" etc.
* Other properties of the recurrence rule concern the recurrence within a single day and are not taken into account by this activity

Below is a summary table with some examples:

Start TypeRepeat EveryRecurs InTheDayRecurs InTheMounthRecurs InTheMounthDaysRecurs InTheMounthOnEffect
Daily2NoneNoneNoneNoneRepeats every two days
Weekly2NoneNoneNoneNoneRepeats the first day of the week every two weeks (the first week is included although not complete)
Monthly1NoneNoneNoneNoneRepeats every two month
Daily4- Monday
- Friday
NoneNoneNoneSkip four days from the last recurrence and, if it's not on Monday or on Friday, it runs until the next Monday or the first Friday.
Weekly1- Monday
- Friday
NoneNoneNoneRepeats every week on Monday or on Friday
Monthly1- Monday
- Friday
NoneNoneNoneJumps to the next month and slide day by day until the following Monday or Friday. For example, if the last occurrence is 03/15 DocsMarshal jumps to 04/15. If 04/15 is Monday or Friday that date will be returned, otherwise it will be returned the next available day.
Daily4- Monday
- Friday
- July
- August
NoneNoneRecurs every four days on Mondays or Fridays only in the specified months.
Weekly1- Monday
- Friday
- July
- August
NoneNoneRepeats every week on Mondays or Fridays only in the specified months.
Monthly1- Monday
- Friday
- July
- August
NoneNoneRepeats in the specified months on Mondays or Fridays.
Monthly1- Monday
- Friday
- July
- August
- 10
- 12
NoneRepeats in the specified months, in one of the specified day only if they are Mondays or Fridays.
Monthly1- Monday
- Friday
- July
- August
None- FirstRepeats the first Monday of the specified months
Monthly1- Monday
- Friday
- July
- August
None- LastRepeats the last Friday of the specified months

Input

LastAvailableDate InArgument<DateTime>

The date when to stop searching for new dates (inclusive).

The date whose next available dates you want to get. If it is left null the activity starts searching from the StartDate of the RecurrenceRule

NextAvailabilitiesCount InArgument<Int32>

The number of availabilities to return.

RecurrenceRule InArgument<IRecurrenceRule> REQUIRED

The recurrence rule.


Output

NextAvailabilities OutArgument<List<DateTime>>

The next available dates for the rule.

NextAvailability OutArgument<DateTime?>

The next available date fot the rule.


Settings

FixStartDayOfTheMonth InArgument<Boolean>

This argument is taken into account only when the StartType of the RecurrenceRule is Monthly and tells DocsMarshal to fix the day of the month or not.

It is possible to choose to always start from the day of the start date (true) or to always start from the day of the last ride (false). Starting every time from the day of the last run, the day of the month tends to slip towards the end of the month and it may be that a few months are skipped.