Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-9046

Using the node js client, an already serialized date variable cannot be serialized

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: L3 - Default
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.9.0
    • Labels:
      None

      Description

      Steps to reproduce:

      1. deploy a process with a external task (with topic name foo)
      2. start an instance
      3. subscribe to the topic foo and set a serialized date variable
        client.subscribe("foo", function({ task, taskService }) {
          const variables = new Variables();
          variables.setTyped("dateValue", { type: "date", value: "2010-10-10T10:10:10", valueInfo: {} });
          ...
        });
        

      Actual Behavior:
      The serialization of an already serialized date value fails with following message:

      ✖ couldn't complete task ..., TypeError: value.toISOString is not a function
      

      Expected Behavior:

      • the serialization is not executed in such a case

      Additional:
      The documentation [1] shows how to provide a date string as a value

      // 2- providing a date string as a value:
      variables.setTyped("anotherDate", { type: "date", value: "31 march 1994", valueInfo: {} });
      

      By default the provided date format "31 march 1994" is not supported by the REST Api.
      The example should use a supported date format [2].

      [1]: https://github.com/camunda/camunda-external-task-client-js/blob/master/docs/Variables.md#date
      [2]: https://docs.camunda.org/manual/7.8/reference/rest/overview/date-format/

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            michael.schoettes Michael Schoettes
            Reporter:
            roman.smirnov Smirnov Roman
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development