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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Promotion request - modify attributes of attached EPMdocs?

SimonLucas
1-Newbie

Promotion request - modify attributes of attached EPMdocs?

Hi,

I have a question that I think may need a JAVA guru to help with.

Basically, what we would would like to do is get the promotion notice workflow to automatically add the initials of the checker and approver and the associated dates toattributes in the EPMdocs attached to the promotion notice, so that when the drawing/ model changes state to checked or approved they have the neccesary data for the drawing borders.

Currently we have two workarounds neither of which is ideal:

1. designer completes the boxes before promoting the drawing

2. the checker and approver have to check out the drawing so they can modify the attributes (not using CAD tool), then check the item back in.

It would be much better if this could be automated.

Has anybody managed to do this sort of thing? If so, could you give us a hand?

we are using PDMlink 9.1 M030, with CATIA, Pro/E, UG & Solidworks

Cheers

Simon Lucas


1 REPLY 1

I'm not a java guru, but you can use this to help you. Ixmlfrom PTC back in 2003and wrote this document to reset the Windchill name to an IBA called PART_NAME. This methodis only done in a workflow. You modify this to reset IBAs basedworkflow values. If the IBAs are the same values as your ProE params CAPs then they should be automapped. If you are really good, you can change the method from the workflow to a listener to reset the values so that it is changed for other objects during edits. I hope this helps.

Create an xml like renameMyObject.xml:

<%@page language="java"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>

<ie:webject name="Get-Properties" type="MGT">
<ie:param name="AUTHORIZATION" data="${@SERVER[]authorization[]}"/">
<ie:param name="ATTRIBUTE" data="wt.federation.ie.VMName"/">
<ie:param name="GROUP_OUT" data="properties"/">
</ie:webject>

<ie:webject name="Query-objects" type="OBJ">
<ie:param name="INSTANCE"&lt;span"> data="${properties[0]wt.federation.ie.VMName[0]}"/>
<ie:param name="AUTHORIZATION" data="${@server[]authorization[0]}"/">
<ie:param name="attribute"&lt;span"> data="${FORM[]att[*]}" delim=";" valueSeparator=";" default="*"/>
<ie:param name="OBJECT_REF"&lt;span"> data="${FORM[]obid[*]}"delim=";" valueSeparator=";" default="no obid specified"/>
<ie:param name="group_out" <span=">data="namesFromAttribute" default="obj"/>
</ie:webject>

<ie:webject name="Change-Group" type="GRP">
<ie:param name="GROUP_IN"&lt;span"> data="namesFromAttribute"/>
<ie:param name="GROUP_OUT" data="newNamesFromAttribute"/">
<ie:param name="RENAME"&lt;span"> data="${FORM[]att_stripped[*]}'='iba_value"/>
</ie:webject>

<ie:foreach groupin="newNamesFromAttribute" groupout="oneName">
<ie:webject<span> name="Change-Identity" type="ACT">
<ie:param<span> name="ATTRIBUTE" data="name"/>
<ie:param<span> name="ATTRIBUTE" data="number"/>
<ie:param<span> name="ATTRIBUTE" data="${FORM[]att[*]}"/>
<ie:param<span> name="INSTANCE" data="${properties[0]wt.federation.ie.VMName[0]}"/>
<ie:param<span> name="AUTHORIZATION" data="${@server[]authorization[0]}"/>
<ie:param<span> name="FIELD" data="name=${oneName[*]iba_value[*]}"/>
<ie:param<span> name="OBJECT_REF" data="${FORM[]obid[*]}"delim=";" valueSeparator=";" default="no obid specified"/>
<ie:param<span> name="group_out" data="${FORM[*]group_out[*]}" default="obj"/>
</ie:webject>
</ie:foreach>

1. The Attribute Manager web page will appear. It is advisable to create an attribute organization specifically for Pro/E designated parameters. To create an attribute organizer, select on the create organizer icon.

2. A Create Attribute Organizer will appear. Enter ProENGINEERParameters into the text box and select OK button.

3. The Attribute Manager window will refresh with the new organizer. Enter a description for this organizer and select OK button.

4. With the ProENGINEERParameters organizer highlighted, select the Create Attribute icon . A create attribute applet will be appear. It is imperative that the Data Type is the same as the Pro/E parameter type. Enter the following for the PART_NAME Pro/E designated parameter then select OK:

a. Name: PART_NAME

b. Data Type: String (pull down list)

PDMLink Data Type: Floating Number maps to Pro/E parameter type: Real Number. If there is a requirement to display in PDMLink scientific units, select the Floating Numbers with Units and select the units of measure to be matched with real numbers Pro/E parameters.

5. Select OK button and repeat steps 6 and 7 for any other IBAs to be created for viewing in PDMLink WTPart and CAD document properties page.

It is best practice not to create IBAs with the same name as the PDMLink system attributes like NUMBER, NAME and DESCRIPTION. The PDMLink user might be confused which attributes affect the Pro/E model. If there is an error with the Data Type value, the IBA must be deleted , then recreated.
<h2>1.1 IBA Type Manager</h2>

After all the required implicit IBAs are created, these IBAs are assigned to a hierarchy of object class. With the use of the Type Manager in the Administration page, all the implicitly mapped IBAs to Pro/E parameters are assigned to WTPart object class.

1. Select on the Type Manager hyperlink text.

2. A Type Manager window will appear. Highlight the wt.part.WTPart class then update icon if selectable . To make the update icon selectable, highlight another type class root then back to the wt.part.WTPart root or checkout the WTPart root type.

3. Select the Template tab and highlight the Root row and press the right mouse button/click. Select on the listed option to Add Attribute.

4. A Select Attribute window will appear. Expand the organizers, highlight an implicit mapped IBA to be viewed in the WTPart properties page, and then select the Select button.

5. The Type Manager window will reappear with the new selected attribute. Select on the corresponding cell under the Value and enter the default value. It is strongly recommended that there are default values in the Pro/E parameter and these are synchronized with the default required values of the soft attributes in PDMLink. There is limitation of the tool that once checked in, the selected attribute cannot be removed from the type root.

6. Repeat steps 3 to 5 for all the other mapped IBAs for Pro/E. After all the mapped IBAs are listed select OK. If OK is selected and the list is not complete, the update option must be selected. It is advisable to select the Save button periodically.

7. Finally select the check in icon .

<h2>1.2 Process Administration Configuration</h2>

For each Pro/E model file, a PDMLink EPM CAD document is created. For models that are parts or assemblies, PDMLink WTParts are optional. A Windchill workflow and life cycle must be created to properly synchronize the PDMLink Windchill name attribute and release process respectively. To access the Workflow and Life Cycle Administrator pages, they are located under the Process Administrator column in PDMLink.

<h3>1.2.1 PDMLink Custom Rename Workflow</h3>

In PDMLink, the name attribute is a PDMLink non-revision/versioned attribute for all objects (See SPR 853064). The name attribute cannot be modified or changed via through the PDMLink interface. PDMLink instance based attributes (IBA’s), which are created in the PDMLink Attribute Administration section, are iteration controlled. A workflow is created to rename WTParts during a creation and iteration of new WTPart objects.

First a file renameMyObject.xml was copied to the directory <wt_home>\task\infoengine\rename. If the “rename” directory does not exist, the directory must be created.

A workflow was created called Rename Process.

This workflow is comprised of a start and end gate with an expression robot in the middle.

The expression robot was named Set Name.

Within the expression tab, an expression was entered (see below) to rename the Windchill ‘name’ attribute to the IBA called ‘Part_Name’. The attributeDefinition must be defined to “Part_Name”:

//---------------------------------------------

System.out.println("<renamemyobject.xml>");

String ibaToGetNewNameFrom = "PART_NAME"; //this is the only thing that you need to change

//get obid from primary business object

String obid = (new wt.fc.ReferenceFactory()).getReferenceString( (wt.fc.Persistable)primaryBusinessObject);

// Invoke a TASK

//If you put your file under a different directoty, you'll have to fix this line as well.

//Note that it looks for tasks starting at Windchill\tasks.

com.infoengine.SAK.Task t = new com.infoengine.SAK.Task

("infoengine/rename/renameMyObject.xml");

t.addParam ("obid", obid);

t.addParam ("att", ( "IBA|"+ibaToGetNewNameFrom) );

t.addParam ("att_stripped", ibaToGetNewNameFrom );

t.addParam ("group_out", "obj");

t.setUsername (wt.session.SessionHelper.getPrincipal().getName());

t.invoke ();

System.out.println("</renamemyobject.xml>");

//---------------------------------------------

After this workflow was created, it was then checked into the system back in the Workflow

Announcements

Top Tags