Calendar IO

Possible use cases

  • Promoting Appian calendars between environments
  • Give non-Designers the ability to create/modify calendars and import them into Appian

Functionality

  • Read Calendar
    • Read an already existing Appian calendar or create a new one if none exist with the given name. Returns a Calendar CDT
  • Import Appian calendar
    • Will only update Appian calendar if id and name matches
    • Similar behavior to writeToDataStoreEntity

The function: Save Calendar is deprecated as it used an old pattern bind which needs the load function which is also deprecated

Anonymous
Parents
  • Hello, how should the Calendar be saved ? Just by executing the writeToDataStoreEntity  and then using the Import Appian Calendar node ?

    The calendar is not being updated after changing the working days.

    Any help would be appreciated

  • Hi, sorry for the delay,

    I agree with you that calendars seems to not being modified after changing working days when you look at them in the Process Calendar settings but, if you read the calendar and make some calculations you can verify that the change has being applied.

    I suggest you to prepare a simple test, create a custom calendar, change the intervals of some working days and load it after to Appian using the "Import Appian Calendar" Smart Service, probably you still will see original values in the designer but, try a simple test calculating working ours and look at the results, my hope is that your interval changes are being used in that calculations.

    This is an example of how could be the test, this is working properly, taking into account the changes I made on intervals

    a!localVariables(
      local!testDateTime: todatetime("03/20/2021 9:00 am"),
      local!prueba2: readcalendar("prueba2"),
      {
        intervals: length(local!prueba2.specific[wherecontains(todate(local!testDateTime), todate(local!prueba2.specific.date))][1].entries),
        since: local!prueba2.specific[wherecontains(todate(local!testDateTime), todate(local!prueba2.specific.date))][1].entries[1].since,
        until: local!prueba2.specific[wherecontains(todate(local!testDateTime), todate(local!prueba2.specific.date))][1].entries[1].until,
        plus0: caladdhours(local!testDateTime, 0, "prueba2"),
        plus2: caladdhours(local!testDateTime, 2, "prueba2"),
        plus3: caladdhours(local!testDateTime, 3, "prueba2"),
        plus4: caladdhours(local!testDateTime, 4, "prueba2")
      }
    )

    Finally, the plugin appears to not being updating the Calendar as it's done in the Designer, but the saved modifications are taken into account in working hour calculations.

    Of course I will try to update the plugin to modify Calendars in a way visible from the Designer but could you verify that calculations are done well?

Comment
  • Hi, sorry for the delay,

    I agree with you that calendars seems to not being modified after changing working days when you look at them in the Process Calendar settings but, if you read the calendar and make some calculations you can verify that the change has being applied.

    I suggest you to prepare a simple test, create a custom calendar, change the intervals of some working days and load it after to Appian using the "Import Appian Calendar" Smart Service, probably you still will see original values in the designer but, try a simple test calculating working ours and look at the results, my hope is that your interval changes are being used in that calculations.

    This is an example of how could be the test, this is working properly, taking into account the changes I made on intervals

    a!localVariables(
      local!testDateTime: todatetime("03/20/2021 9:00 am"),
      local!prueba2: readcalendar("prueba2"),
      {
        intervals: length(local!prueba2.specific[wherecontains(todate(local!testDateTime), todate(local!prueba2.specific.date))][1].entries),
        since: local!prueba2.specific[wherecontains(todate(local!testDateTime), todate(local!prueba2.specific.date))][1].entries[1].since,
        until: local!prueba2.specific[wherecontains(todate(local!testDateTime), todate(local!prueba2.specific.date))][1].entries[1].until,
        plus0: caladdhours(local!testDateTime, 0, "prueba2"),
        plus2: caladdhours(local!testDateTime, 2, "prueba2"),
        plus3: caladdhours(local!testDateTime, 3, "prueba2"),
        plus4: caladdhours(local!testDateTime, 4, "prueba2")
      }
    )

    Finally, the plugin appears to not being updating the Calendar as it's done in the Designer, but the saved modifications are taken into account in working hour calculations.

    Of course I will try to update the plugin to modify Calendars in a way visible from the Designer but could you verify that calculations are done well?

Children