Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hi Everyone,
Is there a way for me to run a batch file (.bat) stored on the Windchill server using Workflows?
I found the following PTC support document:
https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS165653&lang=en&source=snippet
But I've not been able to get it to work as of yet. Does the above article seem correct, or is there another method that can be used?
Thanks in advance for your help!
Solved! Go to Solution.
Hi jmccormick-4,
I had done similar kind of testing long back. I am sharing steps for your reference. I hope it will help you.
- System.out.println("\n\n\t\t******I'm Going In*****************");
String pbo=primaryBusinessObject.toString();
- wt.fc.ObjectIdentifier oid =wt.fc.ObjectIdentifier.newObjectIdentifier(pbo);
- wt.part.WTPart part=(wt.part.WTPart) wt.fc.PersistenceHelper.manager.refresh(oid);
//get the Context
Context = part.getContainerName();
//get the Folder
Folder = part. getFolderPath();
- System.out.println("\n\n\t\t Context is ->"+ Context +"\n\t\t Folder is ->"+ Folder);
Thanks,
Shirish
Hi jmccormick-4,
I had done similar kind of testing long back. I am sharing steps for your reference. I hope it will help you.
- System.out.println("\n\n\t\t******I'm Going In*****************");
String pbo=primaryBusinessObject.toString();
- wt.fc.ObjectIdentifier oid =wt.fc.ObjectIdentifier.newObjectIdentifier(pbo);
- wt.part.WTPart part=(wt.part.WTPart) wt.fc.PersistenceHelper.manager.refresh(oid);
//get the Context
Context = part.getContainerName();
//get the Folder
Folder = part. getFolderPath();
- System.out.println("\n\n\t\t Context is ->"+ Context +"\n\t\t Folder is ->"+ Folder);
Thanks,
Shirish
Hi Shirish,
That's great that's exactly what I was looking for thanks for your help!
I was wondering if you could point me in the direction of somewhere were I can learn more about these expressions within Windchill:
System.out.println("\n\n\t\t******I'm Going In*****************"); String pbo=primaryBusinessObject.toString(); wt.fc.ObjectIdentifier oid =wt.fc.ObjectIdentifier.newObjectIdentifier(pbo); wt.part.WTPart part=(wt.part.WTPart) wt.fc.PersistenceHelper.manager.refresh(oid); //get the Context Context = part.getContainerName(); //get the Folder Folder = part. getFolderPath(); System.out.println("\n\n\t\t Context is ->"+ Context +"\n\t\t Folder is ->"+ Folder);
I want to use either the WT Part or EPM Document going through the robot (they will both go through this process). And I just want to extract the part number from the file, but I'm not sure what the equivalent of getContainerName would be for the part number.
Any help is greatly appreciated!
Many thanks,
Hi jmccormick-4,
You can learn more about Expression Robot from here:
http://support.ptc.com/cs/help/windchill_hc/wc102_hc/index.jspx?id=WFRobotsAbout&action=show
To extract the part number, you can use getNumber() API call.
I hope this help you!
Regards,
Shirish