Skip to main content
13-Aquamarine
August 22, 2024
Solved

How to get Assigned Item Expression via Workflow?

  • August 22, 2024
  • 1 reply
  • 2204 views

Version: Windchill 11.2

 

Use Case: Just trying to read/modify Assigned Item Expression which is assigned to a WTPART, in the workflow and then i'll just assign expression to wtparts via workflow.


Description:

Hi there,

First of all, I need to explain our daily use of Item Expressions. We usually assign an expression to a WTPART using the Assigned Item Expression. When I do this, we first move the WTPART to the Library where the Option Set is defined. We're using "Assign Advanced Expression" to assign the expression to the WTPART.

What I am trying to do is print the Assigned Item Expression assigned to a WTPART in the workflow and then assign the expression to WTPARTs via the workflow. However, since this “Assigned Expression” attribute is a calculated value, we cannot retrieve it directly. We need to print it by capturing the relationship between the Option Set and Choice with the WTPART.

There is a topic about obtaining Usage Expression in the forum, but with usage expression, this expression can be obtained with respect to the parent WTPART.

https://community.ptc.com/t5/Windchill-Customization/Method-to-get-Assigned-Expression/m-p/923615 

 

Also, I'm using Windchill version 11.2, and I couldn’t find the OptionHelper class in the Javadoc. I guess it's not supported in this version, or maybe I had trouble finding the fully qualified name.

 

Best answer by HelesicPetr

Hi @Anil_SAD 

I don't think so there is easier way. 

PetrH

1 reply

12-Amethyst
August 25, 2024

Hi, 

 

I posted the question/solution you linked, it just needs a few tweaks to work with WTPart rather than WTPartUsageLink. One question first, do you need the expression in the context of its Assigned Option Set, or just the the full expression? For example, if you've selected COLOUR = "GREEN", "RED", but only green is currently available for selection in the Assigned Option Set, outputting the expression in context of the Assigned Option Set would give COLOUR = "GREEN". The alternative is to output the full expression (COLOUR = "GREEN", "RED"), which is what Windchill shows in the UI.

 

Could you also clarify your requirements too, it's a little unclear what you need the workflow to do, are you saying you need to output the expression from a WTPart to a string, then assign that expression to other WTParts?

 

On the JavaDoc, there are lots of classes that are missing, I honestly don't know why this is, or whether it means they're supported or not, but I think it was in the codebase at 11.2, use with caution though in case it is unsupported.

 

Graham

HelesicPetr
22-Sapphire II
22-Sapphire II
August 26, 2024

Hi @GrahamV 

I just add a comment to the JavaDoc. 

This documentation shows only supported methods. If you use method that is not in JavaDoc, there is not guarantee that it will work in the future release. 

PetrH