Set Cache Method of remote thing via service
Hi everybody,
I am not able to set the Cache Method of a Remote Thing Template created via services.
I am using the AddPropertyDefinition function. Since there is no option to set cacheTime directly, I included it in the remoteBindingAspects option, but I am not sure the syntax is correct or whether I can even do that or not:
var remoteAspects={
cacheTime:-1,
};
var params = {
// defaultValue: undefined /* STRING */,
remoteBindingAspects: remoteAspects /* JSON */,
// description: undefined /* STRING */,
// readOnly: undefined /* BOOLEAN */,
type: me.PressProps.rows[i].DataType /* BASETYPENAME */,
remote: true /* BOOLEAN */,
// remotePropertyName: undefined /* STRING */,
// timeout: undefined /* INTEGER */,
// pushType: undefined /* STRING */,
// dataChangeThreshold: undefined /* NUMBER */,
// logged: undefined /* BOOLEAN */,
name: me.PressProps.rows[i].PropertyName /* STRING */,
// pushThreshold: undefined /* NUMBER */,
dataChangeType: "ALWAYS" /* STRING */,
// category: undefined /* STRING */,
// persistent: undefined /* BOOLEAN */,
// dataShape: undefined /* DATASHAPENAME */
};
result= params;
ThingTemplates["Press_T"].AddPropertyDefinition(params);
}
I have also tried to set the cacheTime in the binding service I am using:
var n=me.PressProps.length; //Bind each property name with its source
for (var i=0; i<n; i++) {
var CompleteSource = me.PressProps.rows[i].PropertySource_pt1 +'['+PressID+']'+ me.PressProps.rows[i].PropertySource_pt2;
var aspects = {
industrialDataType: undefined,
tagAddress: CompleteSource,
scanRate: 1000,
tagType: "Static",
};
Things[PressName].SetRemotePropertyBinding({
propertyName: me.PressProps.rows[i].PropertyName,
sourcePropertyName: undefined,
aspects: aspects,
// cacheTime: -1, //need to enable this from template
});
}
This service is working fine when I apply it to Things that are not created through my template, but (this is my explaination) it does not let me override the default value given by my previously created template (cacheTime=0).
Any idea on how I could solve this issue?

