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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

How to use alias attribut in drawing / part?

Mat
15-Moonstone
15-Moonstone

How to use alias attribut in drawing / part?

Hi there,

 

I want to display a "released by" information on my drawing.

I created an alias attribute with this mapping:

 

 

roleBObject@wt.maturity.PromotionTarget~roleAObject^wt.maturity.PromotionNotice~primaryBusinessObject@wt.workflow.work.WorkItem~theWorkItemReference@wt.workflow.engine.WfVotingEventAudit~userRef^wt.org.WTPrincipal~name=name@wt.org.WTUser~fullName

 

The attribute works great so far and lists all User's Full Names, which were involved in the process.

Mat_0-1670510581637.png

 

The attribute should be shown as parameter "released_by_alias".

But in Creo no such parameter is listed.

 

What am I missing?

 

ACCEPTED SOLUTION

Accepted Solutions
TomU
23-Emerald IV
(To:Mat)

Adding to what @HelesicPetr wrote, see this from CS248702:

 

TomU_0-1671047006283.png

 

View solution in original post

15 REPLIES 15
joe_morton
17-Peridot
(To:Mat)

I think you would need to add this as a new attribute in Creo, and probably make it part of your template files. You should also mark it as "designated".

 

HelesicPetr
22-Sapphire I
(To:Mat)

Hi @Mat 

It does not work that way as you think.

 

Calculated attribute is not populated to the drawing/model in creo automatically. It is not IBA attribute.

The calculated attribute value is processed when it is shown on Windchill page.

 

So in the Windchill it works perfectly everyone can see it but if you need it inside of drawing, you need normal IBA attribute and designated attribute in the creo drawing. 

 

Also you need some code to propagate the value from workflow to the drawing without checkout/in. after that the drawing revisualization is needed . 

 

Hope this information can help you.

 

PetrH

TomU
23-Emerald IV
(To:Mat)

Adding to what @HelesicPetr wrote, see this from CS248702:

 

TomU_0-1671047006283.png

 

Mat
15-Moonstone
15-Moonstone
(To:TomU)

@TomU  and @HelesicPetr , Thanks for Your answers.

@PTC: why, just why can't You provide this information like lifecycle state ( PTC_WM_LIFECYCLE_STATE ), Version  ( PTC_WM_VERSION ) or "modified by" ( PTC_WM_MODIFIED_BY )?

 

To me, it is another basic feature missing in this overpriced software suite.

But thanks god, that there is now an IOT interface.

HelesicPetr
22-Sapphire I
(To:Mat)

@Mat 

Because workaround exists and nice to have ideas are not enough interesting for business. 

 

You can use java code to populate attribute values as you need from workflow,

or there is an another way to use com.ptc.windchill.uwgm.proesrv.c11n.DefaultModeledAttributesDelegate

 

More info you can find in Windchill Customization Guide: section Customizing the Parameters in the Download Service  cs18803

 

PetrH 

TomU
23-Emerald IV
(To:Mat)

@Mat,

We add released information to our drawings by watermarking the PDFs:

 

TomU_0-1671112568931.png

 

This can be done during publishing using something like LinkAccess Trigger from Fishbowl Solutions, or on-the-fly with something like the PDF Quick Access Starter from Wincom.

Dobi
16-Pearl
(To:TomU)

@TomU  in your case was this done with Watermark from Wincom? It wasn't obvious to me from the documentation that the template once overlayed can dynamically fit into a field designated for the particular information. 

 

TomU
23-Emerald IV
(To:Dobi)

No, the picture above was watermarked with LinkAccess Trigger from Fishbowl Solutions,

Mat
15-Moonstone
15-Moonstone
(To:TomU)

Thanks for Your suggestion.

But adding watermarks during some publishing process is not an option.

That information should be part of the drawing / epm - object itself (which it is, because You can access it via alias attributes).

 

In my case, we do not use windchill's publishing feature for production.
I am working in a small company (only 5 CAD - Workstations). Other department do not have access to windchill.

We "publish" the documents, by exporting them right after approving the PR by using a web.link script (either by its engineer or by the approver).

 

To display the "released_by" information, we use a user-defined parameter, which does not update automatically.

The engineer, who wants his work to be released, has to enter that information manually (actually I created a drop-down menu for that to save time and to avoid typos) before he/she starts a promotion request. Unfortunately, updating that parameter is easy to miss. So we end up in (unnecessary ) rework loops.

d_graham
18-Opal
(To:Mat)

@Mat ,

What you are trying to do can be done but as has been mentioned not with an alias attribute.

You are on the right track however to use the results of the voting to get the user's name.

 

You can add code to your workflow that gets the user's name from the voting immediately after the vote occurs and then have this name pumped into the value of the CAD Doc Drawing's Windchill String attribute "RELEASED_BY_ALIAS" (or whatever you want to call it).  Your CAD Drawing just needs to have the same designated String parameter "RELEASED_BY_ALIAS".

 

This creating/updating of the Windchill attribute can be done without iterating the CAD Doc if so desired.

 

As @HelesicPetr mentioned, it's unrealistic to think PTC will think of and implement every customization all of us can think of.  Part of our job is to fill these voids on a case-by-case, as needed basis. That's the way I've always look at this as it's realistic.  Plus, writing customization is fun. 😁

Mat
15-Moonstone
15-Moonstone
(To:d_graham)

 


@d_graham wrote:

@Mat ,

 

You can add code to your workflow that gets the user's name from the voting immediately after the vote occurs and then have this name pumped into the value of the CAD Doc Drawing's Windchill String attribute "RELEASED_BY_ALIAS" (or whatever you want to call it).  Your CAD Drawing just needs to have the same designated String parameter "RELEASED_BY_ALIAS".

 

This creating/updating of the Windchill attribute can be done without iterating the CAD Doc if so desired.

Well, my problem is, that I do not know by detail how to do it.

 

I get the Approver's name by defining a Variable "approver_info" in the workflow's property page:

Mat_0-1730811883855.png

 

And I can query the approver's name by using this expression (either as part of a condition or as a separate "expression block"

 

//get the principals selected for the APPROVER role
java.util.Enumeration principals_approver=((wt.team.Team)((wt.workflow.engine.WfProcess)self.getObject()).getTeamId().getObject()).getPrincipalTarget(wt.project.Role.toRole("APPROVER"));

while(principals_approver.hasMoreElements())
{
wt.org.WTPrincipal wtprincipal = ((wt.org.WTPrincipalReference)principals_approver.nextElement()).getPrincipal();
approver_info =  wtprincipal.getPrincipalDisplayIdentifier();
}


Unfortunately, I have no clue about the last step ( how to "pump" that into EPMDocument ) .
I tried creating a "checkout -> modify -> checkin" loop, But firstly, I have trouble with the checkin step and secondly, this procedure would change the "modified by" Value of the object.

All released objects and drawings would display "modified by Site Admin".

 

HelesicPetr
22-Sapphire I
(To:Mat)

Hi @Mat 

You could have used a search engine. It has been already described how to do so. 

How-to-update-IBA-String-values-on-a-Part-without-iterating

PetrH

Mat
15-Moonstone
15-Moonstone
(To:HelesicPetr)

Sorry, Your code does not work inside an expression block within a workflow:

Mat_0-1730816513696.png

 

btw, I have used the search engine, schweinchenschlau.

HelesicPetr
22-Sapphire I
(To:Mat)

Hi @Mat 

I know. You have to rewrite it that it would work. You have to use full class definitions and so on. Go ahead. 

PetrH

Mat
15-Moonstone
15-Moonstone
(To:Mat)

I was able to get a working solution for my problem, which I had at the first place ( displaying "approved by" on a drawing).

 

I posted my solution here:

https://community.ptc.com/t5/Windchill-Customization/Info-How-to-set-attribute-for-quot-released-by-quot-quot/m-p/988177

 

Announcements

Top Tags