Requests
Requests
All ExternalControlBroker subelements (e.g. HTTPRequest or LocalCommandRun) are based on Requests concept and share common structure.
Requests have common sub-elements to be able to form request bodies and to retrieve request responses:
Element | Element purpose |
---|---|
RequestChannel | List of channels (i.e. signals) and nestable channel-groups that are used to form the request body and can be used to trigger request sending (on any channel value change). |
RequestTranslator | Translator to use for composing request body (stream) from channel values. Different pre-made Translators come with CDP for processing JSON, CSV, application/x-www-form-urlencode (for HTTP POST) etc. And, if none of the existing translators fit the need custom translator can be created (creating your own Library for that and coding translator behavior in C++). |
ResponseChannel | List of channels and nestable channel-groups where request response translated values will be put into. |
ResponseTranslator | Translator to use for parsing request body (stream) and get required channel values out of that. Different pre-made translators come with CDP for processing JSON, CSV, application/x-www-form-urlencode etc. And, if none of the existing translators fit the need custom translator can be created (creating your own Library for that and coding translator behavior in C++). |
ValueMap | Optional list of signal and string value-pairs (ValueMaps) for use in translators, for converting signal numeric values to string equivalents (when needed). |
All requests have the below common properties, which control what events will cause the request - like a command or a web request - to be requested (i.e. triggered):
Property | Description |
---|---|
TriggerOnStartup<bool> | When set, request will be triggered immediately at system startup |
TriggerOnChange<bool> | When set, request will be triggered on any Request channel values change |
TriggerOnTimeout<double> | Interval in seconds (since last request made) to wait before automatically triggering new request. Set to 0 for no timeout feature. |
TriggerRouting<string> | Routed signal, property or parameter whose value edge change (i.e change from zero to non-zero or contrary) triggers new request. |
ResponseWaitTimeout<double> | Maximum time in seconds to wait for request response (before killing running request) |
Requests state can be observed via these read-only properties:
Property | Description |
---|---|
RequestCount | Total count of requests initiated since system start |
ResponseCount | Total count of responses received since system start. Note: If request is ended because of error or timeout, ResponseCount will not be increased. |
RequestBytes | Total number of bytes of request bodies of all requests made since system start |
ResponseBytes | Total number of bytes of response bodies of all successful responses received since system start |
Requests divide into two large groups:
- URLRequests - used to make requests by contacting a URL (Uniform Resource Locator)
- LocalCommandRun - used to execute commands on CDP controller
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.