Handling Time Zone Awareness¶
Question: How does Workflow handle time zone awareness?
Answer: Workflow operates in a time zone neutral manner. All timestamps within the Workflow are the same as those saved in the database.
Question: What happens when a time zone aware request initiates a Workflow?
Answer: If the request is time zone aware and contains timestamp data related to server time zone, the Workflow converts these timestamps to server time and passes them as inputs to the workflow. For example, if a request contains the timestamp 2024-02-29T14:00:00+05:00, and the server is in Australia/Brisbane (+10), the timestamp is passed into the Workflow as 2024-02-29-19.00.00.
If the request is time zone aware and contains timestamp data related to a site time zone, the Workflow converts these timestamps to the corresponding site time zone and passes them as inputs to the Workflow. For example, if a request contains the timestamp 2024-02-29T14:00:00+03:00, and the related site is in Europe/Stockholm (+1), the timestamp is passed into the Workflow as 2024-02-29-12.00.00.
Question: What about time zone unaware requests?
Answer: There's no change to the way unaware requests work. They will continue to work as they did previously.
Question: What if the API I'm calling inside the Workflow is time zone aware?
Answer: Within the Workflow, all API tasks behave in a time zone unaware manner, even if they are annotated as known server time zone or site time zone.
Question: Will the timestamps of IFS Rest Connector tasks be converted to server or site time?
Answer: The timestamps of IFS Rest Connector tasks are passed as they are. Workflow does not perform automatic conversions.
Question: What happens to the input timestamp data if an event initiates a Workflow?
Answer: If the entity is annotated based on the server time zone, the timestamp data from the event are in server time.
If the entity is annotated based on the site time zone, the timestamp data from the event are in related site's time.
Question: Will input data from a Workflow command be converted?
Answer: If the data source that the Workflow Command works on is server time zone aware, date times in the Workflow Command payload will get converted into server time. This conversion is only done if the date time format is YYYY-MM-DDTHH:MM:SSZ
.
If the data source that the Workflow Command works on is site time zone aware, date times in the Workflow Command payload will be converted to related site time. The site is passed as the Objsite
request parameter. This conversion is only performed if the date-time format is YYYY-MM-DDTHH:MM:SSZ
and if the Objsite
parameter exists.
Question: Will input data sent in the Rest API call that starts a Workflow be converted?
Answer: Assume the header, X-Ifs-Time-Zone-Aware-Request is set to true
and a valid json payload structure with timestamp attribute type set as DateTime
is sent,
If server time zone support is requested, those timestamps values will be converted to server time just like in Workflow command request. Below is a sample json payload, where InitTimestampValue
will be converted to server time.
{
"variables": {
"IncidentReferenceNo": {
"value": "01",
"type": "String"
},
"InitTimestampValue": {
"value": "2018-03-13T11:33:40Z",
"type": "DateTime"
}
}
}
If site time zone support is requested, those timestamp values will be converted to site time related to the Objsite
, just as in a Workflow Command request. Below is a sample JSON payload where InitTimestampValue
will be converted to site time with the site id "3"
.
{
"variables": {
"IncidentReferenceNo": {
"value": "02",
"type": "String"
},
"InitTimestampValue": {
"value": "2018-03-14T12:30:40Z",
"type": "DateTime"
},
"Objsite": {
"value": "3",
"type": "String"
}
}
}
Question: If my cascading Workflow uses timestamp data from a previous Workflow, should I convert them to server or site time before using them in the second Workflow?
Answer: The data within the first Workflow is already converted to server or related site time, so there's no need to convert it again.
Question: How do I use the IFS API task with entities and operations that are mandatory to have time zone aware requests (where the timestamptzlegacydatasupport
property is set to false
)?
Answer: When upgrading from a version where the API is NOT mandatory to be time zone aware, a BPA author is required to review the Workflow if time zone related data are handled correctly, and tick the option "Timestamp Corrected for Backward Compatibility". When creating a new API task, this option will be ticked by default. This option is visible only when an entity that is mandatory to behave in time zone aware manner is used. For more details, see IFS API.