cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Change type of an attribute

former_member1193316
Participant
0 Kudos

Hi,

I m having an value attribute V1 of type string.

i have create an simple type called ST.

i want to convert V1 of the type string to ST.

how could i do this.

thnaks in advance,

Venkat

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can do that by creating the ST dynamically like below:

IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(<attributename>);

// Your attribute info

ISimpleTypeModifiable simpleType = attributeInfo.getModifiableSimpleType();

IModifiableSimpleValueSet vs = simpleType.getSVServices().getModifiableSimpleValueSet();

vs.put(<key>,<value>);

vs.put(<key>,<value>);

thanks & regards,

Manoj

former_member1193316
Participant
0 Kudos

Hi Manoj,

Thanks for your inputs, its really helpful.

But could you please let me know the other way, i.e., which i asked instead of following ur method....

Former Member
0 Kudos

Hi,

You mean to say you have an attribute of String type and a ST created at design time and now at run-time you want to convert the datatype of the attribute into the created ST. I dont think that it is possible.

If you want to the same at the design time only then you can always select the type from the dictionary after creating the ST.

thanks & regards,

Manoj

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can change this by

Create a dictionary simple type of type string

Go to the enumeration tab

Add new values.

Regards

Ayyapparaj