Isomorphic,
I am invoking a method using a data source and trying to get the data from this DMI through callback as shown Below.
In my DMI, i am actually setting the data by creating an object of class UserInfo as shown below.
I tried all getAttribute functions to retrieve user names, but none of them are giving me the correct user name and host.
Let me know how can i achieve this.
I am invoking a method using a data source and trying to get the data from this DMI through callback as shown Below.
Code:
DataSource dataSource = DataSource.get("dateRange");
DSRequest dataRequest = new DSRequest();
dataSource.fetchData(createCriteria(), new DSCallback() {
@Override
public void execute(DSResponse dsResponse, Object o, DSRequest dsRequest) {
Record r = dsResponse.getData()[0];
String userName= r.getAttributeAsString("userName");
String host = r.getAttributeAsString("host");
}
}, dataRequest);
Code:
UserInfo objUserInfo = new UserInfo();
objUserInfo.setUserName("ABC");
dsResponse.setData(objUserInfo);
return dsResponse;
Code:
public class UserInfo {
private String userName;
private String host;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
}
I tried all getAttribute functions to retrieve user names, but none of them are giving me the correct user name and host.
Let me know how can i achieve this.
Comment