# Update tag configuration allowed property choices

**URL:** <https://forum.inductiveautomation.com/t/update-tag-configuration-allowed-property-choices/90748>\
**Category:** 3rd Party Modules\
**Tags:** ignition81\
**Created:** [May 22, 2024, 5:04pm UTC](https://forum.inductiveautomation.com/t/update-tag-configuration-allowed-property-choices/90748 "2024-05-22T17:04:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 22, 2024, 5:04pm UTC](https://forum.inductiveautomation.com/t/update-tag-configuration-allowed-property-choices/90748/1 "2024-05-22T17:04:08Z")

</div>

@paul-griffith recently mentioned the `TagActor` subsystem that plays a key role in most tag value updates:

> [@Custom QualifiedValue](https://forum.inductiveautomation.com/t/custom-qualifiedvalue/90394/6):
>
> Everything in the new tag system is a tag actor. If it's flexible enough to drive tag values, including OPC, scaling, history, etc... I'm pretty confident it's flexible enough for your purposes. As a bonus, you can get it working today. We wouldn't add that feature to 8.1, so at minimum you're waiting until 8.3 is released at the end of this year. More likely much longer than that, because it's low priority relative to other customer demands. So, again, I'm not the expert in this …

Which sent me off down the rabbit hole, as I realized it would be a better hook than registering a historian sink for one of my current product development efforts. (A wide table history mechanism, FWIW.)

My gateway hook has this snippet in `.setup()`:

```python
        actorFactory = new TypeHistoryActorFactory();
        context.getTagManager().getConfigManager().registerActorFactory(actorFactory);

```

and that factory supplies some new tag properties like so:

```python
    @Override
    public void configureTagModel(MutableConfigurationPropertyModel model) {
        TypeHistoryTagProps.registerForTags(model);
    }

    @Override
    public void configureTagGroupModel(MutableConfigurationPropertyModel model) {
        TypeHistoryTagProps.registerForGroups(model);
    }

```

Those delegate here:

```python
    public static void registerForTags(MutableConfigurationPropertyModel model) {
        model.addProperties(TypeHistEnabled);
        model.addDependantProperties(TypeHistEnabled, Boolean.TRUE, TypeHistProvider, TypeHistTable, TypeHistColumn, TypeHistPeriod, TypeHistDriver);
        model.setAllowedValues(TypeHistProvider, typeHistProviderNames);
        model.setAllowCustomValue(TypeHistProvider, true);
    }

    public static void registerForGroups(MutableConfigurationPropertyModel model) {
        model.addProperties(TypeHistProvider, TypeHistTable, TypeHistPeriod);
        model.setAllowedValues(TypeHistProvider, typeHistProviderNames);
        model.setAllowCustomValue(TypeHistProvider, true);
    }

```

What I don't see is a way to cause these to be called again when `typeHistProviderNames` is changed, so the Designer will see the update.

Has anyone done this? (I'm aiming for the same behavior seen for Storage Provider when adding/removing native historian instances.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 22, 2024, 5:06pm UTC](https://forum.inductiveautomation.com/t/update-tag-configuration-allowed-property-choices/90748/2 "2024-05-22T17:06:06Z")

</div>

Hmmm. Closing and re-opening the tag editor made the list update.

I guess that's good enough for the moment. 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 22, 2024, 5:30pm UTC](https://forum.inductiveautomation.com/t/update-tag-configuration-allowed-property-choices/90748/3 "2024-05-22T17:30:25Z")

</div>

I suppose, since I'm teasing the future availability of this, I can show the tag property descriptions that go with the above properties:

### typeHistEnabled: Type History Enabled

> Whether to store history in wide tables, via the Type Historian from the Time Series DB Cache module.

### typeHistProvider: Type History Provider

> Wide Type Historian Provider Name. A default can be specified in the tag's group.

### typeHistTable: Type History Table

> Database Table name in the Wide Type Historian Provider's configured datasource, unquoted, case-sensitive. For tags in the root of a UDT, defaults to the last element of the UDT type name. Required otherwise.

### typeHistColumn: Type History Column

> Database Column name in the target table of the Wide Type Historian Provider's configured datasource, unquoted, case-sensitive. Defaults to last element of a UDT member name or atomic tag name.

### typeHistPeriod: Type History Period

> Type Historian recording interval, milliseconds. Default from the tag group if present, otherwise 5000ms is used. The effective period will be the minimum period per tag folder per target table. A default can be specified in the tag's group.

### typeHistDriver: Type History Driver

> Tag Path of Boolean driver for this tag's moment-to-moment recording. Null will be inserted in the target table when this is a valid path, and the subject boolean is false. When all tags in a folder for a table are null, only the first all-null row will be inserted. Can be a relative path. A default can be specified in the tag's group.

I was bogged down in the native historian's `HistorySink` maze prior to Paul's mention of tag actors the other day. Much simpler to capture the values I need with an actor.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 28, 2024, 3:39pm UTC](https://forum.inductiveautomation.com/t/update-tag-configuration-allowed-property-choices/90748/4 "2024-05-28T15:39:00Z")

</div>

> [@pturmel](#):
>
> Has anyone done this? (I'm aiming for the same behavior seen for Storage Provider when adding/removing native historian instances.

I'm not sure (after a few minutes of looking) where this happens.  
The native history factory does basically what you're doing:

```java
    @Override
    public void configureTagModel(MutableConfigurationPropertyModel model) {
        TagHistoryProps.register(model);
        model.setAllowedValues(
            TagHistoryProps.HistoryProvider,
            context.getHistoryManager().getStores(HistoryFlavor.SQLTAG)
        );
    }

```

I assume you're returning _all_ your relevant properties in `getMonitoredProperties`?

It's _possible_, though I'd like to think we wouldn't have done this, that this is all "faked" in the tag editor specifically for history providers, but I don't see evidence of that so far.
