cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

Not able to call custom Form Processor on Variant Specification by right-clicking it.

manoj_dokku2
11-Garnet

Not able to call custom Form Processor on Variant Specification by right-clicking it.

Steps Performed:

1. Written Form Processor by extending "EditWorkableFormProcessor".

2.

a) Expanded Product Family Structure

b)right clicked on Variant Specification Object

c)checkout 

d)edit

3. Observations

a) In the URL, instead of custom form processor(FP), OOTB Form processor is called which is "EditWorkableFormProcessor".

b) Action called is "editFamilyMemberGWT".

c) Working when we go outside the structure, i.e., information page of the Variant Definition and perform checkout and edit.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @manoj_dokku2 

Maybe a little bit better description is in my a year old replay in How-to-add-a-custom-action-to-Windchill-PSB

 

PetrH

View solution in original post

6 REPLIES 6

The FormProcessor is hard coded in the com.ptc.windchill.enterprise.productfamily.pfsb.client.action.EditJCAAction which is called by the action.

I have not customized any GWT wizards so far. So I don't know enough about it. Until now, I've always tried to keep my hands off it, because everything works differently.

Hello @manoj_dokku2 

It is little bit complicated and I haven't found better way.

 

The GWT actions are really special things :D.

 

First you can not use definition of processor directly in customAction.xml

 

Described solution works with a JSP wizard definition

 

In customAction.xml you have to use command class as:

<command class="com.ptc.cat.ui.client.action.LaunchURLAction" method="execute" url="netmarkets/jsp/cz/aveng/RenameWizard/RenameSetWizard.jsp" windowType="popup"/>

 Also Action name has to end with GWT

<action name="RenameSetWizardGWT">

 

Now very important part.

in the JSP file where you define STEPs you need to define form Processor Controller class.

<jca:wizard formProcessorController="cz.aveng.RenameWizard.AVRenameController"
title="Rename"
buttonList="AVOKButton">
<jca:wizardStep action="AVRenameWizardStep1" type="AVUTILS"/>
</jca:wizard>

 

the controller is a place where you define your custom processor

public class AVRenameController extends DefaultFormProcessorController
{
@Override
protected List<ObjectBean> getRootObjectBeans()
{
List objectBeanList = super.getRootObjectBeans();
Iterator next = objectBeanList.iterator();
List<String> delegate = new ArrayList<>();
//Processor delegagte (very important Delegate if is not set, then Processor is pushed to delegate which is not possible error can not cats Processor to ProcessorDelegate)
delegate.add("com.ptc.core.components.forms.DefaultObjectFormProcessorDelegate");
while (next.hasNext())
{
ObjectBean objectBean = (ObjectBean) next.next();
// Processor for managing action after OK button
objectBean.setProcessorClassName("cz.aveng.RenameWizard.AVRenameProcessor"); // this is place where custom processor is defined
objectBean.setDelegateClassNames(delegate);
}
super.setRootObjectBeans(objectBeanList);
return super.getRootObjectBeans();
}
}

 

So this way you can define your custom processor in the structure.

 

Hope this can help

 

Best Regards

 

PetrH

Dear HelesicPetr,

 

First of all thank you so much for your reply on for our query, since we are trying to edit the Variant Spec by right clicking, we have tried the solution provided by you by modifying the below files but it is not redirecting to our form custom form processor, still it is redirecting to OOTB form processor which is EditWorkableFormProcessor..

 

in custom-actions.xml file we have placed the below xml tags.

	<objecttype name="productfamily" class="wt.productfamily.ProductFamilyMember" resourceBundle="com.ptc.windchill.enterprise.productfamily.productFamilyManagementUIActionsRB">      	  
	   <action name="editFamilyMemberGWT" ajax="row">
         <command class="com.ptc.windchill.enterprise.productfamily.pfsb.client.action.EditJCAAction" method="execute" url="netmarkets/jsp/variantspec/editFamilyMember.jsp" windowType="popup"/> 		 
		 <includeFilter name="com.ptc.windchill.enterprise.productfamily.pfb.client.action.internal.HideWhenAllItemsIsNotProductFamilyMembersOrVariantSpecs"/>		 
         <includeFilter name="com.ptc.cat.ui.client.internal.action.OneSelectionFilter"/>
         <includeFilter name="editVariantSpecActionFilter"/>
         <supportedTypes>
            <type value="wt.productfamily.ProductFamilyMember"/>
            <type value="com.ptc.wpcfg.doc.VariantSpec"/>
         </supportedTypes>
      </action>
	</objecttype>

JSP file editFamilyMember.jsp as mentioned below.

 

<%@ taglib prefix="jca" uri="http://www.ptc.com/windchill/taglib/components"%>
<%@ taglib prefix="wip" uri="http://www.ptc.com/windchill/taglib/workinprogress"%>
<%@ include file="/netmarkets/jsp/components/beginWizard.jspf"%>
<%@ include file="/netmarkets/jsp/components/includeWizBean.jspf"%>

<wip:autoCheckOutItem />

<jca:initializeItem operation="${createBean.edit}"/>

<jca:wizard title="edit"
buttonList="EditWizardButtons"
helpSelectorKey="variantspec.view"
formProcessorController="ext.org.formprocessors.controller.OrgEditWorkableFormProcessorController">
<jca:wizardStep action="editFamilyMemberGWT" type="object"/>
</jca:wizard>

<%@include file="/netmarkets/jsp/util/end.jspf"%>

 We have used the same controller you have specified and provided our form processor (which extends EditWorkableFormProcessor)

 

objectBean.setProcessorClassName("ext.org.formprocessors.OurFormProcessor");

 

Hi @manoj_dokku2 

I guess that the customAction.xml do not contains the correct class

 

<command class="com.ptc.windchill.enterprise.productfamily.pfsb.client.action.EditJCAAction"

 

here should be 

class="com.ptc.cat.ui.client.action.LaunchURLAction"

 

If there is not LaunchURLAction it will not work

 

PetrH

Hi @manoj_dokku2 

Just additional information about url.

Wizard URL do not contains your custom processor with this method.

there is a default one but the custom processor is initialized.

HelesicPetr_1-1649052692297.png

 

PetrH

 

 

Hi @manoj_dokku2 

Maybe a little bit better description is in my a year old replay in How-to-add-a-custom-action-to-Windchill-PSB

 

PetrH

Top Tags