Skip to main content
5-Regular Member
May 16, 2023
Solved

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

  • May 16, 2023
  • 1 reply
  • 5058 views

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 

 

 

Best answer by HelesicPetr

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

1 reply

HelesicPetr
22-Sapphire II
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

5-Regular Member
May 18, 2023

Hi Helesic,

 

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

Thanks,

Vishvanatha

HelesicPetr
22-Sapphire II
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