CallCronProfile
Configuration file |
None. |
Class name |
com.ebd.hub.datawizard.customresp.CallCronProfile |
Description
This class offers an extension of the functionality of the classes DefaultWebServiceResponse and PassBackDataResponse (also DefaultWebServiceResponseBinary and PassBackBinaryDataResponse), which is capable of sending back the target data of a profile (with Input Agent "HTTP") to a requesting HTTP client.
Usually, if you need to build a chain of profiles, you would do so via a Response "Message" to the subsequent profile. Unfortunately, sending back a response to a requesting HTTP client from the following profile would not be possible in that case if the profile chain is longer than one step. The class CallCronProfile is able to directly call a following profile (has to be active and has to have an Input Agent of type Cron Job) without the use of messages between the profiles and is capable to receive and pass on a DefaultWebServiceResponse from that profile (given that the following profile uses the class DefaultWebServiceResponse in one of its Responses) to the HTTP client that has sent the request. The encoding in the following profile has to be set to "UTF8".
The procedure is similar to a profile chaining by messages, but the target profile does not have to use an input agent of type Message. The field Additional parameters has to contain the name of the following profile.
Variables
This class returns values of variables with Prefix MSG_CALL_ and system variables VAR_RESPONSE_HTTP_HEADER_* back from the called profile if those variables are also defined in the calling profile. The easiest way to illustrate this is by means of an example.
Profile A has an Input Agent of type HTTP.
Profile A has a variable MSG_CALL_Demo. Its value after the mapping is hello.
Profile A has a variable VAR_RESPONSE_HTTP_HEADER_resp_status. Its value after the mapping is 200.
Profile A calls profile B in phase 6 with class CallProfile.
Profile B also has a variable MSG_CALL_Demo, but with value hello world.
Profile B also has a variable VAR_RESPONSE_HTTP_HEADER_resp_status, but with value 202.
Profile B has a variable VAR_RESPONSE_HTTP_HEADER_limbo with value 202.
Profile B uses class DefaultWebserviceResponse or PassBackDataResponse in phase 6.
In the end, profile A has the value hello world for its variable MSG_CALL_Demo and the value 202 for its variable VAR_RESPONSE_HTTP_HEADER_resp_status. In an additional Response (in profile A), those values can be used and passed back the HTTP caller with the custom class DefaultWebserviceResponse. Since profile A has no variable VAR_RESPONSE_HTTP_HEADER_limbo, the value from profile A cannot be assumed.