Skip to main content
May 16, 2023 12:30 PM UTC
Solved

Based on IBA value how to get the document soft type using QuerySpec

Hi All,

 

In Windchill 12.1 Vesion below API is not supported and any alternative API?

 

SearchCondition sc = TypedUtility.getSearchCondition("WTYPE|WTDocument|my.softType", true);

 

My requirement is to get wtdocument softype as searchcondition then add to QuerySpec.

 

Thanks,

Vishvanatha 

 

 

May 16, 2023 12:58 PM UTC

Hello @VR_10417596 

Does the API exists? use it. Not supported means nothing.

 

Also you can try alternate one or write own method to crete it. 

 

WCTypeIdentifier typeID = CreateAndEditWizBean.newWCTypeIdentifier("WTYPE|WTDocument|my.softType");

 

 

this one is from the mentioned class CreateAndEditWizBean

 

 public static final WCTypeIdentifier newWCTypeIdentifier(String typeInput) {
 WCTypeIdentifier var1 = null;
 if (typeInput != null && !"".equals(typeInput)) {
 try {
 var1 = (WCTypeIdentifier)IDENTIFIER_FACTORY.newWCTypeIdentifier(typeInput);
 Class.forName(var1.getClassnameFromTypename());
 } catch (Exception var3) {
 if (log.isDebugEnabled()) {
 log.debug(" in getTypeIdentifier() trying to create WCTypeIdentifier from type: " + typeInput);
 }

 var1 = null;
 }
 }

 return var1;
 }

 

 

PS> here is example how to create SearchCondition

 

		ModeledTypeModel atmodel = new ModeledTypeModel();
		WCTypeIdentifier typeID = CreateAndEditWizBean.newWCTypeIdentifier("WTYPE|WTDocument|my.softType");
		try
		{
		SearchCondition sc = atmodel.getSearchCondition(typeID,true);
		} catch (WTException e)
		{
			throw new RuntimeException(e);
		}

PetrH

13 replies

May 16, 2023 12:58 PM UTC

Hello @VR_10417596 

Does the API exists? use it. Not supported means nothing.

 

Also you can try alternate one or write own method to crete it. 

 

WCTypeIdentifier typeID = CreateAndEditWizBean.newWCTypeIdentifier("WTYPE|WTDocument|my.softType");

 

 

this one is from the mentioned class CreateAndEditWizBean

 

 public static final WCTypeIdentifier newWCTypeIdentifier(String typeInput) {
 WCTypeIdentifier var1 = null;
 if (typeInput != null && !"".equals(typeInput)) {
 try {
 var1 = (WCTypeIdentifier)IDENTIFIER_FACTORY.newWCTypeIdentifier(typeInput);
 Class.forName(var1.getClassnameFromTypename());
 } catch (Exception var3) {
 if (log.isDebugEnabled()) {
 log.debug(" in getTypeIdentifier() trying to create WCTypeIdentifier from type: " + typeInput);
 }

 var1 = null;
 }
 }

 return var1;
 }

 

 

PS> here is example how to create SearchCondition

 

		ModeledTypeModel atmodel = new ModeledTypeModel();
		WCTypeIdentifier typeID = CreateAndEditWizBean.newWCTypeIdentifier("WTYPE|WTDocument|my.softType");
		try
		{
		SearchCondition sc = atmodel.getSearchCondition(typeID,true);
		} catch (WTException e)
		{
			throw new RuntimeException(e);
		}

PetrH

May 18, 2023 11:12 AM UTC

Hi Helesic,

 

I have tried this and its returning the soft type model type.

Thanks,

Vishvanatha

May 18, 2023 11:27 AM UTC

Hi @VR_10417596 

And can you share a example how it looks like ?

What are real data returned and what do you really expect ? 

 

PetrH