My requirement is to use a webject to create windchill objects by means of thingworx service. It'll be helpful if there are any practical examples available. I'm new to windchill and thingworx.
Hello Saran,
I am a Windchill guy so I can comment from Windchill side. You can use below webject to create WTPart (one of the windchill object):
I am not sure how this webject can be used from ThingWorx to communicate with Windchill. Apologize for that.
<!-- Query Product create objects in specific product --> <ie:webject name="Query-Objects" type="OBJ"> <ie:param name="INSTANCE" data="$(properties[0]wt.federation.ie.VMName[0])"/> <ie:param name="ATTRIBUTE" data="name"/> <ie:param name="GROUP_OUT" data="container"/> <ie:param name="WHERE" data="name='CustomizationTraining17'"/> <ie:param name="TYPE" data="wt.inf.container.WTContainer"/> </ie:webject> <ie:webject name="Create-Objects" type="ACT"> <ie:param name="INSTANCE" data="$(properties[0]wt.federation.ie.VMName[0])"/> <ie:param name="ATTRIBUTE" data="name,number" delim=","/> <ie:param name="GROUP_OUT" data="parts"/> <ie:param name="TYPE" data="wt.part.WTPart"/> <ie:param name="FIELD" data="folder='/Default'"/> <ie:param name="CONTAINER_REF" data="${container[0]obid[0]}"/> <ie:param name="FIELD" data="name='<%=var%>'"/> <ie:param name="FIELD" data="folder='/Default'"/> </ie:webject>
I hope you found this webject example useful.
Regards,
Shirish
Hi Shirish,
Thanks for your reply. I'm a beginner in Thingworx too. I'm working out some examples given in the Windchill Extension (for thingworx) Guide.
/*
* The ExecuteTask service takes as arguments an InfoTable of IEProperty
* DataShape defining the tasks parameters, a String defining the URI of
* the task to execute, and an optional InfoTable defining objects to use as
* the tasks input group. For this task, define the parameters and the task URI
*/
/* construct the InfoTable defining the parameters */
var params = {
infoTableName : "InfoTable",
dataShapeName : "IEProperty"
};
var inputParams = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
/* IEProperty DataShape has the fields name and value */
inputParams.AddRow({
name: 'name', //this is the name of the parameter
value: name //and it's value - which is the argument to this service
});
/* now call the ExecuteTask service */
var params = {
params: inputParams,
dataShape: 'WNCObjectDS', //replace with name of your data shape
uri: 'com/ptc/windchill/example/queryPartByName.xml', //task to invoke
objects: undefined //task does not take input group of objects; leave undefined
};
var result = me.ExecuteTask(params);
Here you can see that the webjects location is used to somehow create the connection between TWX and Windchill. Hope i have shed some light on your doubt. I have attached the guide for your reference.
Thanks and Regard,
Saran
Any news on this?
Hi @gbirnzain
I used a Navigate Extension service to create a windchill object instead of using a webject