Data collection PersistRegexSelectorStrategy issue

Problem:
I’d like to store some metrics of a H3C device when entPhysicalClass=8(sensor) or entPhysicalClass=9(module), so I created the following data-collection:

      <persistenceSelectorStrategy class="org.opennms.netmgt.collectd.PersistRegexSelectorStrategy">
         <parameter key="match-expression" value="(#entPhysicalClassText == 'sensor') or (#entPhysicalClassText == 'module')"/>
      </persistenceSelectorStrategy>
      <storageStrategy class="org.opennms.netmgt.collection.support.IndexStorageStrategy"/>
   </resourceType>
   <group name="H3CEntityTable" ifType="all">
      <mibObj oid=".1.3.6.1.2.1.47.1.1.1.1.2" instance="H3C-EntityIndex" alias="entPhysicalDescr" type="string"/>
      <mibObj oid=".1.3.6.1.2.1.47.1.1.1.1.5" instance="H3C-EntityIndex" alias="entPhysicalClass" type="integer"/>
      <mibObj oid=".1.3.6.1.4.1.25506.2.6.1.1.1.1.6" instance="H3C-EntityIndex" alias="hh3cEntityExtCpuUsage" type="integer"/>
      <mibObj oid=".1.3.6.1.2.1.47.1.1.1.1.7" instance="H3C-EntityIndex" alias="entPhysicalName" type="string"/>
      <mibObj oid=".1.3.6.1.4.1.25506.2.6.1.1.1.1.8" instance="H3C-EntityIndex" alias="hh3cEntityExtMemUsage" type="integer"/>
      <mibObj oid=".1.3.6.1.4.1.25506.2.6.1.1.1.1.12" instance="H3C-EntityIndex" alias="hh3cEntityExtTemperature" type="integer"/>
      <property instance="H3C-EntityIndex" alias="entPhysicalClassText" class-name="org.opennms.netmgt.collectd.EnumLookupPropertyExtender">
         <parameter key="enum-attribute" value="entPhysicalClass"/>
         <parameter key="1" value="other"/>
         <parameter key="2" value="unknown"/>
         <parameter key="3" value="chassis"/>
         <parameter key="4" value="backplane"/>
         <parameter key="5" value="container"/>
         <parameter key="6" value="powerSupply"/>
         <parameter key="7" value="fan"/>
         <parameter key="8" value="sensor"/>
         <parameter key="9" value="module"/>
         <parameter key="10" value="port"/>
         <parameter key="11" value="stack"/>
      </property>
   </group> 

Here are the debug logs and as you can see the match-expression filters seems working fine:

2022-04-27 14:43:03,685 DEBUG [Collectd-Thread-3-of-50] o.o.n.c.s.AbstractCollectionAttribute: Visiting attribute node[314].H3C-EntityIndex[146].entPhysicalDescr [.1.3.6.1.2.1.47.1.1.1.1.2] = MODULE LEVEL2
2022-04-27 14:43:03,685 DEBUG [Collectd-Thread-3-of-50] o.o.n.c.s.AbstractCollectionAttribute: Visiting attribute node[314].H3C-EntityIndex[146].entPhysicalClass [.1.3.6.1.2.1.47.1.1.1.1.5] = 9
2022-04-27 14:43:03,685 DEBUG [Collectd-Thread-3-of-50] o.o.n.c.s.AbstractCollectionAttribute: Visiting attribute node[314].H3C-EntityIndex[146].hh3cEntityExtCpuUsage [.1.3.6.1.4.1.25506.2.6.1.1.1.1.6] = 0
2022-04-27 14:43:03,685 DEBUG [Collectd-Thread-3-of-50] o.o.n.c.s.AbstractCollectionAttribute: Visiting attribute node[314].H3C-EntityIndex[146].entPhysicalName [.1.3.6.1.2.1.47.1.1.1.1.7] = SubCard0
2022-04-27 14:43:03,685 DEBUG [Collectd-Thread-3-of-50] o.o.n.c.s.AbstractCollectionAttribute: Visiting attribute node[314].H3C-EntityIndex[146].hh3cEntityExtMemUsage [.1.3.6.1.4.1.25506.2.6.1.1.1.1.8] = 0
2022-04-27 14:43:03,685 DEBUG [Collectd-Thread-3-of-50] o.o.n.c.s.AbstractCollectionAttribute: Visiting attribute node[314].H3C-EntityIndex[146].hh3cEntityExtTemperature [.1.3.6.1.4.1.25506.2.6.1.1.1.1.12] = 34
2022-04-27 14:43:03,685 DEBUG [Collectd-Thread-3-of-50] o.o.n.c.s.AbstractCollectionAttribute: Visiting attribute node[314].H3C-EntityIndex[146].entPhysicalClassText [property:entPhysicalClassText] = module
2022-04-27 14:43:03,685 DEBUG [Collectd-Thread-3-of-50] o.o.n.c.PersistRegexSelectorStrategy: shouldPersist: checking (#entPhysicalClassText == 'sensor') or (#entPhysicalClassText == 'module') ? true

When I query the resources via Karaf I do not see the H3C-EntityIndex resource and I also get an error:

admin@opennms()> opennms:show-measurement-resources --node HP:23120 --no-children

ID:         node[HP:23120]
Name:       HP:23120
Label:      mln067448-rtr-023120
Type:       Node
Link:       element/node.jsp?node=HP:23120
Children:
  node[HP:23120].nodeSnmp[]
  node[HP:23120].interfaceSnmp[Vlan_interface2-3822d61260b3]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_19-3822d61260db]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_1-3822d61260c9]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_9-3822d61260d1]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_18-3822d61260da]
  node[HP:23120].interfaceSnmp[Vlan_interface929-3822d61260b3]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_8-3822d61260d0]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_20-3822d61260dc]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_3-3822d61260cb]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_2-3822d61260ca]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_21-3822d61260dd]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_17-3822d61260d9]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_23-3822d61260df]
  node[HP:23120].interfaceSnmp[Vlan_interface50-3822d61260b3]
  node[HP:23120].interfaceSnmp[Vlan_interface933-3822d61260b3]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_22-3822d61260de]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_13-3822d61260d5]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_24-3822d61260e0]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_12-3822d61260d4]
  node[HP:23120].interfaceSnmp[Vlan_interface904-3822d61260b3]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_11-3822d61260d3]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_10-3822d61260d2]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_16-3822d61260d8]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_7-3822d61260cf]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_6-3822d61260ce]
  node[HP:23120].interfaceSnmp[Vlan_interface1-3822d61260b3]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_15-3822d61260d7]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_5-3822d61260cd]
  node[HP:23120].interfaceSnmp[NULL0-000000000000]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_14-3822d61260d6]
  node[HP:23120].interfaceSnmp[GigabitEthernet1_0_4-3822d61260cc]
  node[HP:23120].responseTime[10.246.216.31]
Error executing command: Type must be a valid identifier

Also, if I try:

<persistenceSelectorStrategy class="org.opennms.netmgt.collectd.PersistRegexSelectorStrategy">
         <parameter key="match-expression" value="(#entPhysicalClass == '8') or (#entPhysicalClass == '9')"/>
      </persistenceSelectorStrategy>

or

<persistenceSelectorStrategy class="org.opennms.netmgt.collectd.PersistRegexSelectorStrategy">
         <parameter key="match-expression" value="(#entPhysicalClass == 8) or (#entPhysicalClass == 9)"/>
      </persistenceSelectorStrategy>    

the PersistRegexSelectorStrategy gets a false result:

2022-04-27 12:38:48,027 DEBUG [Collectd-Thread-9-of-50] o.o.n.c.PersistRegexSelectorStrategy: shouldPersist: checking resource node[314].H3C-EntityIndex[146]
2022-04-27 12:38:48,027 DEBUG [Collectd-Thread-9-of-50] o.o.n.c.a.AttributeGroup: Visiting Group AttrGroupType[name=H3CEntityTable, ifType=all] for 146@fs/HP/23120
2022-04-27 12:38:48,027 DEBUG [Collectd-Thread-9-of-50] o.o.n.c.s.AbstractCollectionAttribute: Visiting attribute node[314].H3C-EntityIndex[146].entPhysicalDescr [.1.3.6.1.2.1.47.1.1.1.1.2] = MODULE LEVEL2
2022-04-27 12:38:48,027 DEBUG [Collectd-Thread-9-of-50] o.o.n.c.s.AbstractCollectionAttribute: Visiting attribute node[314].H3C-EntityIndex[146].entPhysicalClass [.1.3.6.1.2.1.47.1.1.1.1.5] = 9
2022-04-27 12:38:48,027 DEBUG [Collectd-Thread-9-of-50] o.o.n.c.s.AbstractCollectionAttribute: Visiting attribute node[314].H3C-EntityIndex[146].hh3cEntityExtCpuUsage [.1.3.6.1.4.1.25506.2.6.1.1.1.1.6] = 0
2022-04-27 12:38:48,027 DEBUG [Collectd-Thread-9-of-50] o.o.n.c.s.AbstractCollectionAttribute: Visiting attribute node[314].H3C-EntityIndex[146].entPhysicalName [.1.3.6.1.2.1.47.1.1.1.1.7] = SubCard0
2022-04-27 12:38:48,027 DEBUG [Collectd-Thread-9-of-50] o.o.n.c.s.AbstractCollectionAttribute: Visiting attribute node[314].H3C-EntityIndex[146].hh3cEntityExtMemUsage [.1.3.6.1.4.1.25506.2.6.1.1.1.1.8] = 0
2022-04-27 12:38:48,027 DEBUG [Collectd-Thread-9-of-50] o.o.n.c.s.AbstractCollectionAttribute: Visiting attribute node[314].H3C-EntityIndex[146].hh3cEntityExtTemperature [.1.3.6.1.4.1.25506.2.6.1.1.1.1.12] = 34
2022-04-27 12:38:48,027 DEBUG [Collectd-Thread-9-of-50] o.o.n.c.s.AbstractCollectionAttribute: Visiting attribute node[314].H3C-EntityIndex[146].entPhysicalClassText [property:entPhysicalClassText] = module
2022-04-27 12:38:48,027 DEBUG [Collectd-Thread-9-of-50] o.o.n.c.PersistRegexSelectorStrategy: shouldPersist: checking (#entPhysicalClass == 8) or (#entPhysicalClass == 9) ? false

Can you please help me on this issue?
Thanks

Expected outcome:
I’d like to store metrics related temperature, cpu and memory when entPhysicalClass=8(sensor) or entPhysicalClass=9(module)

OpenNMS version:
29.0.4