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

Traffic Light Attribute Implementation

CC_10081426
6-Contributor

Traffic Light Attribute Implementation

Hello everybody,

 

I have a very short question about generating a new attribute including a traffic light. I have created a new integer attribute with the following formula behind:

 

 

 

(state.state == “CANCELLED”) ? 0 : (state.state == “INWORK”) ? 1 : (state.state == “RELEASED”) ? 2 : 3

 

 

 

But when I try to save the changes I get the following warning: "Value entered for Formula is invalid."

 

What am I doing wrong here?

 

Many thanks!

 

 

 

 

 

 

7 REPLIES 7
rhart
14-Alexandrite
(To:CC_10081426)

((state.state == “CANCELLED”) ? 0 : ((state.state == “INWORK”) ? 1 : ((state.state == “RELEASED”) ? 2 : 3 )))
CC_10081426
6-Contributor
(To:rhart)

Still not working ...

rhart
14-Alexandrite
(To:CC_10081426)

I guess the == operator can't compare two strings then.

Perhaps try a Business Algorithm to compare them.

for example, this is how it works:

 

state.state=="INWORK"?1:((((state.state=="20_TS_NOT_VALID")?0:(state.state=="10_TS_FAST_TRACK")?1:(state.state=="RELEASED")?2:3)))

 

Thanks for your solution. It is working well... But I have another question related to this topic. Is there a way to have more than these three colors? For example an additional black color for obsolete documents? And another question ... is it possible to show the traffic lights in the documents table?

 

Thanks in advance!

The question of more colors in the traffic light, I haven't looked into it further, but it should be possible.

 

https://support.ptc.com/help/windchill/r12.1.2.0/de/index.html#page/Windchill_Help_Center/customization/WCCG_UICust_PresentInfo_CustomGrapicalAttributes_procedure.html#

Thank you very much but I think this will be to complex.

 

Related to the new Attribute trafficlight ... Is there a way to hide the title of the attribute in the table like "General Status"?

 

Iteration.PNG

Top Tags