Automic Workload Automation

 View Only
  • 1.  Time data types

    Posted Jan 31, 2023 08:04 AM
    I am creating a prompt set that will ask the user to enter a timeout value. A typical timeout value might be on the order of between 10 or so minutes and 24 hours, so I thought that it would make sense to let the user enter the timeout value in hours and minutes.

    I added a Time/Date element to the prompt set, and selected the Data Reference UC_DATATYPE_TIME. This is a predefined static VARA with Data Type Time and Output format hh:mm. In my tests, it worked well. I entered values such as 00:15 (fifteen minutes), or 02:30 (two and a half hours), and the values set by the prompt set were as expected.

    Then I gave the object to a user for testing. He immediately ran into problems and I learned that the reason was that in his AWI Settings, he had the Time Display set to 12-hour AM/PM format. As a result, the default values of 00:15 was being displayed for him as "12:15 AM". I did not see this behavior in my initial tests, because my Time Display setting was set to 24-hour format. The display of this field as a time of day with an AM or PM suffix would be very confusing for users, because it implies a specific time of day instead of a duration.

    I looked at the various Date and time data types, and saw that there is on called MM:SS that is certainly a duration. However, I found no time format for a duration in hours and minutes. I see a few problems with this:
    1. The AE provides no way to distinguish between a time of day in HH:MM format and a duration in hours and minutes. Internally, the AE treats the two indistinguishably.
    2. The AWI assumes all HH:MM-formatted fields are times of day, and formats them accordingly based on the user's AWI Time Display setting.

    It would be preferable if the AE provided separate data types for durations and times of day. Until such an enhancement is delivered, it would be good if the documentation described the aforementioned behavior more clearly.

    For what it's worth, I will change the type of this prompt set field to Number (integer), and ask the user to enter the timeout in minutes.


  • 2.  RE: Time data types

    Broadcom Employee
    Posted Feb 01, 2023 06:13 AM
    optionally you can use a string field and put a regular expression like ^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$ to allow only HH:MM with optional leading zero on 24h format


  • 3.  RE: Time data types

    Posted Feb 01, 2023 08:06 AM
    Hi @Markus Embacher. Thanks, that's a good idea. However, I decided that an integer number of minutes was easier.

    By the way, I do use regular expressions elsewhere in the prompt set, e.g., to validate UC4 object names. See my discussion on AE limits for some handy regexes.