Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks Extension and Connector for MES 7​.1

Add a variable for the DateTime input

  • Last UpdatedJan 21, 2026
  • 3 minute read

Because of a difference in how Work Tasks and MES Stateless API methods treat DateTime inputs, you must create a DateTime variable to convert any DateTime input values from the workflow form from UTC time to local time. For additional information about this issue, refer to DateTime.

This test procedure includes a required finish time input in the workflow form. To address the DateTime issue for this input, the DateTime variable called reqfinishtimevar will be added to the Start activity.

Add the reqfinishtimevar variable to the Start activity

  1. With the Job.Add workflow opened, right-click the Start activity and select Activity Properties.

    The Activity Properties pane appears.

  2. On the Activity Properties pane, select the Variables box button.

    The Variables window appears.

  3. In the Workflow Variables box, enter reqfinishtimevar.

  4. In the Type list, select date.

    Work Tasks add variables dialog.

  5. Select Update to save the entries and close the window.

  6. In the Activity Properties pane, select the Initialize Variables box button.

    The Update Variable window appears.

    Work Tasks update variable dialog.

  7. In the Condition column, hover the pointer over Select and select the list box that appears.

    A navigation tree appears.

  8. Expand the Variables branch and select the Variable.reqfinishtimevar entry.

    Work Tasks update variables dialog variable navigation tree.

    A row for the reqfinishtimevar variable is added to the table in the Update Variable window.

    Work Tasks update variable dialgo displaying an updated variable.

  9. Select the Tree icon under the Actions column.

    A list box appears in the Value column.

  10. Select the list box button. A navigation tree appears.

    Work Tasks update variable dialog value column highlighting Build Expression option.

  11. Select the Build Expression link.

    The Expression Editor window appears.

  12. In the Editor pane, enter Convert.ToDateTime(.

    Note that expression entries are case sensitive.

  13. In the navigation tree, expand the Workflow Instance, XmlVariables, SFFormData, and SKRootDefinition branches.

  14. Select and drag the entry req_finish_time_local to the right of the opening parenthesis in the expression.

    The XML variables object is added to the Editor pane.

    Work Tasks update variable build expression dialog.

  15. Complete the entry in the Editor pane so that the full entry is as follows:

    Convert.ToDateTime(XmlVariables.SFFormData.
    SKRootDefinition.req_finish_time_local,System.Globalization.CultureInfo.InvariantCulture).
    ToLocalTime()

    Work Tasks Update Varaible build expression sample entry.

  16. Select OK and then select Close to close the Variable Editor window.

    The completed reqfinishtimevar variable definition appears in the Update Variable window.

    Work Tasks Update Variable window displaying completed entry.

  17. Select the OK to close the Update Variable window.

  18. Select the Save button at the bottom of the Activity Properties pane to save the reqfinishtimevar variable.

Related Links
TitleResults for “How to create a CRG?”Also Available in