Announcement

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

    #16
    Ah, right. I did not set that. Thanks!

    My update goes something like this:

    update one datasource, and inside that I update another datasource
    Code:
    			DSRequest request = new DSRequest(DataSources.EMPLOYEE_DS,
    					DataSource.OP_UPDATE);
    			request.setRequestContext(dsRequest.getRequestContext());
    			HashMap<String, Object> employeeUpdate = ... values to update the related datasource
    			request.setValues(employeeUpdate);
    			try {
    				employeeUpdateResponse = request.execute();
    				DataSource ds = employeeUpdateResponse.getDataSource();
    				if (ds == null) {
    					ds = dsRequest.getRPCManager().getDataSource(
    							DataSources.EMPLOYEE_DS);
    					employeeUpdateResponse.setDataSource(ds);
    				
    					employeeUpdateResponse.setProperty("operationType", DataSource.OP_UPDATE);  //THIS WAS MISSING
    				}
    
    DataSource.OP_UPDATE
    			} catch (Exception e) {
    				// TODO Auto-generated catch block
    				e.printStackTrace();
    			}
    I found it kind of strange that the response did not have the DataSource set (and apparently not the operator either).

    Is there a way to make a request like this without having to manually set all these values in the DSResponse?

    Comment


      #17
      If this DSResponse coming from a custom DataSource? Maybe your own custom DataSource code isn't providing the DataSource and operationType?

      Comment

      Working...
      X