User Tools

Site Tools


changevalueobjectpropertiesscripts

This is an old revision of the document!


Scripts to Change Properties of ValueObjects

These examples demonstrate how to change ValueObject properties. ValueObjects (for example, LongValueObject,DoubleValueObject,and StringValueObject) all have these properties:

  • Value
  • Quality (0=good quality, all others are various levels of not good)
  • Timestamp
  • Color (usually null)
  • Locale
  • AlwaysSend (usually false, so the connector is in control of whether to pass the data or not)

Change the data quality of a value

//this changes the data quality of the incoming ValueObject to bad quality
var ValueObjectInterface = Java.type("com.ergotech.valueobjects.ValueObjectInterface");
 
vo=incomingValue;
vo.setQuality(ValueObjectInterface.QUALITY_BAD); //bad quality is 2000
vo;

Some data sources will generate valueobjects with AlwaysSend set to true which overrides settings on connectors. Sometimes this needs to be changed.

Change the AlwaysSend property of a ValueObject

//this changes the AlwaysSend of the incoming ValueObject to false
var ValueObjectInterface = Java.type("com.ergotech.valueobjects.ValueObjectInterface");
 
vo=incomingValue;
vo.setAlwaysSend(false); 
vo;
changevalueobjectpropertiesscripts.1589432677.txt.gz · Last modified: by wikiadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki