Skip to main content
1-Visitor
June 13, 2013
Solved

How To add new Action to a Menu in Windchill 10.1

  • June 13, 2013
  • 3 replies
  • 9701 views

Hello all,

I need to link a new Action in Action Menu of a Product..

How i can achive this.

Please Check the Image of Required Outcome.

Please tell me the exact way..

Thanks,

Vivek

Best answer by

Hi Vivek,


You can try below. This instructions for Note (subtype of EPMDocument) Object type, but instructions are same for other type too.


1. The RMB menu for Note object uses “epmdocuments details page actions” model from <WT_HOME>\codebase\config\actions\UwgmCadx-actionmodels.xml file

2. Copy this entire model to <WT_HOME>\codebase\config\actions\custom-actionModels.xml file

3. You can add you custom action details in the same model as shown below:

<model name="epmdocuments details page actions" menufor="wt.epm.EPMDocument">

.

.

.

<action name="inflateNotes" type="customInflateNoteActions" resourceBundle="ext.TEST.ActionDefinitionsRB"/> <!-- Custom Action in Objects Action Drop Down List -->

.

</model>

4. In the <WT_HOME>\codebase\config\actions\custom-actions.xml file add objecttype for above action. I below will goes to this file:

<objecttype name="customInflateNoteActions" class="wt.epm.EPMDocument|com.ptc.ptcnet.DynamicDocument|com.ptc.ptcnet.Note" resourceBundle="ext.TEST.ActionDefinitionsRB" >

<action name="inflateNotes" uicomponent="" ajax="component">

<description>Create a Inflate Note</description>

<command class="" method="execute" windowType="popup" url="netmarkets/jsp/ext/custom/InflateNotes/inflateNotes.jsp" />

</action>

</objecttype>

5. Place your inflateNotes.jsp file under <WT_HOME>\codebase\netmarkets\jsp\ext\custom\InflateNotes directory

6. Create a Resource file ActionDefinitionsRB under <WT_HOME>\src\ext\TEST directory which renders Labelling for your custom action

7. Compile this Resource file ActionDefinitionsRB with below command from Windchill Shell: (Do not copy paste above command in Windchill Shell)

tools class -Dclass.includes=ext\TEST\**

8. Make sure BUILD SUCCESSFUL and ActionDefinitionsRB.class file is created under <WT_HOME>\codebase\ext\TEST directory

9. Stop Windchill Method Server

10. Clear Tomcat, Info*Engine cache

11. Restart Windchill Method Server


Inflate note.png

3 replies

vuchekar1-VisitorAuthor
1-Visitor
June 13, 2013

ActionAdd.png

Answer
March 6, 2015

Hi Vivek,


You can try below. This instructions for Note (subtype of EPMDocument) Object type, but instructions are same for other type too.


1. The RMB menu for Note object uses “epmdocuments details page actions” model from <WT_HOME>\codebase\config\actions\UwgmCadx-actionmodels.xml file

2. Copy this entire model to <WT_HOME>\codebase\config\actions\custom-actionModels.xml file

3. You can add you custom action details in the same model as shown below:

<model name="epmdocuments details page actions" menufor="wt.epm.EPMDocument">

.

.

.

<action name="inflateNotes" type="customInflateNoteActions" resourceBundle="ext.TEST.ActionDefinitionsRB"/> <!-- Custom Action in Objects Action Drop Down List -->

.

</model>

4. In the <WT_HOME>\codebase\config\actions\custom-actions.xml file add objecttype for above action. I below will goes to this file:

<objecttype name="customInflateNoteActions" class="wt.epm.EPMDocument|com.ptc.ptcnet.DynamicDocument|com.ptc.ptcnet.Note" resourceBundle="ext.TEST.ActionDefinitionsRB" >

<action name="inflateNotes" uicomponent="" ajax="component">

<description>Create a Inflate Note</description>

<command class="" method="execute" windowType="popup" url="netmarkets/jsp/ext/custom/InflateNotes/inflateNotes.jsp" />

</action>

</objecttype>

5. Place your inflateNotes.jsp file under <WT_HOME>\codebase\netmarkets\jsp\ext\custom\InflateNotes directory

6. Create a Resource file ActionDefinitionsRB under <WT_HOME>\src\ext\TEST directory which renders Labelling for your custom action

7. Compile this Resource file ActionDefinitionsRB with below command from Windchill Shell: (Do not copy paste above command in Windchill Shell)

tools class -Dclass.includes=ext\TEST\**

8. Make sure BUILD SUCCESSFUL and ActionDefinitionsRB.class file is created under <WT_HOME>\codebase\ext\TEST directory

9. Stop Windchill Method Server

10. Clear Tomcat, Info*Engine cache

11. Restart Windchill Method Server


Inflate note.png

1-Visitor
August 15, 2016

Not sure what it's like in 10.1 but i know in 10.2 M030 you have to add the <supportedTypes> tag in the action to restrict the command to a specific subtype.


<objecttype name="customInflateNoteActions" class="wt.epm.EPMDocument" resourceBundle="ext.TEST.ActionDefinitionsRB" >

<action name="inflateNotes" uicomponent="" ajax="component">

<description>Create a Inflate Note</description>

<command class="" method="execute" windowType="popup"

url="netmarkets/jsp/ext/custom/InflateNotes/inflateNotes.jsp" />

<supportedTypes>

    <type value="WCTYPE|wt.epm.EPMDocument|com.ptc.ptcnet.DynamicDocument|com.ptc.ptcnet.Note" />

</supportedTypes>

</action>

</objecttype>

1-Visitor
June 8, 2017

i did the same steps . but the build failed when i tried to compile the resource file .

i m able to see my action but the label is not visible . rb data is not reflected i guess.Shirishkumar Morkhade‌  can you help me on this ?

June 8, 2017

Hi Soundarya Athimuthu

What command you used to compile the Resource?

Please sure:

1. Either you remove (or rename) corresponding class file from codebase.

2. Timestamp of .java file must be newer than corresponding .class file?

3. Do not copy paste this command on Windchill Shell instead type it manually.

4. Does this command throws any exception in Windchill Shell while execution?

Regards,

Shirish

1-Visitor
June 9, 2017

Thanks Shirishkumar Morkhade .I got it ! i recreated the eclipse project and it works fine now    btw , how can the class file of java be newer . only upon compilation of java file , we ll get the class file right ? and in eclipse navigator , my class file doesnt appear . how ever in the windchill codebase i can see the class file after i compiled the rb . i am able to see the output but dont seem to understand why it is so !

Regards,

Soundarya.