Tuesday, December 26, 2017

Windchill with HTTPS

Using below steps, we can configure Windchill to listen HTTPS connection.
1. Reconfigure Apache to use HTTPS (SSL).
2. Reconfigure Windchill to use HTTPS (SSL).

1. Reconfigure Apache to Use SSL :
  •     Stop Windchill, Apache and other related services.
  •     Open Windchill Shell and navigate to Apache
  •     run below command in shell.
ant -f config.xml -DServerName=<HostName>  configureSelfSignedCert

Here HostName is fully qualified hostname. this is your Windchill Server Name.

After Successful Build, execute below command in case of your Windchill version is Windchill 11.0,

ant -DHTTPS_ENABLED=true -f config.xml reconfigure

2. Reconfigure Windchill to listen SSL connection:

Normaly in OOTB Windchill installations, Apache was running on port 80 and connection type was http.
above settings are stored in wt.properties as shown here,

wt.webserver.port=80;
wt.webserver.protocol=http;

Now we have to change this to 443 port for https connection.
Here is the xconfmanager command to make this changes. always use xconfmanager utility to make any changes in properties file.
Open a Windchill shell and execute below command,

xconfmanager -s wt.webserver.port=443 -s wt.webserver.protocol=https -t codebase/wt.properties -p

3. Disable Apache listening on port 80 - open Apache/conf/http.conf file and comment out the line #Listen 0.0.0.0:80

4. Now Start the Apache in in https mode by below command from shell.

Apache /bin/httpd -DSSL

5. Start Windchill and other services.
6. Test the Windchill first by command line arguments from Windchill shell by below command,

Windchill Shell > windchill wt.auth.Authentication 

This command will launch a popup window asking credentials. now access Windchill by https url.

Monday, December 25, 2017

How to set Folder location based on Attribute value in OIR

Many times we have to decide the folder location of newly created objects on a specific criteria.
Like, if Part is Manufactured in India, it must be store in India or if part is manufactured in China, it must be store in China folder.

How we can do this, here folder location will be derived from the attribute value for country.

Consider, "country" is an attribute on WTPart and it has value set like , INDIA, CHINA, UK etc.

Download the OIR for WTPArt and find and modify as shown in below,

1.  <!-- set the folder -->
               <AttrValue id="folder.id" algorithm="com.ptc.core.foundation.folder.server.impl.FolderPathAttributeAlgorithm">
               <Value algorithm="wt.rule.algorithm.CaseBranch">
                    <Value algorithm="wt.rule.algorithm.EqualsTest">
                        <Attr id="country"/> <!-- Internal name of Attribute value -->
                        <Arg>INDIA</Arg> <!-- If value is INDIA , then folder will be below-->
                    </Value>
                    <Arg>/Default/INDIA</Arg>
                  
                    <Value algorithm="wt.rule.algorithm.EqualsTest">
                        <Attr id="country"/>
                        <Arg>CHINA</Arg>
                    </Value>
                    <Arg>/Default/CHINA</Arg>
                  
                    <Value algorithm="wt.rule.algorithm.EqualsTest">
                        <Attr id="country"/>
                        <Arg>USA</Arg>
                    </Value>
                    <Arg>/Default/USA</Arg>
                  
                    <Value algorithm="wt.rule.algorithm.EqualsTest">
                        <Attr id="country"/>
                        <Arg>UK</Arg>
                    </Value>
                    <Arg>/Default/UK</Arg>
               <Arg>/Default</Arg>
               </Value> 
               </AttrValue>


2.  <AttrConstraint id="folder.id" algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
                   <!-- Value algorithm="com.ptc.core.rule.server.impl.GetServerPreGeneratedValue"/-->      
                    <Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint"/>
           </AttrConstraint>  

Save this OIR, upload back in to system. now WTPart will be stored in respective folders based on value of country attribute. if in case the value of Country attribute is blank or some other field, the folder location will be Default folder.






Thursday, December 14, 2017

Manual Base data loading into database for Windchill PDMLink

Sometimes Windchill installers fails while doing base data load operation.

Here is the alternate manual method to do same thing.

1. Open a Windchill Shell and execute below command.

                windchill wt.load.WindchillLoader -info

This command will give list of installed  Windchill modules. now use below command to load base data.

Here are the options :
 a. Load base data for all installed application.

            windchill wt.load.WindchillLoader -All -unattended

 b. Load base data along with demo data

           windchill wt.load.WindchillLoader -All -IncludeDemo -unattended

c. Load only Demo Data

         windchill wt.load.WindchillLoader -All -LoadOnlyDemo -unattended

d. Load base data along with Test Data

           windchill wt.load.WindchillLoader -All -LoadOnlyTest -unattended

e. Load base data for particular application like MPMLink.

          windchill wt.load.WindchillLoader -Application=Windchill.MPMLink -unattended

f. for Help, use below command

         windchill wt.load.WindchillLoader -help

Monday, December 11, 2017

How to set up OIR to choose a LifeCycle via Drop Down List at object creation Wizard

Here is the steps,
Create a soft type and download a OIR. now edit OIR as shown below,


<!-- set the lifecycle -->
<AttrValue id="lifeCycle.id" algorithm="com.ptc.core.foundation.lifecycle.server.impl.LifeCycleTemplateAttributeAlgorithm">
    <Arg>Basic</Arg>
</AttrValue>


.
.
.

<!-- specify AttrConstraint tag -->
<AttrConstraint id="lifeCycle.id" algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
    <Value algorithm="com.ptc.core.foundation.lifecycle.server.impl.DiscreteLifecycleTemplateSetAlgorithm">
        <Arg>Release</Arg>
        <Arg>Basic</Arg>
        <Arg>Review</Arg>
        <Arg>Requirement</Arg>

    </Value>
    <Value algorithm="com.ptc.core.rule.server.impl.GetServerPreGeneratedValue"/>
</AttrConstraint>


Upload this OIR and now we will find drop down against the Life-cycle template.

How to run Apache, Tomcat and Windchill as Windows service

To Run Windchill as a Windows Service, please follow below article,
Windchill mainly has below components,

1. Apache as a web server.
2. Tomcat as a Servlet engine.
3. Windchill Server.
4. Windchill DS.


1. Configure Apache as a Windows Service:
     Launch Windchill Shell as administrator and go to the Apache or HTTPServer directory and execute below command.

   As Administrator, Execute where <ServiceName> is what you want to name service
  1. Install:
    1. ant -f config.xml installService -DserviceName=<Apache>
  2. Uninstall:
    1. ant -f config.xml uninstallService -DserviceName=<Apache>
 2. To configure Windchill as a service
       Launch Windchill Shell as a administrator and execute below commands,

  1. Install:
    1. ant -buildfile <windchill>\opt\ntservice\WindchillService.xml install -DserviceName=<Windchill>
  2. Uninstall:
    1. ant -buildfile <windchill>\opt\ntservice\WindchillService.xml uninstall -DserviceName=<Windchill>

Cache Clear and Server Reboot

Fallow below steps to clear the Windchill Server cache.

Stop all Windchill and related services
  • Stop all Windchill and related services in the following order:
    1. Windchill
    2. Windchill Directory Server
    3. Tomcat or Apache
     
    • Delete temporary server files,Delete only the following directories specified in bold
      1. Tomcat
        1. Release 10 +: <Windchill-Home>\tomcat\instances\
        2. Prior to Release 10: <Windchill-Home>\tomcat\work
      2. Info*Engine
        1. <Windchill Home>\tasks\codebase\com\infoengine\compiledTasks\
      3. Windchill Logs
        1. <Windchill Home>\Logs\
      4. Workflow Expression Cache
        1. <Windchill-Home>\codebase\wt\workflow\expr
      5. Windows Temporary Files
        1. Go to Start > Run
        2. Key in
          1. %temp%
          2. or <%UserProfile%>\AppData\Temp
        3. Click OK
        4. Select ALL
        5. Delete content of this folder
        6. Start the Windchill Server

How to create a Custom Numbering Sequence

Sometime we requires a custom numbering sequence to achieve the required functionality.

Here is the steps which has to be faollowed for creation of custom numbering sequences.

1. Open SQLPLUS.
2. Logged in by using Windchill DB user credentials.
3. Execute the below command in sqlplus.

SQL> exec wtpk.createSequence('<Sequence_Name>','<Starting_number>','<increment>');
here is example,

SQL > exec wtpk.createSequence('INDIAID_seq','5000','1');

        Here, INDIAID_seq - is a Sequence Name

                 5000 - is a starting number and 1 is an increment value.


How to Use this in OIR,

 Edit the oir xml file, and put below above sequence in number area as shown below,

<AttrValue id="number" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator">
<Arg>{GEN:wt.enterprise.SequenceGenerator:INDIAID_seq:8:0}</Arg>
</AttrValue>



Windchill with HTTPS

Using below steps, we can configure Windchill to listen HTTPS connection. 1. Reconfigure Apache to use HTTPS (SSL). 2. Reconfigure Windch...