Schedule Data Entity OverviewLast Updated: 04/05/2018 Introduced in Version: 4.0
This tutorial demonstrates how to create and use Schedule Data Entity in Decisions. Schedule Data is an Entity in Decisions that stores custom schedule and keeps track of it. Different Schedule Data may be created in the same Folder in Decisions. Then, in Flow Engine we can treat all Schedule Data Entities in one Folder as a single complex schedule. This feature saves time when we build a process that require complex schedule calculations.
In this example we are going to create Schedule Data Entity that simulates ‘working days schedule’ and we will demonstrate how to use it in Flow.
We begin in the Designer Folder with clicking All > Add > Entity > Schedule Data on Folder Actions Panel.
Schedule Data window pops up. First, we provide our Schedule with desirable Name.
Then, we pick Start Date Time. This is when our Schedule starts. Note, because we simulate working days schedule, we set time to 9:00:00.
Next, we define Type Of Schedule. We have two options here: Included and Excluded. Included schedule will run on all defined days/times. Excluded will not run on defined days/times. We pick Included.
Then, we set the Length of a Schedule. This is the length of each instance of a schedule. We set it to 8 hours to simulate working day.
In Schedule Type we can pick suitable schedule template. For this example we pick Daily Schedule.
In the Schedule Data we set Day Info by checking days from Monday through Friday.
Finally, in End Type setting we can define when our Schedule stops running. ‘No End’ means that our Schedule does not have end, ‘By Date’ option let us define a constant date when schedule ends, ‘By Occurrences’ option will terminate schedule after provided number of runs.
We can click Ok to save our Schedule Data.
Our Schedule Data is created and can be managed in the Folder we created it.
Next, we are going to demonstrate how to use our Schedule Data Entity in a Flow.
In Designer Folder we click Create Flow on the Folder Actions Panel.
Then, we Name the Flow and click Ok to proceed to the Flow Designer.
In order to use our Schedule Data in Flow, we need to use steps from All Steps [Catalog] > Integrations > Internal Services > Scheduling Service category.
We add ReturnNextValidSlotInSchedule step from All Steps [Catalog] > Integrations > Internal Services > Scheduling Service category.
To configure Input data to this step we need to get Folder Id of the folder where our Schedule Data lives.
We can get it in our Designer Folder by clicking All > Manage > Get Designer Folder ID on Folder Actions Panel.
Then, we copy Folder ID and click OK to close the dialog window.
Back in the Flow Designer we paste our Folder ID into the folder Id Constant Input for ReturnNextValidSlotInSchedule step.
For the proposed Date input we pick Constant next Saturday because it is not in the Schedule and we need to test if Schedule will respect its dates and output next available date.
Then we connect the outcome from ReturnNextValidSlotInSchedule step to the End Step. This completes our Flow. We click Debug Flow on the top panel of the Flow Designer to test our Flow.
Our Flow executes in the debugger with no issues. We click ReturnNextValidSlotInSchedule step on the execution diagram and select View Output Data.
In the Information window we should see that our next available slot according to our schedule will be on next Monday.