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

Using the node js client, a date variable cannot be deserialized

    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 and pass a variable bar from type date
      3. subscribe to the topic foo
        client.subscribe("foo", function({ task, taskService }) {
          const dateValue = task.variables.get('bar');
          ...
        });
        

      Actual Behavior:

      • the handler is not invoked
      • the deserialization of the date variable fails with following exception:
        ✖ polling failed with TypeError: value.toISOString is not a function
        

      Expected Behavior:

      • the date variable is deserialized properly and a date is returned
      • the handler is always invoked, the deserialization of the variable happens only, when the user tries to get the variable

      Additional:
      The documentation [1] says, that dates are always available in the string format, which might be confusing, when someone does the following:

      client.subscribe("foo", function({ task, taskService }) {
        const variables = new Variables();
        variables.set('dateValue', new Date());
      
        const dateValue = variables.get('dateValue'); // <-- returns a date object
        ...
      });
      

      There should be just one way, how a date variable is deserialized.

      [1]: https://github.com/camunda/camunda-external-task-client-js/blob/master/docs/Variables.md#date

        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