Is it possible to execute a function once a HTTP Request has finished ?

Is it possible to execute a function once a HTTP Request has finished ?

sebastien_b49
Advocate Advocate
102 Views
0 Replies
Message 1 of 1

Is it possible to execute a function once a HTTP Request has finished ?

sebastien_b49
Advocate
Advocate

Hi @philboboADSK , @moehlmann_fe , @ralf_gruber !

I'd like to know if it was possible to have the following when defining a HTTP Request in FlexSim:

 

- FlexSim sends an asychronous HTTP Request with send()

- The server works on the request and sends a response back

- FlexSim execute a user command function when the HTTP Response is received.

 

I tried defining the successcallback property of the HTTP Request being a user command but no success. I used Model.find("Tools/User Commands/functionName"). The manual was not clear for me if the callback could be a function or just a node where the response would be written.


I read an older solution here  that uses applicationcommand. Yet the result option is just a node where the text data of the response is written and not a function that is executed. I tried this with callback also but without success either.

 

Is such a behaviour possible where a user command is executed when a HTTP Response is received ?

0 Likes
103 Views
0 Replies
Replies (0)