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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Retrieving specific softType objects

Naga_2000
10-Marble

Retrieving specific softType objects

How to get the specific softType objects of a WTDocument using QuerySpec and SearchCondition api's in windchill 12.1?

 

 

3 REPLIES 3
HelesicPetr
22-Sapphire I
(To:Naga_2000)

Hi @Naga_2000 

Same question from another one 😄

This way 

 

QuerySpec querySpec = new QuerySpec();
int idDocObject = querySpec.appendClassList(WTDocument.class, true);
try
{
	TypeIdentifier tiCheck = ClientTypedUtility.getTypeIdentifier("wt.doc.WTDocument|cz.in.Agenda");
	SearchCondition sc2 = TypedUtility.getSearchCondition(tiCheck, true);

	querySpec.appendWhere(sc2, idDocObject);

	QueryResult find = PersistenceHelper.manager.find((StatementSpec) querySpec);
	while (find.hasMoreElements())
	{
		Persistable[] nextobj = (Persistable[]) find.nextElement();
		WTDocument nextDoc = (WTDocument) nextobj[0];
	}

} catch (WTException e)
{
	throw new RuntimeException(e);
}

 

PetrH

 

Hi @HelesicPetr 

 

The getSearchCondition() method of TypedUtility API is not available in windchill 12.1

 TypedUtility.getSearchCondition(tiCheck, true)

 It was used in earlier versions i.e; below 12.1.

 

 

Naga

HelesicPetr
22-Sapphire I
(To:Naga_2000)

Hi @Naga_2000 

 

I really don't know what version of Windchill you use, but in my installation 12.1 the method exists and works. ()

HelesicPetr_0-1684483498085.png

check my debug results

HelesicPetr_2-1684483637346.png

 

PS: I checked version 12.1.2.2 and the class and method is also there. 

 

PetrH

Announcements

Top Tags