Skip to main content
5-Regular Member
May 16, 2023
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 

 

 

HelesicPetr
22-Sapphire II
May 16, 2023

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

HelesicPetr
22-Sapphire II
May 16, 2023

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

Translate
5-Regular Member
May 18, 2023

Hi Helesic,

 

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

Thanks,

Vishvanatha

Translate
HelesicPetr
22-Sapphire II
May 18, 2023

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

Translate