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
Hi All,
I spent a lot of time trying to get product structure form the windchill using webjects. The reason for this is that I'am involved in project at the university aiming to integrate Moodle and Windchill (pretty demanding). My part is to export product structure to file that will be later on uploaded to the students profile in the moodle and linked to particular task. So far I was able to create following webject but I was unable to get whole structure just info about first Part. I'am hopping if someone have suggestion what am i doing wrong or point me in right direction.
Thanks!
here is the code:
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>
<html>
<head>
</head>
<h1 align="Center">Query-Tree:Display-Table</h1>
<h2 align="Center">PRODUCT GOLF_CART</h2>
Dave, thank you for the answer. I tried different query combination but I always get out the result of query-object webject.
webject example:
<ie:webject name="Query-Objects" type="OBJ">
<ie:param name="instance"" data="lan.wctserver.Windchill"/">
<ie:param name="type"" data="WCTYPE|wt.part.WTPart"/">
<ie:param name="where"" data="number=GC00001*"/">
<ie:param name="attribute"" data="name,obid" delim=","/">
<ie:param name="group_out"" data="anObjects"/">
</ie:webject>
<ie:webject name="Query-Tree" type="OBJ">
<ie:param name="INSTANCE"" data="lan.wctserver.Windchill"/">
<ie:param name="TYPE"" data="wt.part.WTPartUsageLink"/">
<ie:param name="GROUP_IN"" data="anObjects"/">
<ie:param name="DIRECTION"" data="uses"/">
<ie:param name="DEPTH"" data="10"/">
<ie:param name="ATTRIBUTE"" data="obid,number,name" delim=","/">
<ie:param name="MODE"" data="nested"/">
<ie:param name="AUTO_NAVIGATE"" data="true"/">
<ie:param name="SELECTBY"" data="latest"/">
<ie:param name="OUTPUT_TYPE"" data="full"/">
<ie:param name="GROUP_OUT"" data="output"/">
</ie:webject>
the result is in the attachement. I was under impression that result of the query-tree webject given the reference to the first object should be other objects linked to the first (WTPartUsageLink). Maybe I am using wrong approach?
Thanks again.
In Reply to Dave DeMay:
Your query tree has no input group, object reference, or where condition.
See below:
<ie:webject name="Query-Tree" type="OBJ">
<ie:param name="ACCEPT_LANGUAGE"<br"/>
data="${@server[]accept_language[]}"/>
<ie:param name="ATTRIBUTE" data="attribute_name"/">
<ie:param name="AUTHORIZATION"<br"/>
data="${@server[]authorization[0]}"/>
<ie:param name="AUTO_NAVIGATE" data="[TRUE|FALSE]"/">
<ie:param name="CONNECTION_ATTEMPTS" data="attempts"/">
<ie:param name="CONNECTION_ATTEMPT_INTERVAL" data="interval"/">
<ie:param name="CONTAINER_REF" data="ufid"/">
<ie:param name="DBUSER" data="username"/">
<ie:param name="DEPTH" data="integer"/">
<ie:param name="DESCRIPTOR" data="attribute_name"/">
<ie:param name="DIRECTION" data="role-name"/">
<ie:param name="FORMAT" data="[TRUE" |=" false]"="/>
<ie:param name="GROUP_FILTER" data="group_name"/">
<ie:param name="GROUP_IN" data="group_name"/">
<ie:param name="GROUP_OUT" data="group_name"/">
<ie:param name="INCLUDE_ARGS" data="[TRUE" |=" false]"="/>
<ie:param name="INCLUDE_CONSTRAINTS" data="[TRUE" |=" false]"="/>
<ie:param name="INCLUDE_DESCRIPTORS" data="[TRUE" |=" false]"="/>
<ie:param name="INSTANCE" data="appl_name"/">
<ie:param name="MODE" data="[FLAT" |=" nested]"="/>
<ie:param name="NEXT_OP" data="operation_name"/">
<ie:param name="OBJECT_REF" data="ufid"/">
<ie:param name="OUTPUT_TYPE" data="[OTHER_SIDE" |=" full]"="/>
<ie:param name="PASSWD" data="password"/">
<ie:param name="SELECTBY" data="config_spec_name"/">
<ie:param name="SELECTBY_BASELINE_REF" data="baseline"/">
<ie:param name="SELECTBY_CONFIG_ITEM_REF" data="ufid"/">
<ie:param name="SELECTBY_DATE" data="date"/">
data="[TRUE | FALSE]"/>
<ie:param name="SELECTBY_INCLUDE_WORKING"<br"/>
data="[TRUE | FALSE]"/>
<ie:param name="SELECTBY_LIFECYCLE_STATE"<br"/>
data="lifecycle_state"/>
<ie:param name="SELECTBY_UNIT" data="unit_value"/">
<ie:param name="SELECTBY_VIEW_REF" data="view_object_ufid"/">
<ie:param name="SESSION_ID" data="${session_id[]SESSION_ID[]}"/">
<ie:param name="TYPE" data="type_name"/">
<ie:param name="WHERE" data="where_clause"/">
</ie:webject>
Sorry, editor hid the comments, here is the code:
<ie:webject name="Query-Objects" type="OBJ">
<ie:param name="instance"" data="lan.wctserver.Windchill"/">
<ie:param name="type"" data="WCTYPE|wt.part.WTPart"/">
<ie:param name="where"" data="number=GC00001*"/">
<ie:param name="attribute"" data="name,obid" delim=","/">
<ie:param name="group_out"" data="anObjects"/">
</ie:webject>
<ie:webject name="Query-Tree" type="OBJ">
<ie:param name="INSTANCE"" data="lan.wctserver.Windchill"/">
<ie:param name="TYPE"" data="wt.part.WTPartUsageLink"/">
<ie:param name="OBJECT_REF"" data="VR:wt.part.WTPart:11664"/">
<ie:param name="GROUP_IN"" data="anObjects"/">
<ie:param name="where"" data="number=GC000001"/">
<ie:param name="DIRECTION"" data="uses"/">
<ie:param name="DEPTH"" data="10"/">
<ie:param name="ATTRIBUTE"" data="obid,number,name" delim=","/">
<ie:param name="MODE"" data="nested"/">
<ie:param name="AUTO_NAVIGATE"" data="true"/">
<ie:param name="SELECTBY"" data="latest"/">
<ie:param name="OUTPUT_TYPE"" data="full"/">
<ie:param name="GROUP_OUT"" data="output"/">
</ie:webject>
Regards,
Glen Herman
Sr Application Developer
Engineering And Technology
Trane Residential Systems
6200 Troup Hwy
Tyler, Texas, 75701
Glen,
thank your for answer. I solved my problem with good pointers given by David. Evan do manuals are not very supportive (if you are not already experience windchil customizer) the answer was embedded in description of one of Query-Tree webject attributes:
OBJECT_REF
Specifies the Unique Federation Identifier (UFID) of an existing object that serves as the base object, and returns all objects associated with this base object by the relationship specified in the TYPE parameter (and, recursively, all objects related to those objects). If this parameter is multi-valued, the multiple base objects are navigated, and the output group contains the combination of all objects associated
with multiple base objects by the link classes specified by TYPE. If this parameter is not specified, the GROUP_IN parameter must be specified. If this parameter and GROUP_IN are both specified, the multiple indicated base objects are navigated.
So I supply webject with the right ufid of the object of interest and got result I was looking for.
Best regards.
I'm not sure this is the answer you are looking for, but I would try testing a different SelectBy clause, where you query by View and SelectBy_View_Ref. It is what I would try next anyway. What I would be concerned with is when using "latest",you have two or more components in your structure that have the same version. Like Component X has versions (ManfView1) A.A.2 and (ManfView2) A.A.2. But if you don't have any of this, then it probably won't help.Regards,
Glen Herman
Sr Application Developer
Engineering And Technology
Trane Residential Systems
6200 Troup Hwy
Tyler, Texas, 75701