Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    RequestTransformer.transformRequest(DSRequest) and existing parameters

    Is there a way to to access any existing parameters already set on the DSRequest passed into RequestTransformer.transformRequest?

    I have a scenario where some parameters are being set by a DSRequest being passed into DataSource.performCustomOperation, then within the RequestTransformer.transformRequest method, it too is setting some parameters using setParams, however, the parameters set in transformRequest wipe out the parameters set by the DSRequest passed into performCustomOperation.

    I was looking for a way to "add" parameters to the DSRequest by doing something like:

    Code:
    Map<String, String> params = dsRequest.getParams();
    if (params == null) params = new HashMap<String, String>();
    params.put(paramKey, paramValue);
    dsRequest.setParams(params);
    Any help would be appreciated.

    Thanks
    Last edited by stonebranch2; 27 May 2014, 16:46.

    #2
    A coworker kindly provided me what I was looking for.

    Code:
                Map params = dsRequest.getAttributeAsMap("params");
                if (params == null) params = new LinkedHashMap<String, String>();
                params.put(paramKey, paramValue);
                dsRequest.setParams(params);

    Comment

    Working...
    X