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

XMLWordPrintable

    • Icon: Bug Report Bug Report
    • Resolution: Fixed
    • Icon: L3 - Default L3 - Default
    • 7.9.0
    • None
    • None

      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/

        This is the controller panel for Smart Panels app

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

                Created:
                Updated:
                Resolved: