cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

how query based on soft attribute using queryspec

SB_10904295
7-Bedrock

how query based on soft attribute using queryspec

I have a WTDocument substype in that I have made one soft attribute and need to get WTDocument subtype based on the soft attribute value, what have created. How to query based on that soft attribute using queryspec and queryresult through code,

ACCEPTED SOLUTION

Accepted Solutions
avillanueva
22-Sapphire II
(To:SB_10904295)

6 REPLIES 6

Hi @SB_10904295 

What type is the soft attribute? Is it IBA Global attribute?

You need to be more specific but the solution already exists.

Here is a thread where you can find what you need

Query-spec-for-multiple-objects

PetrH

Hi @HelesicPetr 

Yes, it is a IBA Global attribute.

 

avillanueva
22-Sapphire II
(To:SB_10904295)

Hi @avillanueva 

I don't understand why PTC say it is not supported if the querySspec can be used for searching by the IBA

anyway 

very important point for a search objects by IBA by code

it is useful to create a database index on a StringValue table for a value and value2 column because a performance increases by 1000% and more

in my several cases the time was reduced from 6 seconds to 2ms per one call 

PetrH

You can determine the correct value to use via the logical attribute report page on your windchill server. Plug in your custom type, and a report is generated. Look for the external form, and plug that into the load and get functions in the Java code below.

<Windchill Server URL>/Windchill/netmarkets/jsp/lwcType/logicalAttributeReport.jsp

com.ptc.core.lwc.server.PersistableAdapter persistAdapObj = new com.ptc.core.lwc.server.PersistableAdapter((wt.fc.Persistable) doc, null,java.util.Locale.US, new com.ptc.core.meta.common.SearchOperationIdentifier());	
persistAdapObj.load("IBA|PTC_DD_LANGUAGE");	
String strValue = (String) persistAdapObj.get("IBA|PTC_DD_LANGUAGE").toString();
System.out.println("Attribute Value-"+strValue);

 

Please ignore this, I misunderstood the question, this thread is about querying based on a soft attribute, not getting it.

Announcements

Top Tags