Uploaded image for project: 'JOC - JS7 Operations Center'
  1. JOC - JS7 Operations Center
  2. JOC-2198

History Service - handling Order IDs longer than 255 characters

    XMLWordPrintable

Details

    Description

      Current Situation

      • Order IDs are generated by JS7 itself, and their length is typically limited to 255 characters.
      • Gap: One scenario is not checked or handled - specifically, File Watching-based orders (JS7 - File Watching).
        • The Order ID is constructed as:
          #<ISO date>#F<...>-<ID of file order source>:<file name>
          
          • The concatenated <ID of file order source>:<file name> can, in some cases, exceed the 255-character limit if the combination of file order source ID and file name is very long.
      • Impact:
        • The History Service cannot process Order IDs exceeding 255 characters and throws the exception:
          ... SOSHibernateObjectOperationException: could not execute statement: String or binary data would be truncated...
        • This exception is logged in both joc.log and history-service.log.
        • The History Service retries 5 times and then stops permanently, preventing further historical tracking.

      Desired Behaviour

      • The History Service should not stop if an Order ID exceeds 255 characters.
      • History entries should be created and visible in the GUI.
      • The Order ID should be truncated (ending with ...) where required.
      • The Order Log should display the full (non-truncated) Order ID, including all branches if fork instructions are configured.

      Workaround / Recommended Actions:

      • Avoid processing orders via File Watching if they may produce very long file order source IDs or file names.
      • To get the History Service running again:
        • The History Service stores the last processed Event IDs in the database table JOC_VARIABLES.TEXT_VALUE.
          • Locate a row where the NAME is prefixed with history_
            • Example: history_my_controller_id
              • my_controller_id corresponds to the Controller ID
          • Identify the startEventId from the exception thrown by the History Service.
            • The exception contains the attempted database values, e.g.:
              DBItemHistoryOrder[id=<null>, ..., startEventId=1774867587314001, ...]
          • Use the provided js7_datetime_eventid_converter.html to calculate a later valid JS7 EventId.
          • Update JOC_VARIABLES.TEXT_VALUE with an EventId that points to a time after the failing event, or alternatively to a time range where no File Watching-based orders were processed.
          • Restart the History Service from the JOC Cockpit Dashboard.

      Test Instructions

      • Prerequisites
        • Use the attached example (Windows), which includes:
          • a file order source with an extremely long name
          • a corresponding workflow that:
            • is triggered on file arrival
            • creates a fork with 2 branches
            • contains a prompt instruction
            • deletes the file
      • Test 1: Normal Execution
        • Configure and deploy the file order source and workflow
        • Place the attached file 0123456789.txt into the monitored directory
          • Expected Behavior
            • The order execution stops at the Prompt instruction and waits for confirmation
            • A history entry is created and visible in the GUI
              • The Order ID is truncated (ends with ...)
              • The Order Log:
                • contains all executed instructions (start, fork, branches)
                • shows the full (non-truncated) Order ID, including all branches
        • Confirm the Prompt
          • Expected Behavior
            • The history entry is correctly updated
      • Test 2: Resume after JOC/History Service Restart
        • Repeat Test 1 until the Prompt is reached
        • Before confirming the prompt, restart the History Service
        • Confirm the Prompt
          • Expected Behavior
            • Same behavior as in Test 1:
              • The history entry is correctly created/updated
              • No conflicts or inconsistencies occur

      Attachments

        Activity

          People

            re Robert Ehrlich
            re Robert Ehrlich
            Ajay Kumbhkar Ajay Kumbhkar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: