Uploaded image for project: 'JOC - JobScheduler Operations Center'
  1. JOC - JobScheduler Operations Center
  2. JOC-1396

Wrong quoting when assigning values including double quotes to variables

    XMLWordPrintable

Details

    • Fix
    • Status: Released (View Workflow)
    • Medium
    • Resolution: Fixed
    • 2.4.0
    • 2.5.0
    • JOC Cockpit GUI
    • None

    Description

      Current Situation

      • When variables are assigned values that include double quotes ("), for example in arguments to jobs, then the JOC Cockpit Workflow Editor applies wrong quoting.
      • Assume that a user adds the following value to a command variable that indicates an SQL Statement:
        SELECT count(*) as "total_order_count" FROM HISTORY_ORDERS WHERE CREATED BETWEEN '$start_datetime_utc' AND '$end_datetime_utc'
        
      • This value is stored in JSON format like this:
         "command": "\"SELECT count(*) as \\\\\\\"total_order_count\\\\\\\" FROM HISTORY_ORDERS WHERE CREATED BETWEEN '$start_datetime_utc' AND '$end_datetime_utc'\"",
        

      Desired Behavior

      • The correct quoting for the above example is like this:
        "command": "\"SELECT count(*) as \\\"total_order_count\\\" FROM HISTORY_ORDERS WHERE CREATED BETWEEN '$start_datetime_utc' AND '$end_datetime_utc'\"",
        

      Workaround

      • Users can use the "Edit JSON" action menu item to manually correct wrong quoting in JSON.
        • Remove the superfluous backslashes in front of double quotes from \\\\\\\" and make this \\\".
        • Having submitted the changes from the "Edit JSON" popup window immediately deploy the workflow without further changes as otherwise the Workflow Editor will re-write the JSON format in wrong quoting.

      Attachments

        Activity

          People

            ztsa0019 Sourabh Agrawal
            ap Andreas PĆ¼schel
            Pratishtha Pandey Pratishtha Pandey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: