Windchill ant scripting 101 (primer)?
May 24, 2018
02:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
May 24, 2018
02:37 PM
Windchill ant scripting 101 (primer)?
Is there a go-to document or site that explains how to use ant with Windchill?
I have a lot of manual tasks to automate (deployments, admin tasks…) and have lots of catching up to do. If at least I could take a look at what ant can do, that may fill some of my requirements. So I'm starting with ant and will see how far I get with that.
Thanks!
JL
Running Windchill PDM/Link 10.1 M050 on UNIX RHEL5.
Labels:
- Labels:
-
Bus_System Administration
1 REPLY 1
Jun 04, 2018
10:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Jun 04, 2018
10:01 AM
refer
Article - CS259484
Frequent customization commands used
Created: 30-Mar-2017 | Modified: 30-Mar-2017 | Last Seen: 08-Sep-2017
Applies To
- Windchill PDMLink 10.0 to 11.0
Description
- Frequent customization commands used
- resourcebuild, tools.xml, enumCustomize
Resolution
Commands:
Name and Location of Resource bundles of Enumerated types, modeled class and non-modeled class
- ResourceBuild
ResourceBuild compiles rbInfo files from the /src directory instead of the /wtCustom directory , which is not a recommended practice. ant -f codebase/MakeJar.xml is needed its the execution.Ex. ResourceBuild com.ptc.ext.*
- ant -f bin/tools.xml bundle -Dbundle.input= [-Dbundle.source= -Dbundle.output=]
This command ant -f bin/tools.xml bundle -Dbundle.input=, which fonctions the same way as ResouceBuild, compiles rbInfo files from the /src directory.
Ex. ant -f bin/tools.xml bundle -Dbundle.input=com.acme.*
This command ant -f bin/tools.xml bundle -Dbundle.input= -Dbundle.source=, will compile rbInfo files from the directory defined by -Dbundle.source:
Ex. ant -f bin\tools.xml bundle -Dbundle.input=example.MySize.* -Dbundle.source=c:\temp
- ant -f bin/tools.xml bundle_custom -Dbundle.input=
This command compiles rbInfo files from the /wtCustom directory. ant -f codebase/MakeJar.xml is needed after its execution.
Ex. ant -f bin/tools.xml bundle_custom -Dbundle.input=com.ptc.ext.<your-rbinfo-files>
or run: ant -f bin/tools.xml bundle_custom -Dbundle.forceCompile=true -Dbundle.input=registry
After this, do not forget to run: ant -f codebase/MakeJar.xml custUpdate
Note: For Enumeration type, there is another way to do this, that is to user the utility EnumCustomize. After its execution, a corresponding folder structure will be created under /wtCustom.
Ex. ant -f bin/tools.xml bundle_custom -Dbundle.input=com.ptc.ext.<your-rbinfo-files>
or run: ant -f bin/tools.xml bundle_custom -Dbundle.forceCompile=true -Dbundle.input=registry
After this, do not forget to run: ant -f codebase/MakeJar.xml custUpdate
Note: For Enumeration type, there is another way to do this, that is to user the utility EnumCustomize. After its execution, a corresponding folder structure will be created under /wtCustom.
- ant -f bin/tools.xml class -Dclass.includes= [-Dclass.force=true/false -Dclass.source= -Dclass.output=]
This command ant -f bin/tools.xml class -Dclass.includes= is used to compile Java classes from the directory /src.
Ex. ant -f bin/tools.xml class -Dclass.includes=com/ptc/serviceAcademy/training/*
This command ant -f bin/tools.xml class -Dclass.includes= -Dclass.source= is used to compile Java classes from the directory defined by -Dclass.source:
Ex. ant -f bin/tools.xml class -Dclass.includes=com/ptc/serviceAcademy/training/* -Dclass.source=c:\ext
- ant -f bin/tools.xml sql_script -Dgen.input=
This command is used to generate the SQL script in the <WC HOME>/db directory. Ex.
ant -f bin/tools.xml sql_script -Dgen.input=com.ptc.serviceAcademy.training.*
Note:
You have to check the directory to see if the classes are generated. Sometimes even it shows Successful in the shell window, but in fact the classes are not truely generated.
Name and Location of Resource bundles of Enumerated types, modeled class and non-modeled class
- Enumerated types are modeled classes in Windchill, and their location can be derived from their class name. They are stored in [WT_HOME]/codebase/[package structure]/[classname]RB_[locale].ser.
For example, the resource bundle for wt.lifecycle.State is
[WT_HOME]/codebase/wt/lifecycle/StateRB.ser . All resource bundles for enumerated types are capitalized and have the extension “.ser ,” for a serialized Java object.
- There is one modeled metadata resource bundle per package, not per class. For example, both wt.part.WTPart and wt.part.WTPartMaster share the wt.part resource bundle. As a result, they are stored by package name instead of class name in [WT_HOME]/codebase/[package structure]/[package name]ModelRB_[locale].ser.
For example, the resource bundle for the wt.part
package is [WT_HOME]/codebase/wt/part/partModelRB.ser . All resource bundles for modeledmetadata begin with a lowercase letter and have the extension “.ser ,” for a serialized Java object.
Editing Enumerated Type Bundles
- Non-modeled resource bundles are not associated with the object model, so they may be stored anywhere within the codebase directory structure. One example is [WT_HOME]/codebase/wt/change2/change2Resource.class. From its name and package structure, you can infer that this resource bundle contains display text for change objects, but there is no rule enforcing this. Notice that unlike modeled resource bundles, non-modeled bundles have the “.class” extension. They are Java classes instead of serialized Java objects.
- Option 1: Copy the original resource bundle to /wtCustom directory(maintaining the structure) and modify/add the resource bundle and then compile the file with ant -f bin/tools.xml bundle_custom -Dbundle.input.
- Option 2: Use the utility Enumcustomize.
Note:
To improve performance, Windchill applets are stored in .jar files on the client computer. These .jar
files include compiled resource bundles. So, to update an applet, the client must re-download an
updated .jar file. The Apache Ant script ant -f codebase/MakeJar.xml custUpdate the .jar file in Windchill and
modifies the timestamp, indicating to the client that it needs to download the new version.
