Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-9948

The rest api returns task form with Date format that can't be displayed in any browsers

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Done
    • None
    • None
    • Workbench
    • None
    • False
    • False
    • NEW
    • NEW
    • Hide

      steps to reproduce on rhpam 7.11.1

      1. create a project from business-central
      2. create a data object that contains a field of type LocalDate
      for example:
      public java.time.LocalDateTime getTestDateTime()

      { return this.testDateTime; }

      public void setTestDateTime(java.time.LocalDateTime testDateTime)

      { this.testDateTime = testDateTime; }

      3. create a business process that contains a human task.
      define a process variable of the type created in step #2. map this variable as input with the human task.
      4. click the "Generate all forms" tab to create all of the forms for the process and human task.
      5. build and deploy the project
      6. retrieve the form contents via rest api(you coud use the swagger page /kie-server/docs)
      GET/server/containers/

      {containerId}

      /forms/tasks/

      {taskInstanceId}

      /content
      save the returned contents to a html file and open it through any browser.
      you should see the LocalDate field only shows MM/DD/YYYY without any real data.
      if you view the page source you find the similar contents like:
      <input name="testDate" type="Date" class="form-control" id="field_350556637931472E11" placeholder="Local Date" value="{year=2021, month=NOVEMBER, monthValue=11, dayOfMonth=14, dayOfWeek=SUNDAY, dayOfYear=318, era=CE, leapYear=false, chronology={calendarType=iso8601, id=ISO}}" pattern="(\d+)(|\/)(\d+)(?:|\/)(?\d+)\s+(\d+)\d+)(?:\d+))?(?:\.(\d+))?)?" >

      7. go to business-central -> task inbox -> click the human task in the process
      you should see all of the right values are in the form.

      Show
      steps to reproduce on rhpam 7.11.1 1. create a project from business-central 2. create a data object that contains a field of type LocalDate for example: public java.time.LocalDateTime getTestDateTime() { return this.testDateTime; } public void setTestDateTime(java.time.LocalDateTime testDateTime) { this.testDateTime = testDateTime; } 3. create a business process that contains a human task. define a process variable of the type created in step #2. map this variable as input with the human task. 4. click the "Generate all forms" tab to create all of the forms for the process and human task. 5. build and deploy the project 6. retrieve the form contents via rest api(you coud use the swagger page /kie-server/docs) GET/server/containers/ {containerId} /forms/tasks/ {taskInstanceId} /content save the returned contents to a html file and open it through any browser. you should see the LocalDate field only shows MM/DD/YYYY without any real data. if you view the page source you find the similar contents like: <input name="testDate" type="Date" class="form-control" id="field_350556637931472E11" placeholder="Local Date" value="{year=2021, month=NOVEMBER, monthValue=11, dayOfMonth=14, dayOfWeek=SUNDAY, dayOfYear=318, era=CE, leapYear=false, chronology={calendarType=iso8601, id=ISO}}" pattern="(\d+)( |\/)(\d+)(?: |\/)(? \d+)\s+(\d+) \d+)(?: \d+))?(?:\.(\d+))?)?" > 7. go to business-central -> task inbox -> click the human task in the process you should see all of the right values are in the form.

    Description

      When you make a rest call to retrieve the task form where a data object contains a LocalDate type it can't be shown on any browsers. The input box shows empty value. However, the page source shows something like:

      <input name="testDate" type="Date" class="form-control" id="field_350556637931472E11" placeholder="Local Date" value="{year=2021, month=NOVEMBER, monthValue=11, dayOfMonth=14, dayOfWeek=SUNDAY, dayOfYear=318, era=CE, leapYear=false, chronology={calendarType=iso8601, id=ISO}}" pattern="(\d+)(|\/)(\d+)(?:|\/)(?\d+)\s+(\d+)\d+)(?:\d+))?(?:\.(\d+))?)?" >

      As you can see, the value field contains the value in format of
      "{year=2021, month=NOVEMBER, monthValue=11, dayOfMonth=14, dayOfWeek=SUNDAY, dayOfYear=318, era=CE, leapYear=false, chronology={calendarType=iso8601, id=ISO}}"
      The browser shows empty value.

      The task, however, is displayed properly in business-central.

      Attachments

        Issue Links

          Activity

            People

              ftirados Francisco Javier Tirado Sarti
              ftirados Francisco Javier Tirado Sarti
              Jan Stastny Jan Stastny
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: