Page tree

Stringifiers Description

Date, Time, and Datetime fields

Conversion to string:

Date field type is formatted using following pattern: dd/MM/yyyy

Datetime is formatted using the following pattern: dd/MM/yyyy HH:mm:ss

Time is formatted using the following pattern: HH:mm:ss

Conversion is done using current KB timezone and locale.

Parsing from string is as follows:

  1. For each type (Date/Datetime/Time) there are list of patterns, which are used to parse.
    1. Date "dd/MM/yyyy", "MM/dd/yyyy" , "MM/dd/yy", "dd/MM/yy", "MMM dd yyyy", "MMM dd yy", "dd MMM yyyy" , "dd MMM yy"
    2. Datetime "dd/MM/yyyy HH:mm:ss", "MM/dd/yyyy HH:mm:ss", "MM/dd/yy HH:mm:ss", "dd/MM/yy HH:mm:ss", "MMM dd yyyy HH:mm:ss", "MMM dd yy HH:mm:ss", "dd MMM yyyy HH:mm:ss", "dd MMM yy HH:mm:ss"
    3. Time "HH:mm:ss"
  2. If the string can't be parsed using any of these patterns then the converter tries to parse its value as a number, which represents time in milliseconds.
  3. If finally string can't be parsed - then exception is thrown.
  4. Parsed date is converted to KB time zone and current locale.

Elapsed time fields

All values in DB are stored as time in milliseconds since January 1, 1970 00:00:00.000 GMT in the Gregorian calendar. Conversion is dependant on elapsed time column properties. They are:

showDays - use days in date format

showHours - use hours in date format

showMinutes - use minutes in date format

showSeconds - use seconds in date format

decimalHours - means show hours in decimal format, like 3.5

singleInputBox - means show single input box. No input boxes for days, hours, etc.

round - means round to a certain number of digits, for example, setting "round" to 2 would round 5.66666 to 5.67

padding - means show a certain number of digits to the right of the decimal point, for instance, setting "padding" to 3 would display 5.7 as 5.700

All the above properties can be configured from the Setup > Tables > Edit > Fields screen.
Conversion to string is quite simple, the algorithm is as follows:

  1. Convert from milliseconds to seconds
  2. if (showDays) - calculate number of days (value/86400). if it's not single input box - append word "XXX days" to output, otherwise only XXX
  3. if (showHours) -
    1. - if singleinputbox and we already wrote something in output - then append delimiter ":"
    2. - calculate number of hours (remain_value/3600)
    3. - if decimal hours enabled - then append formatted value of hours using padding/round, then print out delimiter if single box is enabled or word "hours". Go to step 6.
    4. - otherwise - go to step 4.
  4. if show minutes is enabled - print out floor value of hours, otherwise append rounded value of hours
  5. if singlebox is disabled - print out word "hours"
  6. if showMinutes is enabled and decimal hours disabled
    1. - if singlebox is enabled and we already printed out something - print out delimiter ":"
    2. - calculate and print out minutes.
    3. - if singlebox disabled - print out word "minutes"
  7. if showseconds is enabled and decimal hours disabled
    1. - if singlebox is enabled and we already printed out something - print out delimiter ":"
    2. - calculate and print out seconds
    3. - if singlebox disabled - print out word "seconds"

So, possible values for 1 day 2 hours and 23 min 15 seconds could be:

1: 2:23:15 - when singlebox is enabled

1: 2 - when singlebox is enabled, decimal hours are enabled and show minutes with seconds is disabled.

1 day 2 hours 23 minutes 15 seconds - when singlebox is disabled and we are showing all time units.

1 day 2.0 hours when singlebox is disabled and decimal hours is enabled with round/padding equal to 0 etc. depending on current settings of the column.

Conversion from string to Agiloft internal representation is as follows:

  1. if singlebox is enabled then use ":" as delimiter, otherwise space ""
  2. Parse whole string and extract string values for each time unit.
  3. Iterate through time units and convert/parse string values to numbers.
  4. Calculate final value of elapsed time. Note, time must be in milliseconds passed from January 1, 1970 00:00:00.000 GMT Gregorian

Object Type fields

Converted to string as ${RootSubtypeLabel}. {}...{RecordSubtypeLabel}.please, note that subtype labels are used here so you will get localized label value for locale of rule creator.

Record links fields

The external form is (example) "[ID1][ID2][ID3]" where ID1, ID2, ID3 are IDs of linked records.

You can't modify record links by passing new set of linked IDs on save. An empty string represents an empty link set.

Choice fields

Choices are shown as simple text strings (note that choice lines cannot contain commas inside their labels).

Values "$none", "$choose_one" and "$choice_item" are treated as "nothing selected".

Multichoice fields

Multichoices are shown as a text strings separated by commas (hence the choice line itself cannot contain comma inside its label).

Multiple values linked fields

Multiple values are exported in format:

<dao_line $recordId1> Some value</dao_line> <dao_line $recordId2> Another value</dao_line>

Where $recordId1 and $recordId2 are IDs of the donor records these values are from.

Multiple Linked Field values cannot be modified by external scripts.