cancel
Showing results for 
Search instead for 
Did you mean: 

Setting characteristic via dependency

Former Member
0 Kudos

Hi,

I have a characteristic that I would like to set based upon the values in other characteristics.  There are 3 characteristics (char 1), which if any of the three are set to "Y" I want a 4th to get set to "Y".

So I set up a numeric characteristic that will just hold the number of "Y" values in char's 1-3 above.  I have a procedure dependency that counts the number of "Y"s and stores the count to this numeric characteristic.  This works great.

The next step is to set the 4th Y/N char if the counter > 0.  This is what I cannot get to work.

I have been able to set a second numeric characteristic in the same dependency so that is not the issue.

This is what my dependency has in it:

$SELF.set_counter = 0,

$SELF.set_counter=set_counter + 1 if YN1='Y',  

$SELF.set_counter=set_counter + 1 if YN2='Y',

$SELF.set_counter=set_counter + 1 if YN3='Y',

$SELF.YN4='Y' if set_counter>0

The set_counter gets properly set as the values YN1-3 change to and from "Y".

But the "YN4" never gets set to "Y".  Ever.

I have tried putting the last line in a second dependency thinking maybe there's an issue of setting a numeric and character value in the same dependency but that didn't work either.

For grins, I also threw this line at the bottom, to make sure I could change 2 characteristics in the same dependency.  The value gets set just fine.

$SELF.set_counterx2 = set_counter* 2

Can anyone tell me what I'm doing wrong?

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

ravi_kumar204
Active Participant
0 Kudos

Hi Cathy Neppel,

Once check "YN4" is Numeric /  Char Format.  As your are setting Char value ('Y') via dependency it should be Char Format.


- Ravikumar B


Former Member
0 Kudos

I think I figured out what was going on, although I don't understand why it was a problem.

The value that I'm trying to get set YN4 is set up as Restrictable with "Y" and "N" as values.  Apparently this setting doesn't play nice with setting the characteristic from a dependency.  I created a 5th characteristic YN5, did NOT set it as Restrictable but otherwise the same as my YN4, and the value changes as expected from the dependency. 

I would like to have that restriction on my characteristic though, because I still want it to only be Y or N.  As it is, as long as values YN1-3 are all null, YN5 can be anything I type in there.  If there is a Y value then it respects the fact that it must be Y and throws an inconsistency error if it's set to another value.

Any way I can make that restrictable and still be able to set it?

TIA

Cathy

Ritz
Active Contributor
0 Kudos

Cathy Neppel,

when you say restrictive are you taking about tick mark on first screen in CT04 or you want just the allowed values Y Or N ?

I belive instead of  selecting restrict tick mark , use values defined in value tab and do not tick mark allowed additional value. It will work for you.

As you are not using constraint , you don't need a restrict characteristic i guess.

Try and reply.

Thanks

Ritesh

Change-Make Characterstic Restrictable - Product Lifecycle Management - SCN Wiki