Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Hi,
I want do define a soft attribute "approver" for a certain document and the approver should be a PDMLink user.
When user creates the document, he should be able to select the approver from a list of PDMLink users.
As far as I understand, I need to write some code for a so called user picker and compile it.
There is an example for compiling a picker for organizations here.
https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS80307
However, I am not very familiar with customization and searching for someone who can explain, what to do.
I would like to know the following:
* Sample code with simplest callback function
(I attach a sample code from PTC Technical Support, but I guess this is too generic and does not work)
* How to compile
* How to register in Windchill if this is different as described in the article above
Sorry, but I am a beginner in this.
I would appreciate any help.
Tom
Hee hee...there is no attribute type for picking a user. I've tried, extensively, to find one and PTC has said no it doesn't exist. So you'll have to go to the Workflows instead.
Quick option would be in your Document workflow, immediately after the Start send a Submit task to the Creator but add Set Up Participants to it, and they can pick the reviewers and approvers on it. You may also want to put code in the Complete transition that will spit out a popup error if they set themselves as the Reviewers or the Approver, since self-approval is a conflict of interest.
Hope that helps,
Daryl
You can create attribute of string type and create data utility to replace textbox with User picker. Below are the steps
public void buildUserPickerConfig(final String component_id, final ModelContext mc) throws WTException {
HashMap<String, Object> defaultProps = new HashMap<String, Object>();
defaultProps.put("objectType", "wt.org.WTPrincipal");
defaultProps.put("pickedAttributes", "name");
defaultProps.put("readOnlyPickerTextBox", "false");
defaultProps.put("showSuggestion", "true");
defaultProps.put("suggestServiceKey", "OrgPicker");
HashMap<String, Object> customProps = new HashMap<String, Object>();
if ("Esclation".equals(component_id) ||"OrgAttribute".equals(component_id)) {
customProps.put("pickerId", component_id);
customProps.put("pickerCallback", "CustomPickerInputComponentCallback");
}
defaultProps.putAll(customProps);
mc.getDescriptor().setProperties(defaultProps);
}
2. Use attribute internal ID from the Type manager for the new IBA created and register the data utility in the service.properties file refer customizer guide for registering data utility
hope it helps !!
Thanks
Shryeas
...Ugh...why didn't PTC tell me that?
Hi,
Can you help me out where to register the callBack function jsp page name and location of it ?