To display data for the User Task, it is required to query this data via web service (REST api) and once receive it, then it can be displayed for the user at the User Task to do Approve or Reject for it, so it is possible to write code in java file (the Form key) which will call this web service and get the required data and display it in the form of the User Task? Or it is better to use Service Task which will call the web service and get the returned data of this web service and then the Service Task will trigger the User Task through a signal which will read the stored variables and display it for the user?
By the way: the returned data of the web service that is called by the Service Task need to be stored as process variable to be able to retrieve it by the User Task?
Below are examples of what I was mean:
Scenario 1: User Task will have Form Key which is a java file that will call web service inside it:
Scenario 2: Service Task that will call the web service and store the returned data which will be used by User Task that will be triggered from Service Task through Signal Boundary Event:
Which one is recommended? And it is correct in Scenario 2 that the elements are not connected End to End?