To get access to the previous state of an triggering event in Jython, I know I must use:
event.oldItemState
However, there’s no oldItemState
entry in an item’s dict, as the following example shows:
Item 'AT_Shutter_N' has dir = ['UID', '__class__', '__copy__', '__deepcopy__', '__delattr__', '__doc__', '__ensure_finalizer__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__subclasshook__', '__unicode__', 'acceptedCommandTypes', 'acceptedDataTypes', 'addGroupName', 'addGroupNames', 'addStateChangeListener', 'addTag', 'addTags', 'category', 'class', 'commandDescription', 'commandDescriptionService', 'dispose', 'equals', 'eventPublisher', 'getAcceptedCommandTypes', 'getAcceptedDataTypes', 'getCategory', 'getClass', 'getCommandDescription', 'getGroupNames', 'getLabel', 'getName', 'getState', 'getStateAs', 'getStateDescription', 'getTags', 'getType', 'getUID', 'groupNames', 'hasTag', 'hashCode', 'isAcceptedState', 'itemStateConverter', 'label', 'name', 'notify', 'notifyAll', 'removeAllTags', 'removeGroupName', 'removeStateChangeListener', 'removeTag', 'send', 'setCategory', 'setCommandDescriptionService', 'setEventPublisher', 'setItemStateConverter', 'setLabel', 'setState', 'setStateDescriptionService', 'setUnitProvider', 'state', 'stateDescription', 'stateDescriptionService', 'tags', 'toString', 'type', 'unitProvider', 'wait']
And when retrieving dir(item.state)
, then I can’t find it either:
The state of item 'AT_Shutter_N' has dir = ['HUNDRED', 'ZERO', '__class__', '__copy__', '__deepcopy__', '__delattr__', '__doc__', '__ensure_finalizer__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__subclasshook__', '__unicode__', 'as', 'byteValue', 'class', 'compareTo', 'doubleValue', 'equals', 'floatValue', 'format', 'getClass', 'hashCode', 'intValue', 'longValue', 'notify', 'notifyAll', 'shortValue', 'toBigDecimal', 'toFullString', 'toString', 'valueOf', 'wait']
Is there a way to get the previous (different) state from an item in JSR223 Jython, or is this not yet supported?