How to Query on RTC multi select checkbox
I have an attribute named "Systems" which is a multiselect check box having values like "Blue, Red, Green".
I want to query on this multiselect checkbox but this returns the literals of the values like subsystem.literal.l2,subsystem.literal.l3 and not the actual value (Blue, Red...). How can we query on a multiselect checkbox so that it returns the values ? I am using RTC 3.0.1.1
2 answers
had to use an answer for the length of this text
to get the values of the literals, you will have to resolve each one.
the model changed for the new multi type in 4.x
from my example
List<iliteral> enumerationLiterals = enumeration
.getEnumerationLiterals();
for (ILiteral literal : enumerationLiterals)
{
if (literal.getIdentifier2()
.getStringIdentifier()
.equalsIgnoreCase(iaval[1]))
{
System.out
.println("\t\t\t\t --> attribute id="
+ ia.getIdentifier()
+ ", type"
+ "="
+ ia.getAttributeType()
+ " literal="
+ literal
.getIdentifier2()
.getStringIdentifier()
+ " literal name="
+ literal.getName());
break;
}
}
to get the values of the literals, you will have to resolve each one.
the model changed for the new multi type in 4.x
from my example
List<iliteral> enumerationLiterals = enumeration
.getEnumerationLiterals();
for (ILiteral literal : enumerationLiterals)
{
if (literal.getIdentifier2()
.getStringIdentifier()
.equalsIgnoreCase(iaval[1]))
{
System.out
.println("\t\t\t\t --> attribute id="
+ ia.getIdentifier()
+ ", type"
+ "="
+ ia.getAttributeType()
+ " literal="
+ literal
.getIdentifier2()
.getStringIdentifier()
+ " literal name="
+ literal.getName());
break;
}
}