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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Translate the entire conversation x

Reel Number Attribute Mapping

OnurNalbantoglu
14-Alexandrite

Reel Number Attribute Mapping

I defined an attribute that I created as Real Number as a variable in the activity and I want this value to appear on the primary attribute screen. Unfortunately, the code I use when I define it as an intager does not work in real number, what should I do?

 

pictures will be more descriptive;

 

Attribute type;

onur_0-1657811158962.png

 

Creating variable;

onur_1-1657811224517.png

 

the code I use;

onur_2-1657811297613.png

 

 

 

4 REPLIES 4

@OnurNalbantoglu 

Why not make the workflow variable the same object type as a Real  Number.

 

That seems the simplest solution.

 

If you have to keep it String for some reason you need to convert the String value to class FloatingPoint (which is what a Windchill Real Number is).

 

If you go the way of making a new variable you should find FloatingPoint under Windchill classes. Or just copy/paste from Type and Attribute Manager. You can see it in the upper left  where you can edit display name. It’s under Data Type (I think).

 

David

I stopped using the attribute I created in the task as a real number. I will have users edit the form.

I tried the attribute as a string to the variable, it didn't work, I tried it as a floating point, it didn't work, I tried it as java.lang.long and it didn't work. Unfortunately I couldn't find a solution. Thank you very much for your work.

@OnurNalbantoglu 

 

I looked at your code and I bet you are getting a Class cast exception as you are trying to cast a String to a Double.

That's going to work.

 

Creating the workflow variable as FloatingPoint and Type attribute as Real Number (FloatingPoint) should work and there would be no need to cast the object returned from PersisableAdapter to a FloatingPoint as it is already a FloatingPoint.

 

Note there is also FloatingPoint with Units.  Do not use that one as it is different from FloatingPoint.

If this does not work and you are following this methodology something else must be wrong.

 

I think the process started wrong somehow and the system did not allow what I wanted to do. I am currently performing my operations without using variables. Thanks a lot for your explanation.

 

Best Regards.

Announcements

Top Tags