Uploaded image for project: 'Talend Component Kit'
  1. Talend Component Kit
  2. TCOMP-2342

httpclient - Guesschema displays dialogbox to execute the connector if it can't be inferred.

Apply templateInsert Lucidchart Diagram
    XMLWordPrintable

Details

    Description

      Currently, the HTTPClientProcessor guess schema is an internal service: https://github.com/Talend/connectors-ee/blob/319c22366076612dab2d1a3124d2ddf200ffd764/rest-improved/src/main/java/org/talend/components/restImproved/service/UIService.java#L70

      This service throws an exception if the processor can't infer schema without executing the job from input until the HTTPClientProcessor, which is currently forbidden: https://github.com/Talend/connectors-ee/blob/319c22366076612dab2d1a3124d2ddf200ffd764/rest-improved/src/main/java/org/talend/components/restImproved/service/UIService.java#L104

      In that case, it could be great if a dialog pops up in studio to ask user if it allows the execution in order to retrieve the schema.

       

      [EDIT]

      This second part is already referrenced in another ticker:  https://jira.talendforge.org/browse/TCOMP-2343 it's quite related by the "action" attribute.

      Currently, discovered schema is read in the standard output of the process executed to infer the schema. It would be possible to identify error output and, with some configuration, ask to popup a dilaog bow to ask the user if he is agree to execute the subjob to retrieve the real schema:

      // TCK - DISCOVERSCHEMA - ERROR
      {
      "error": "The schema can't be inferred.",
      "action": "execute"
      }

      [EDIT bis]

      It should not be an error since nominal guess schema path. The nominal path is:

      • Click guess schema
      • The service tries to infer schema using only configuration
      • it can't
      • Studio ask to user if he wants to execute the query to retrieve the payload
      • The service is called a second time
      • Execute the HTTP query
      • return the schema

      The ouput could be :

      { 
         "message": "The schema can't be inferred. It needs to execute the query.", 
         "type": "execute"
      }

      This will open a message popup and ask ti execute the mock job.

      or, if there is any error while guess schema:

      { 
         "message": "There has been an error: timeout.......", 
         "type": "error"
      }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ypiel Yves Piel
              Fabien Desiles Fabien Desiles
              emmanuel gallois, Fabien Desiles
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: