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

May I get some help? I have a webject and am confused on the where clause syntax.

Regular Member

May I get some help? I have a webject and am confused on the where clause syntax.

I use "Search-Objects". If get the name from the form input as Where condition. It works.

<ie:webject name="Search-Objects" type="OBJ">
<ie:param name="INSTANCE" data="localdomain.vm-windchill.Windchill"/>
<ie:param name="authorization" data="$(@SERVER[]AUTHORIZATION[0])"/>
<ie:param name="type" data="wt.epm.EPMDocument"/>
<ie:param name="where" data="(name='$(@FORM[]name[0])')"/>
<ie:param name="group_out" data="objectsSearched"/>
</ie:webject>

But if I define a String, then use it as the where condition .Like:

<%
String whereKeyWord = "C6720PD.CATDRAWING";
%>

Use the following syntax. The result is blank.

<ie:param name="WHERE" data="(name='<%=whereKeyWord%>')" />

Any help will be appreciated. Thank you so much!

4 REPLIES 4

Re: May I get some help? I have a webject and am confused on the where clause syntax.


Hello Linlin,

I can not see any syntactical error in your webject.

I just ran the below webject and i am getting the o/p as expected:

<%@page language="java"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>


<ie:webject name="Get-Properties" type="MGT">
<ie:param name="ATTRIBUTE" data="wt.federation.ie.VMName"/>
<ie:param name="GROUP_OUT" data="properties"/>
</ie:webject>

<%
String wherecondition = "PK_NS2";
%>

<ie:webject name="Search-Objects" type="OBJ">
<ie:param name="INSTANCE" data="$(properties[0]wt.federation.ie.VMName[0])"/>
<ie:param name="authorization" data="$(@SERVER[]AUTHORIZATION[0])"/>
<ie:param name="type" data="wt.part.WTPart"/>
<ie:param name="WHERE" data="(name='<%=wherecondition%>')"/ >
<ie:param name="attribute" data="number,name,version,lifeCycleState" delim=","/>
<ie:param name="group_out" data="objectsSearched"/>
</ie:webject>

When you get the name from form input, is it the same EPMDocument "C6720PD.CATDRAWING"?

Re: May I get some help? I have a webject and am confused on the where clause syntax.

Is the name case-sensitive? Using the above example from Prabash does it work for you?

Highlighted

Re: May I get some help? I have a webject and am confused on the where clause syntax.

Thanks to all of you for your help. It doesn't work for me either. I changed my code to get all values without where conditions , then use javascript to filter what I need. Thank you so much!

Re: May I get some help? I have a webject and am confused on the where clause syntax.

Instead of Search-Objects you could use Query-Objects it works!

<?xml version="1.0" standalone="yes"?>

<%@page language="java" access="http|soap" contentType="application/xml"%>

<%@taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>

<ie:webject name="Get-Properties" type="MGT">

    <ie:param name="ATTRIBUTE" data="wt.federation.ie.VMName"/>

    <ie:param name="GROUP_OUT" data="properties"/>

    <ie:param name="authorization" data="$(@SERVER[]AUTHORIZATION[0])"/>

</ie:webject>

<ie:webject name="Query-Objects" type="OBJ">

    <ie:param name="INSTANCE" data="${properties[0]wt.federation.ie.VMName[0]}"/>

    <ie:param name="WHERE" data="name=${@FORM[]name[0]}" />

    <ie:param name="TYPE" data="wt.epm.EPMDocument" />

    <ie:param name="ATTRIBUTE" data="name" />

    <ie:param name="authorization" data="$(@SERVER[]AUTHORIZATION[0])"/>

    <ie:param name="GROUP_OUT" data="out"/>

</ie:webject>

Announcements
LiveWorx Call For Papers Happening Now!