Skip to content

Underflow possible in PropertyValueCountTrigger implementation #992

Description

@RobertJacobsonCDC

This is a bug in the current implementation of the new PropertyValueCountTrigger in the new triggers module. See #991 for the fundamental cause; see #990 for a working demonstration of the failure.

Unfortunately, there doesn't appear to be a way to implement a simple property value count in client code outside of addressing #991. So in order to use this trigger we need to have some implementation outside of the triggers module in Ixa core, presumably in PropertyValueStoreCore<E, P>.

Some possibilities:

  1. Require any property you use with PropertyValueCountTrigger to be IndexableProperty and use ValueCountIndex to implement. Not great because it counts all values, not just the value of interest. Ok when number of distinct values is small.
  2. Require any property you use with PropertyValueCountTrigger to be IndexableProperty and implement a new single-value counter index. Properties could have many single value indexes, just like they can have many ValueChangeCountIndex instances (e.g. for daily, weekly incidence tracking).
  3. Implement a single-value counter index that doesn't require the property to be IndexableProperty. This is tricky: you'd need to search for the count of the property value of index, which is fine if you have <~10 values of interest but degrades quickly.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions